Skip to content

Commit

Permalink
some fixes for python-related tests
Browse files Browse the repository at this point in the history
  • Loading branch information
phfaist committed Feb 22, 2017
1 parent a9bee17 commit ab60215
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
10 changes: 7 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -267,16 +267,20 @@ if(TOMOGRAPHER_ENABLE_TESTS)
find_package(LAPACK REQUIRED)
#endif(NOT LAPACK_FOUND)


option(TOMOGRAPHER_TEST_SETUPPY_BUILD "Add tests for python module built separately with setup.py bdist_egg" off)


EnsureCXX11StdThisThreadSleepForAvailable()

# find the python executable -- used to run the tests for the python interface
find_package(PythonInterp REQUIRED)
if(BUILD_TOMOPY OR TOMOGRAPHER_TEST_SETUPPY_BUILD)
find_package(PythonInterp REQUIRED)
endif()

# Enable testing for the project
enable_testing()

option(TOMOGRAPHER_TEST_SETUPPY_BUILD "Add tests for python module built separately with setup.py bdist_egg" off)

message(STATUS "Will build tomographer tests. Use `make test' or `ctest' to run the tests.")
add_subdirectory(test)

Expand Down
5 changes: 3 additions & 2 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@ else()
endif()

# we need to access the expected output patterns. Trailing slash needed.
set(TOMOGRAPHER_TEST_PATTERNS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/patterns/"
file(RELATIVE_PATH REL_TEST_SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/" "${CMAKE_CURRENT_SOURCE_DIR}/")
set(TOMOGRAPHER_TEST_PATTERNS_DIR "${REL_TEST_SOURCE_DIR}/patterns/"
CACHE STRING "path to the expected test results patterns")
add_definitions(-DTOMOGRAPHER_TEST_PATTERNS_DIR="${TOMOGRAPHER_TEST_PATTERNS_DIR}")
# we need to access some data. Trailing slash needed.
set(TOMOGRAPHER_TEST_DATA_DIR "${CMAKE_CURRENT_SOURCE_DIR}/data/"
set(TOMOGRAPHER_TEST_DATA_DIR "${REL_TEST_SOURCE_DIR}/data/"
CACHE STRING "path to data files required by some tests")
add_definitions(-DTOMOGRAPHER_TEST_DATA_DIR="${TOMOGRAPHER_TEST_DATA_DIR}")

Expand Down

0 comments on commit ab60215

Please sign in to comment.