aboutsummaryrefslogtreecommitdiffstats
path: root/tests/CMakeLists.txt
blob: 645e8b3a625f2e62bf97b2f8202dc93426b5d3d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
add_subdirectory(libsample)
add_subdirectory(libother)
add_subdirectory(samplebinding)
add_subdirectory(otherbinding)

file(GLOB TEST_FILES samplebinding/*_test.py otherbinding/*_test.py)

set(test_blacklist "")

find_package(PythonInterp REQUIRED)
if(NOT CTEST_TESTING_TIMEOUT)
    set(CTEST_TESTING_TIMEOUT 60)
endif()

foreach(test_file ${TEST_FILES})
    string(REGEX MATCH "/([^/]+)_test.py" test_name ${test_file})
    list(FIND test_blacklist ${CMAKE_MATCH_1} expect_fail)
    add_test("${CMAKE_MATCH_1}" sh
             "${CMAKE_CURRENT_SOURCE_DIR}/run_test.sh"
             "${libsample_BINARY_DIR}:${libother_BINARY_DIR}:${libshiboken_BINARY_DIR}"
             "${sample_BINARY_DIR}:${other_BINARY_DIR}"
             "${PYTHON_EXECUTABLE}"
             "${test_file}")
    set_tests_properties(${CMAKE_MATCH_1} PROPERTIES TIMEOUT ${CTEST_TESTING_TIMEOUT})
    if (${expect_fail} GREATER -1)
        set_tests_properties(${CMAKE_MATCH_1} PROPERTIES WILL_FAIL TRUE)
    endif(${expect_fail} GREATER -1)

# Should set python path here
# Looks like it's fixed in 2.8:
# http://www.vtk.org/Bug/print_bug_page.php?bug_id=7885
endforeach(test_file ${TEST_FILES})