cmark

My personal build of CMark ✏️

Commit
ba8f2c48b700a466a8cf7097d5f72d43372d4c37
Parent
06138ad4c2b0246506dc5e4b406d0e9650427beb
Author
John MacFarlane <jgm@berkeley.edu>
Date

Use python2 for man, test scripts.

Closes #251.

Diffstat

4 files changed, 11 insertions, 7 deletions

Status File Name N° Changes Insertions Deletions
Modified man/CMakeLists.txt 4 3 1
Modified test/CMakeLists.txt 10 6 4
Modified test/pathological_tests.py 2 1 1
Modified test/spec_tests.py 2 1 1
diff --git a/man/CMakeLists.txt b/man/CMakeLists.txt
@@ -1,3 +1,5 @@
+set(PYTHON python2)
+
 if (NOT MSVC)
   add_custom_target(man ALL
     DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/cmark.3
@@ -6,7 +8,7 @@ if (NOT MSVC)
   add_custom_command(
     OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/cmark.3
     DEPENDS ${CMAKE_SOURCE_DIR}/src/cmark.h
-    COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/make_man_page.py
+    COMMAND ${PYTHON} ${CMAKE_CURRENT_SOURCE_DIR}/make_man_page.py
     ${CMAKE_SOURCE_DIR}/src/cmark.h >
     ${CMAKE_CURRENT_BINARY_DIR}/cmark.3
     )
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
@@ -1,5 +1,7 @@
 # To get verbose output: cmake --build build --target "test" -- ARGS='-V'
 
+set(PYTHON python2)
+
 if (WIN32)
   file(TO_NATIVE_PATH ${CMAKE_BINARY_DIR}/src WIN_DLL_DIR)
   set_tests_properties(api_test PROPERTIES
@@ -8,22 +10,22 @@ if (WIN32)
 endif(WIN32)
 
 add_test(html_normalization
-  python "-m" "doctest"
+  ${PYTHON} "-m" "doctest"
   "${CMAKE_CURRENT_SOURCE_DIR}/normalize.py"
 )
 
 add_test(spectest_library
-   python "${CMAKE_CURRENT_SOURCE_DIR}/spec_tests.py" "--no-normalize" "--spec"
+   ${PYTHON} "${CMAKE_CURRENT_SOURCE_DIR}/spec_tests.py" "--no-normalize" "--spec"
    "${CMAKE_SOURCE_DIR}/spec.txt" "--library-dir" "${CMAKE_BINARY_DIR}/src"
 )
 
 add_test(pathological_tests_library
-   python "${CMAKE_CURRENT_SOURCE_DIR}/pathological_tests.py"
+   ${PYTHON} "${CMAKE_CURRENT_SOURCE_DIR}/pathological_tests.py"
    "--library-dir" "${CMAKE_BINARY_DIR}/src"
 )
 
 add_test(NAME api_test COMMAND api_test)
 
 add_test(spectest_executable
-   python "${CMAKE_CURRENT_SOURCE_DIR}/spec_tests.py" "--no-normalize" "--spec" "${CMAKE_SOURCE_DIR}/spec.txt" "--program" "${CMAKE_BINARY_DIR}/src/cmark"
+   ${PYTHON} "${CMAKE_CURRENT_SOURCE_DIR}/spec_tests.py" "--no-normalize" "--spec" "${CMAKE_SOURCE_DIR}/spec.txt" "--program" "${CMAKE_BINARY_DIR}/src/cmark"
 ) 
\ No newline at end of file
diff --git a/test/pathological_tests.py b/test/pathological_tests.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python2
 # -*- coding: utf-8 -*-
 
 import re
diff --git a/test/spec_tests.py b/test/spec_tests.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python2
 # -*- coding: utf-8 -*-
 
 import sys