CMakeLists.txt 823 B

1234567891011121314151617181920
  1. if(NOT INTERROGATE_PYTHON_INTERFACE)
  2. return()
  3. endif()
  4. add_executable(run_pytest main.c)
  5. target_link_libraries(run_pytest panda)
  6. target_link_libraries(run_pytest Python::Python)
  7. # Note, we do NOT test for pytest before adding this test. If the user doesn't
  8. # have pytest, we'd like for the tests to fail.
  9. # In the Coverage configuration, we also require pytest-cov
  10. # To prevent an empty argument from being passed in in non-Coverage builds,
  11. # which will sometimes cause pytest to read all tests in the current directory,
  12. # substitute a nonsensical argument that will be ignored instead
  13. add_test(NAME pytest COMMAND run_pytest tests $<IF:$<CONFIG:Coverage>,--cov=.,--ignore=nonexistent>
  14. WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}")
  15. set_tests_properties(pytest PROPERTIES ENVIRONMENT "PYTHONPATH=${PANDA_OUTPUT_DIR}")