md4c

C Markdown parser. Fast. SAX-like interface. Compliant to CommonMark specification.
git clone https://noulin.net/git/md4c.git
Log | Files | Refs | README | LICENSE

run-tests.sh (1601B)


      1 #!/bin/sh
      2 #
      3 # Run this script from build directory.
      4 
      5 #set -e
      6 
      7 SELF_DIR=`dirname $0`
      8 PROJECT_DIR="$SELF_DIR/.."
      9 TEST_DIR="$PROJECT_DIR/test"
     10 
     11 
     12 PROGRAM="md2html/md2html"
     13 if [ ! -x "$PROGRAM" ]; then
     14     echo "Cannot find the $PROGRAM." >&2
     15     echo "You have to run this script from the build directory." >&2
     16     exit 1
     17 fi
     18 
     19 if which python3 >>/dev/null 2>&1; then
     20     PYTHON=python3
     21 elif which python >>/dev/null 2>&1; then
     22     if [ `python --version | awk '{print $2}' | cut -d. -f1` -ge 3 ]; then
     23         PYTHON=python
     24     fi
     25 fi
     26 
     27 echo
     28 echo "CommonMark specification:"
     29 $PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/spec.txt" -p "$PROGRAM"
     30 
     31 echo
     32 echo "Code coverage & regressions:"
     33 $PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/coverage.txt" -p "$PROGRAM"
     34 
     35 echo
     36 echo "Permissive e-mail autolinks extension:"
     37 $PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/permissive-email-autolinks.txt" -p "$PROGRAM --fpermissive-email-autolinks"
     38 
     39 echo
     40 echo "Permissive URL autolinks extension:"
     41 $PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/permissive-url-autolinks.txt" -p "$PROGRAM --fpermissive-url-autolinks"
     42 
     43 echo
     44 echo "WWW autolinks extension:"
     45 $PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/permissive-www-autolinks.txt" -p "$PROGRAM --fpermissive-www-autolinks"
     46 
     47 echo
     48 echo "Tables extension:"
     49 $PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/tables.txt" -p "$PROGRAM --ftables"
     50 
     51 echo
     52 echo "Strikethrough extension:"
     53 $PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/strikethrough.txt" -p "$PROGRAM --fstrikethrough"
     54 
     55 echo
     56 echo "Pathological input:"
     57 $PYTHON "$TEST_DIR/pathological_tests.py" -p "$PROGRAM"