Improve/unify output of test scripts.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
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]')