Q/A test improvements
authorCarlos Ghan <charlie.brown.uy@gmail.com>
Wed, 10 Feb 2010 10:07:31 +0000 (07:07 -0300)
committeredsiper <edsiper@monotop.(none)>
Wed, 10 Feb 2010 10:07:31 +0000 (07:07 -0300)
qa/README.txt
qa/TEMPLATE
qa/__CONFIG
qa/run_tests.sh

index 1521d7f..478ec86 100644 (file)
@@ -13,7 +13,7 @@ To run all tests:
        ./run-tests.sh
 
 [Variables in run-tests.sh]
-CONFIG_FILE                    Server parameters file
+CONFIG_FILE                    Server parameters file (don't forget to set TEST_DOC_ROOT)
 LOGFILE                                Log errors to this file
-STOP_AT_ERRORS                 Stop at first error  
+STOP_AT_ERRORS         Stop at first error  
 WITH_COLOR                     Enable/Disable color in output
index e5d8b16..0303d98 100644 (file)
@@ -1,4 +1,4 @@
-################################################################################
+###############################################################################
 # DESCRIPTION
 #      Test description        
 #
index af0b137..f8af0d7 100644 (file)
@@ -1,5 +1,9 @@
 # Global server settings
-SET PORT=2001
 SET HOST=localhost
+SET PORT=2001
 SET HTTPVER=HTTP/1.1
-_LOG_LEVEL 4
+
+SET DOC_ROOT=../htdocs
+SET TEST_DOC=index.html
+
+SET TEST_LOG_LEVEL=4
index 2cebcc4..4e9abe8 100755 (executable)
@@ -23,6 +23,9 @@ WITH_COLOR=yes
 HTTEST_CMD='httest'
 
 NTEST=1
+TESTS_FAILED=0
+TESTS_OK=0
+
 for test_file in $TEST_FILES; do
 #      echo -ne "[TEST $NTEST/$TOTAL_TESTS]\t""case: $test_file\t\t"
        printf "[%3d/%d]  %-32s  " $NTEST $TOTAL_TESTS "$test_file"
@@ -32,6 +35,7 @@ for test_file in $TEST_FILES; do
 
        case $ERRCODE in
                0) 
+                       TESTS_OK=$((TESTS_OK+1))
                        [ $WITH_COLOR = yes ] && echo -n "\e[1;32m"
                        echo "=> [OK]"
                        [ $WITH_COLOR = yes ] && echo -n "\e[m"
@@ -44,6 +48,7 @@ for test_file in $TEST_FILES; do
                        ;;
 
                *)
+                       TESTS_FAILED=$((TESTS_FAILED+1))
                        [ $WITH_COLOR = yes ] && echo -n "\e[1;31m"
                        echo "=> [FAILED]"
                        [ $WITH_COLOR = yes ] && echo -n "\e[m"
@@ -57,3 +62,5 @@ for test_file in $TEST_FILES; do
 
        NTEST=$((NTEST+1))
 done
+
+echo -e "\n$TESTS_OK test(s) succeeded, $TESTS_FAILED test(s) failed."