]> granicus.if.org Git - graphviz/commitdiff
Add Python based regression tests to CMake
authorErwin Janssen <erwinjanssen@outlook.com>
Fri, 24 Mar 2017 09:21:24 +0000 (10:21 +0100)
committerErwin Janssen <erwinjanssen@outlook.com>
Thu, 6 Apr 2017 19:38:03 +0000 (21:38 +0200)
This commits add the Python based regression tests to CMake, after
Graphviz has been build and installed, it can be executed by running
`ctest` in the build directory.

CMakeLists.txt
tests/CMakeLists.txt [new file with mode: 0644]
tests/regression_tests/CMakeLists.txt [new file with mode: 0644]
tests/regression_tests/shapes/CMakeLists.txt [new file with mode: 0644]

index cb01413bdbec2df9d3e07338e4ca07078afbfc70..4a324384f10813995e2a249cbb81d09705a9c79f 100644 (file)
@@ -10,7 +10,7 @@ option(with_sfdp       "sfdp layout engine." ON )
 option(with_smyrna     "SMYRNA large graph viewer (disabled by default - experimental)" OFF)
 
 if (enable_ltdl)
-    add_definitions(-DENABLE_LTDL)
+        add_definitions(-DENABLE_LTDL)
 endif (enable_ltdl)
 
 if (with_digcola)
@@ -138,3 +138,6 @@ include(CPack)
 add_subdirectory(lib)
 add_subdirectory(plugin)
 add_subdirectory(cmd)
+
+enable_testing()
+add_subdirectory(tests)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
new file mode 100644 (file)
index 0000000..83b7504
--- /dev/null
@@ -0,0 +1,7 @@
+find_package(PythonInterp)
+
+if (PYTHONINTERP_FOUND)
+    add_subdirectory(regression_tests)
+else ()
+    message(WARNING "Python interperter not found, required for regression tests.")
+endif ()
diff --git a/tests/regression_tests/CMakeLists.txt b/tests/regression_tests/CMakeLists.txt
new file mode 100644 (file)
index 0000000..7c742c2
--- /dev/null
@@ -0,0 +1 @@
+add_subdirectory(shapes)
diff --git a/tests/regression_tests/shapes/CMakeLists.txt b/tests/regression_tests/shapes/CMakeLists.txt
new file mode 100644 (file)
index 0000000..2aa1555
--- /dev/null
@@ -0,0 +1,5 @@
+add_test(
+    NAME shapes
+    WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
+    COMMAND ${PYTHON_EXECUTABLE} shapes.py
+)