Commit 938460d564d7367ec969f015eb341164f438e780

Martin Mitas 2017-07-24T21:17:53

Improve/unify output of test scripts.

diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh
index 576976c..e388b90 100755
--- a/scripts/run-tests.sh
+++ b/scripts/run-tests.sh
@@ -16,27 +16,42 @@ if [ ! -x "$PROGRAM" ]; then
     exit 1
 fi
 
-if which python3 2>/dev/null; then
+if which python3 >>/dev/null 2>&1; then
     PYTHON=python3
-elif which python 2>/dev/null; then
+elif which python >>/dev/null 2>&1; then
     if [ `python --version | awk '{print $2}' | cut -d. -f1` -ge 3 ]; then
         PYTHON=python
     fi
 fi
 
-# Test CommonMark specification compliance
-# (using the vanilla specification file):
+echo
+echo "CommonMark specification:"
 $PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/spec.txt" -p "$PROGRAM"
 
-# More tests for better coverage ten what the spec provides:
+echo
+echo "Code coverage & regressions:"
 $PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/coverage.txt" -p "$PROGRAM"
 
-# Test various extensions and deviations from the specifications:
+echo
+echo "Permissive e-mail autolinks extension:"
 $PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/permissive-email-autolinks.txt" -p "$PROGRAM --fpermissive-email-autolinks"
+
+echo
+echo "Permissive URL autolinks extension:"
 $PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/permissive-url-autolinks.txt" -p "$PROGRAM --fpermissive-url-autolinks"
+
+echo
+echo "WWW autolinks extension:"
 $PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/permissive-www-autolinks.txt" -p "$PROGRAM --fpermissive-www-autolinks"
+
+echo
+echo "Tables extension:"
 $PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/tables.txt" -p "$PROGRAM --ftables"
+
+echo
+echo "Strikethrough extension:"
 $PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/strikethrough.txt" -p "$PROGRAM --fstrikethrough"
 
-# Run pathological tests:
+echo
+echo "Pathological input:"
 $PYTHON "$TEST_DIR/pathological_tests.py" -p "$PROGRAM"
diff --git a/test/pathological_tests.py b/test/pathological_tests.py
index 5b03408..3adc97d 100644
--- a/test/pathological_tests.py
+++ b/test/pathological_tests.py
@@ -72,7 +72,7 @@ passed = 0
 errored = 0
 failed = 0
 
-print("Testing pathological cases:")
+#print("Testing pathological cases:")
 for description in pathological:
     (inp, regex) = pathological[description]
     [rc, actual, err] = cmark.to_html(inp)
@@ -81,7 +81,7 @@ for description in pathological:
         print(description, '[ERRORED (return code %d)]' %rc)
         print(err)
     elif regex.search(actual):
-        print(description, '[PASSED]')
+        #print(description, '[PASSED]')
         passed += 1
     else:
         print(description, '[FAILED]')