From 4c8693f01940d0492c7efdfcb2ae27ac45ce4575 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 13 Jun 2018 19:54:29 -0600 Subject: [PATCH] CMake: Run pytest as part of CTest --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index bef1ac8cbd..297ec2f3a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -107,6 +107,14 @@ if(BUILD_MODELS) DESTINATION share/panda3d) endif() +if(INTERROGATE_PYTHON_INTERFACE) + # If we built the Python interface, run the test suite. Note, we do NOT test + # for pytest before adding this test. If the user doesn't have pytest, we'd + # like for the tests to fail. + + add_test(pytest "${PYTHON_EXECUTABLE}" -m pytest "${PROJECT_SOURCE_DIR}/tests") +endif() + # This bit is to generate the 'pandac' compatibility shim. It's deprecated now, # but in older versions of Panda3D, one would use # from pandac.PandaModules import *