Make the parallelize intergration test short enough to run at
[python_utils.git] / tests / run_tests.sh
index 691216b99353821034ddf05d11c5c23b35d27b3a..6255a69572bb2d232ea35955d8607269049ce392 100755 (executable)
@@ -8,6 +8,9 @@ UNITTEST=0
 INTEGRATION=0
 FAILURES=0
 TESTS_RUN=0
+COVERAGE=0
+PERF_TESTS=("string_utils_test.py")
+
 
 dup() {
     if [ $# -ne 2 ]; then
@@ -118,10 +121,14 @@ fi
 if [ ${UNITTEST} -eq 1 ]; then
     for test in $(find ${ROOT} -name "*_test.py" -print); do
         BASE=$(basename ${test})
-        BASE="${BASE} (unittest)"
-        make_header "${BASE}" "${GREEN}"
+        HDR="${BASE} (unittest)"
+        make_header "${HDR}" "${GREEN}"
         if [ ${COVERAGE} -eq 1 ]; then
             coverage run --source ${HOME}/lib --append ${test} --unittests_ignore_perf
+            if [[ " ${PERF_TESTS[*]} " =~ " ${BASE} " ]]; then
+                echo "(re-running w/o coverage to record perf results)."
+                ${test}
+            fi
         else
             ${test}
         fi
@@ -136,8 +143,8 @@ fi
 if [ ${INTEGRATION} -eq 1 ]; then
     for test in $(find ${ROOT} -name "*_itest.py" -print); do
         BASE=$(basename ${test})
-        BASE="${BASE} (integration test)"
-        make_header "${BASE}" "${ORANGE}"
+        HDR="${BASE} (integration test)"
+        make_header "${HDR}" "${ORANGE}"
         if [ ${COVERAGE} -eq 1 ]; then
             coverage run --source ${HOME}/lib --append ${test}
         else