Edit

kc3-lang/md4c/scripts/run-tests.sh

Branch :

  • Show log

    Commit

  • Author : Martin Mitas
    Date : 2016-11-21 09:47:31
    Hash : be7fcc16
    Message : Implement tables. Note it is implemented as an extension. To enable it, the flag MD_FLAG_TABLES must be explicitly specified.

  • scripts/run-tests.sh
  • #!/bin/sh
    #
    # Run this script from build directory.
    
    #set -e
    
    SELF_DIR=`dirname $0`
    PROJECT_DIR="$SELF_DIR/.."
    TEST_DIR="$PROJECT_DIR/test"
    
    
    PROGRAM="md2html/md2html"
    if [ ! -x "$PROGRAM" ]; then
        echo "Cannot find the $PROGRAM." >&2
        echo "You have to run this script from the build directory." >&2
        exit 1
    fi
    
    if which python3 2>/dev/null; then
        PYTHON=python3
    elif which python 2>/dev/null; then
        if [ `python --version | awk '{print $2}' | cut -d. -f1` -ge 3 ]; then
            PYTHON=python
        fi
    fi
    
    # Test CommonMark specification compliance (with default options):
    $PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/spec.txt" -p "$PROGRAM"
    
    # Test various extensions and deviations from the specifications:
    $PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/permissive-email-autolinks.txt" -p "$PROGRAM --fpermissive-email-autolinks"
    $PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/permissive-url-autolinks.txt" -p "$PROGRAM --fpermissive-url-autolinks"
    $PYTHON "$TEST_DIR/spec_tests.py" -s "$TEST_DIR/tables.txt" -p "$PROGRAM --ftables"