Commit 38cf71a2 authored by Johan Ström's avatar Johan Ström

Another attempt on pytest from make

parent ed5adeb1
Pipeline #441 failed with stage
in 1 minute and 3 seconds
......@@ -38,11 +38,6 @@ else
# Set build version
SRC_DIR="${CI_PROJECT_DIR}" ./debian/version-increment.sh
env
which pytest
[ -z "$(which pytest)" ] && exit 1
# Manually run CMake targeting our source dir
cmake ${CI_PROJECT_DIR} -DCMAKE_BUILD_TYPE=Debug
......
......@@ -17,7 +17,7 @@ target_link_libraries (testrunner ${TEST_LIBRARIES})
add_test( cpp-test testrunner )
add_test( python-test pytest -v ${CMAKE_CURRENT_SOURCE_DIR}/python/)
add_test( python-test ${CMAKE_CURRENT_SOURCE_DIR}/run-pytest.sh -v ${CMAKE_CURRENT_SOURCE_DIR}/python/)
set_tests_properties(python-test PROPERTIES
ENVIRONMENT PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}/../python/)
......
#!/bin/sh
# This is mainly workaround for cmake 3.0 which does not seem to find pytest in PATH
# so we cannot call it directly from test.
# Do not write bytecode, creates problem if running local dev and in-container dev from same source
export PYTHONDONTWRITEBYTECODE=x
# Use explicit cachedir in $(pwd), which should be the build-dir when executed from CMake
pytest -o cache_dir=$(pwd)/.pytest_cache $*
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment