aboutsummaryrefslogtreecommitdiff
path: root/test/CMakeLists.txt
blob: 11a27c64cf8a6e90ce5c59b2cb5f5b6769ac71ca (plain)
  1. # To get verbose output: cmake --build build --target "test" -- ARGS='-V'
  2. # By default, we run the spec tests only if python3 is available.
  3. # To require the spec tests, compile with -DSPEC_TESTS=1
  4. if (SPEC_TESTS)
  5. find_package(PythonInterp 3 REQUIRED)
  6. else(SPEC_TESTS)
  7. find_package(PythonInterp 3)
  8. endif(SPEC_TESTS)
  9. add_test(NAME api_test COMMAND api_test)
  10. if (WIN32)
  11. file(TO_NATIVE_PATH ${CMAKE_BINARY_DIR}/src WIN_DLL_DIR)
  12. set_tests_properties(api_test PROPERTIES
  13. ENVIRONMENT "PATH=${WIN_DLL_DIR};$ENV{PATH}"
  14. )
  15. endif(WIN32)
  16. IF (PYTHONINTERP_FOUND)
  17. add_test(html_normalization
  18. ${PYTHON_EXECUTABLE} "-m" "doctest"
  19. "${CMAKE_CURRENT_SOURCE_DIR}/normalize.py"
  20. )
  21. add_test(spectest_library
  22. ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/spec_tests.py" "--no-normalize" "--spec"
  23. "${CMAKE_SOURCE_DIR}/spec.txt" "--library-dir" "${CMAKE_BINARY_DIR}/src"
  24. )
  25. add_test(pathological_tests_library
  26. ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/pathological_tests.py"
  27. "--library-dir" "${CMAKE_BINARY_DIR}/src"
  28. )
  29. add_test(spectest_executable
  30. ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/spec_tests.py" "--no-normalize" "--spec" "${CMAKE_SOURCE_DIR}/spec.txt" "--program" "${CMAKE_BINARY_DIR}/src/cmark"
  31. )
  32. ELSE(PYTHONINTERP_FOUND)
  33. message("\n*** A python 3 interpreter is required to run the spec tests.\n")
  34. add_test(skipping_spectests
  35. echo "Skipping spec tests, because no python 3 interpreter is available.")
  36. ENDIF(PYTHONINTERP_FOUND)