Parse build results from log file

This commit is contained in:
Fernando Cacciola 2008-05-13 23:15:41 +00:00
parent 56dd45d2b7
commit 00eb0889ca
1 changed files with 53 additions and 35 deletions

View File

@ -37,6 +37,48 @@ print_testresult()
echo "$2 $RESULT"
}
BUILD_LOGFILE=''
TEST_REPORT=''
RESULT_FILE=''
parse_flags_and_third_party_choices()
{
grep "^Cached " ${BUILD_LOGFILE} >> $RESULT_FILE
echo "------------" >> $RESULT_FILE
}
parse_lib_building_results()
{
libname=$1
target=$2
mkdir "${libname}_${shared_or_static}"
y_or_no='n'
if grep -q "Built target ${target}$" ${BUILD_LOGFILE} ; then
y_or_no='y'
fi
marker_beg=`grep "${target}.dir/depend$" ${BUILD_LOGFILE}`
if [ -n "${marker_beg}" ]; then
cat ${BUILD_LOGFILE} | sed -n "\|${marker_beg}|,\|depend$| p" > ${libname}_${shared_or_static}/$TEST_REPORT
# Test if there is a warning in the build log.
if [ "$y_or_no" = "y" ]; then
if grep -i warning ${libname}_${shared_or_static}/$TEST_REPORT | grep -v 'read_only_relocs,warning' > /dev/null; then
y_or_no='w'
fi
fi
else
echo "Not configured!" > ${libname}_${shared_or_static}/$TEST_REPORT
fi
echo ${libname}_${shared_or_static} $y_or_no >> $RESULT_FILE
}
# do_platform <platform>
do_platform()
{
@ -48,6 +90,7 @@ do_platform()
TEST_REPORT="TestReport_${TESTER}_${PLATFORM}"
RESULT_FILE=$CURRENT_DIR/results_${TESTER}_${PLATFORM}.txt
CGAL_DIR=../../../..
BUILD_LOGFILE="${CURRENT_DIR}/autotest_cgal_with_cmake.log.${PLATFORM}.build"
rm -f $RESULT_FILE
touch $RESULT_FILE
sed -n '/CGAL_VERSION /s/#define //p' < $CGAL_DIR/include/CGAL/version.h >> $RESULT_FILE
@ -56,41 +99,16 @@ do_platform()
echo "TESTER_ADDRESS ${TESTER_ADDRESS}" >> $RESULT_FILE
echo "PLATFORM ${PLATFORM}" >> $RESULT_FILE
LEDA_INCL_DIR=`cat "${CGAL_DIR}/config/install/${PLATFORM}" |sed -n '/LEDA_INCL_DIR/s/^.*= .\([^ ]*\). .*$/\1/p'`
if [ -r ${LEDA_INCL_DIR}/LEDA/basic.h ]; then
sed -n '/__LEDA__/s/^#define __LEDA__/LEDA version/p' < ${LEDA_INCL_DIR}/LEDA/basic.h >>$RESULT_FILE
fi
if [ -f "${BUILD_LOGFILE}" ] ; then
cat "${CGAL_DIR}/config/install/${PLATFORM}" >> $RESULT_FILE
echo "------------" >> $RESULT_FILE
parse_flags_and_third_party_choices
if [ -f install.log.${PLATFORM} ] ; then
[ -f install.log ] && cat install.log >> Installation/ProgramOutput.install.log.${PLATFORM}
cat install.log.${PLATFORM} >> Installation/ProgramOutput.install.log.${PLATFORM}
parse_lib_building_results "libCGAL-core++" "CGAL_CORE"
parse_lib_building_results "libCGAL" "CGAL"
parse_lib_building_results "libCGALimageIO" "CGAL_IMAGEIO"
parse_lib_building_results "libCGAL-PDB" "CGAL_PDB"
parse_lib_building_results "libCGAL-Qt" "CGAL_QT"
grep "Compilation of" install.log.${PLATFORM} \
| awk '{ print $3 " " $4 " " $6; }' \
| sed -e 's/succeeded\.$/y/' -e 's/failed\.$/n/' \
| while read libname shared_or_static y_or_no; do
mkdir "${libname}_${shared_or_static}"
# Make sure to let the following variable _buildlog_marker be synced
# with the variable _buildlog_marker from the script install_cgal.
_buildlog_marker="log for ${libname} ${shared_or_static} shown"
cat install.log.${PLATFORM} \
| sed -n "/${_buildlog_marker} below/,/${_buildlog_marker} above/ p" \
> ${libname}_${shared_or_static}/$TEST_REPORT
# Test if there is a warning in the build log.
if [ "$y_or_no" = "y" ]; then
if grep -i warning ${libname}_${shared_or_static}/$TEST_REPORT | grep -v 'read_only_relocs,warning' > /dev/null; then
y_or_no=w
fi
fi
echo ${libname}_${shared_or_static} $y_or_no >> $RESULT_FILE
done
fi
for DIR in $TEST_DIRECTORIES ; do