diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index a54f11c2d..108dab0dd 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -10,7 +10,8 @@ set (test_SRCS autocomplete.t color.t config.t date.t directory.t dom.t duration.t file.t i18n.t json.t list.t nibbler.t path.t rx.t t.t t2.t taskmod.t tdb2.t text.t uri.t util.t view.t json_test) -add_custom_target (test ./run_all DEPENDS ${test_SRCS} task_executable +add_custom_target (test ./run_all --verbose + DEPENDS ${test_SRCS} task_executable WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/test) add_custom_target (build_tests DEPENDS ${test_SRCS} diff --git a/test/run_all b/test/run_all index 230c82e5a..ed45cb488 100755 --- a/test/run_all +++ b/test/run_all @@ -1,39 +1,56 @@ -#! /bin/bash +#! /bin/sh -date > all.log -STARTEPOCH=`perl -e 'print time'` +if [ x"$1" = x"--verbose" ]; +then + for i in *.t *.t.exe + do + echo '#' $i + ./$i > test.log 2>&1 + while read LINE + do + echo $LINE + done < test.log + rm test.log + done +else + date > all.log -VRAMSTEG=/usr/local/bin/vramsteg -BAR=0 -if [ -x $VRAMSTEG ]; then - BAR=1 - COUNT=0 - TOTAL=$(ls *.t | wc -l) - START=$($VRAMSTEG --now) -fi + # Perl is used here to get the time in seconds + # because 'date +%s' isn't supported on Solaris. + STARTEPOCH=`perl -e 'print time'` -for i in *.t *.t.exe -do - echo '#' $i >>all.log - - if [ $BAR == 1 ]; then - $VRAMSTEG --label 'All tests' --min 0 --max $TOTAL --current $COUNT --percentage --start $START --estimate - COUNT=$[COUNT + 1] + VRAMSTEG=`which vramsteg` + BAR=0 + if [ -x "$VRAMSTEG" ]; then + BAR=1 + COUNT=0 + TOTAL=`ls *.t | wc -l` + START=`$VRAMSTEG --now` fi - ./$i >> all.log 2>&1 -done + for i in *.t *.t.exe + do + echo '#' $i >>all.log -if [ $BAR == 1 ]; then - $VRAMSTEG --remove + if [ $BAR -eq 1 ]; then + $VRAMSTEG --label 'All tests' --min 0 --max $TOTAL --current $COUNT --percentage --start $START --estimate + COUNT=`expr $COUNT + 1` + fi + + ./$i >> all.log 2>&1 + done + + if [ $BAR -eq 1 ]; then + $VRAMSTEG --remove + fi + + date >> all.log + + ENDEPOCH=`perl -e 'print time'` + RUNTIME=`expr $ENDEPOCH - $STARTEPOCH` + + printf "Pass: %5d\n" `grep -c '^ok' all.log` + printf "Fail: %5d\n" `grep -c '^not' all.log` + printf "Skipped: %5d\n" `grep -c '^skip' all.log` + printf "Runtime: %5d seconds\n" $RUNTIME fi - -date >> all.log -ENDEPOCH=`perl -e 'print time'` - -RUNTIME=$(($ENDEPOCH - $STARTEPOCH)) - -printf "Pass: %5d\n" $(grep -c ^ok all.log) -printf "Fail: %5d\n" $(grep -c ^not all.log) -printf "Skipped: %5d\n" $(grep -c ^skip all.log) -printf "Runtime: %5d seconds\n" $RUNTIME