diff options
-rw-r--r-- | .travis.yml | 5 | ||||
-rw-r--r-- | Makefile | 3 | ||||
-rwxr-xr-x | test/CMakeLists.txt | 11 | ||||
-rwxr-xr-x | test/roundtrip.bat | 1 | ||||
-rwxr-xr-x | test/roundtrip.sh | 2 |
5 files changed, 13 insertions, 9 deletions
diff --git a/.travis.yml b/.travis.yml index 25c3ec1..059a53d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,10 +29,5 @@ script: - | if [ ${TRAVIS_OS_NAME:-'linux'} = 'linux' ] then - make roundtrip_test - fi - - | - if [ ${TRAVIS_OS_NAME:-'linux'} = 'linux' ] - then make leakcheck fi @@ -128,9 +128,6 @@ update-spec: test: $(SPEC) cmake_build make -C $(BUILDDIR) test || (cat $(BUILDDIR)/Testing/Temporary/LastTest.log && exit 1) -roundtrip_test: $(SPEC) cmake_build - python3 test/spec_tests.py --spec $< --prog test/roundtrip.sh - $(ALLTESTS): $(SPEC) python3 test/spec_tests.py --spec $< --dump-tests | python3 -c 'import json; import sys; tests = json.loads(sys.stdin.read()); print("\n".join([test["markdown"] for test in tests]))' > $@ diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 164fba1..d537ab5 100755 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -16,6 +16,9 @@ if (WIN32) set_tests_properties(api_test PROPERTIES ENVIRONMENT "PATH=${WIN_DLL_DIR};$ENV{PATH}" ) + set(ROUNDTRIP,"${CMAKE_CURRENT_SOURCE_DIR}/roundtrip.bat") +else(WIN32) + set(ROUNDTRIP,"${CMAKE_CURRENT_SOURCE_DIR}/roundtrip.sh") endif(WIN32) IF (PYTHONINTERP_FOUND) @@ -43,6 +46,14 @@ IF (PYTHONINTERP_FOUND) ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/spec_tests.py" "--no-normalize" "--spec" "${CMAKE_CURRENT_SOURCE_DIR}/smart_punct.txt" "--program" "${CMAKE_CURRENT_BINARY_DIR}/../src/cmark --smart" ) + add_test(roundtriptest_executable + ${PYTHON_EXECUTABLE} + "${CMAKE_CURRENT_SOURCE_DIR}/spec_tests.py" "--no-normalize" + "--spec" "${CMAKE_CURRENT_SOURCE_DIR}/spec.txt" "--program" + "${ROUNDTRIP} ${CMAKE_CURRENT_BINARY_DIR}/../src/cmark" + ) + + ELSE(PYTHONINTERP_FOUND) message("\n*** A python 3 interpreter is required to run the spec tests.\n") diff --git a/test/roundtrip.bat b/test/roundtrip.bat new file mode 100755 index 0000000..ac4c9ed --- /dev/null +++ b/test/roundtrip.bat @@ -0,0 +1 @@ +"%1" -t commonmark | "%1" diff --git a/test/roundtrip.sh b/test/roundtrip.sh index 1631f35..ec4f135 100755 --- a/test/roundtrip.sh +++ b/test/roundtrip.sh @@ -1,2 +1,2 @@ #!/bin/sh -./build/src/cmark -t commonmark | ./build/src/cmark +"$1" -t commonmark | "$1" |