From 00eb0889ca81834ecd9833e0889649e8612bcaee Mon Sep 17 00:00:00 2001 From: Fernando Cacciola Date: Tue, 13 May 2008 23:15:41 +0000 Subject: [PATCH] Parse build results from log file --- .../test/collect_cgal_testresults_from_cmake | 88 +++++++++++-------- 1 file changed, 53 insertions(+), 35 deletions(-) diff --git a/Testsuite/test/collect_cgal_testresults_from_cmake b/Testsuite/test/collect_cgal_testresults_from_cmake index dd0a6485dfb..d4bc883389d 100755 --- a/Testsuite/test/collect_cgal_testresults_from_cmake +++ b/Testsuite/test/collect_cgal_testresults_from_cmake @@ -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 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 - - cat "${CGAL_DIR}/config/install/${PLATFORM}" >> $RESULT_FILE - echo "------------" >> $RESULT_FILE - - 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} - - 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 + if [ -f "${BUILD_LOGFILE}" ] ; then + + parse_flags_and_third_party_choices + + 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" + fi for DIR in $TEST_DIRECTORIES ; do