[fwbuilder-commits] r3170 - branches/v4_1/src/gui/unit_tests/commandLinePrintingTest
Brought to you by:
mikehorn
From: <a2...@in...> - 2010-07-29 13:46:27
|
Author: a2k Date: 2010-07-29 06:46:44 -0700 (Thu, 29 Jul 2010) New Revision: 3170 Added: branches/v4_1/src/gui/unit_tests/commandLinePrintingTest/commandLinePrintingTest Removed: branches/v4_1/src/gui/unit_tests/commandLinePrintingTest/test.sh Modified: branches/v4_1/src/gui/unit_tests/commandLinePrintingTest/commandLinePrintingTest.pro Log: renamed test.sh to commandLinePrintingTest for better automatic tests result view Added: branches/v4_1/src/gui/unit_tests/commandLinePrintingTest/commandLinePrintingTest =================================================================== --- branches/v4_1/src/gui/unit_tests/commandLinePrintingTest/commandLinePrintingTest (rev 0) +++ branches/v4_1/src/gui/unit_tests/commandLinePrintingTest/commandLinePrintingTest 2010-07-29 13:46:44 UTC (rev 3170) @@ -0,0 +1,64 @@ +#!/bin/bash + +rm -f print.pdf >/dev/null 2>/dev/null + +QTVERSION=`qmake --version | tail -n1| cut -d' ' -f4` +TESTNAME=$(basename `pwd`) +PASSED=0 +FAILED=0 +SKIPPED=0 + +function pass # test_name +{ + echo "PASS : ${TESTNAME}::$1()" + PASSED=$((PASSED+1)) +} + +function fail # test_name +{ + echo "FAIL! : ${TESTNAME}::$1()" + FAILED=$((FAILED+1)) +} + +function output # test_name text +{ + echo -n "QDEBUG : ${TESTNAME}::$1() " + shift + echo $@ +} + +function run_command # test_name command +{ + test=$1 + shift + command=$@ + output=$($command 2>&1) + returned=$? + ORIGIFS=$IFS + IFS=`echo -en "\n\b"` + for line in $output + do + output $test $line + done + IFS=$ORIGIFS + [ $returned -eq 0 ] && pass $test || fail $test +} + + +echo "********* Start testing of ${TESTNAME} *********" +echo "Config: Using QTest library ${QTVERSION}, Qt ${QTVERSION}" +pass "initTestCase" + +# -------- actual testing goes here -------- + +run_command "runPrinting" "../../fwbuilder -f test.fwb -P test" +run_command "fileExists" "ls print.pdf" + +# --------- end of actual testing --------- + +rm -f print.pdf >/dev/null 2>&1 + +pass "cleanupTestCase" +echo "Totals: ${PASSED} passed, ${FAILED} failed, ${SKIPPED} skipped" +echo "********* Finished testing of ${TESTNAME} *********" +[ ${FAILED} -eq 0 ] && exit 0 || exit 1 Property changes on: branches/v4_1/src/gui/unit_tests/commandLinePrintingTest/commandLinePrintingTest ___________________________________________________________________ Added: svn:executable + * Modified: branches/v4_1/src/gui/unit_tests/commandLinePrintingTest/commandLinePrintingTest.pro =================================================================== --- branches/v4_1/src/gui/unit_tests/commandLinePrintingTest/commandLinePrintingTest.pro 2010-07-29 02:19:06 UTC (rev 3169) +++ branches/v4_1/src/gui/unit_tests/commandLinePrintingTest/commandLinePrintingTest.pro 2010-07-29 13:46:44 UTC (rev 3170) @@ -3,7 +3,7 @@ CONFIG += console CONFIG -= app_bundle -TARGET = test.sh +TARGET = commandLinePrintingTest run_tests.commands = echo "Running tests..." && ./${TARGET} && echo "OK" || echo "FAILED" run_tests.depends = build_tests clean_tests.commands = rm -f print.pdf Deleted: branches/v4_1/src/gui/unit_tests/commandLinePrintingTest/test.sh =================================================================== --- branches/v4_1/src/gui/unit_tests/commandLinePrintingTest/test.sh 2010-07-29 02:19:06 UTC (rev 3169) +++ branches/v4_1/src/gui/unit_tests/commandLinePrintingTest/test.sh 2010-07-29 13:46:44 UTC (rev 3170) @@ -1,64 +0,0 @@ -#!/bin/bash - -rm -f print.pdf >/dev/null 2>/dev/null - -QTVERSION=`qmake --version | tail -n1| cut -d' ' -f4` -TESTNAME=$(basename `pwd`) -PASSED=0 -FAILED=0 -SKIPPED=0 - -function pass # test_name -{ - echo "PASS : ${TESTNAME}::$1()" - PASSED=$((PASSED+1)) -} - -function fail # test_name -{ - echo "FAIL! : ${TESTNAME}::$1()" - FAILED=$((FAILED+1)) -} - -function output # test_name text -{ - echo -n "QDEBUG : ${TESTNAME}::$1() " - shift - echo $@ -} - -function run_command # test_name command -{ - test=$1 - shift - command=$@ - output=$($command 2>&1) - returned=$? - ORIGIFS=$IFS - IFS=`echo -en "\n\b"` - for line in $output - do - output $test $line - done - IFS=$ORIGIFS - [ $returned -eq 0 ] && pass $test || fail $test -} - - -echo "********* Start testing of ${TESTNAME} *********" -echo "Config: Using QTest library ${QTVERSION}, Qt ${QTVERSION}" -pass "initTestCase" - -# -------- actual testing goes here -------- - -run_command "runPrinting" "../../fwbuilder -f test.fwb -P test" -run_command "fileExists" "ls print.pdf" - -# --------- end of actual testing --------- - -rm -f print.pdf >/dev/null 2>&1 - -pass "cleanupTestCase" -echo "Totals: ${PASSED} passed, ${FAILED} failed, ${SKIPPED} skipped" -echo "********* Finished testing of ${TESTNAME} *********" -[ ${FAILED} -eq 0 ] && exit 0 || exit 1 |