Skip to content

Commit 7cfc761

Browse files
authored
Clean cmake test configuration after change to cmake_common. (#129)
* Clean cmake test configuration after change to cmake_common. * Remove appveyor.yml.
1 parent 5bb4de0 commit 7cfc761

File tree

2 files changed

+10
-61
lines changed

2 files changed

+10
-61
lines changed

appveyor.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

tests/runner/CMakeLists.txt

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,23 @@ cmake_minimum_required(VERSION 3.22)
55

66
# first we configure the tests as with other tests
77
add_executable(runner-tests EXCLUDE_FROM_ALL)
8+
89
mo2_configure_tests(runner-tests WARNINGS OFF)
910

1011
set_target_properties(runner-tests PROPERTIES FOLDER tests/runner)
1112

13+
# link to runner
14+
target_link_libraries(runner-tests PUBLIC runner)
15+
16+
# linking to Python - this is not required to get proper linking but required so that
17+
# CMake generator variables will lookup appropriate DLLs for Python and update PATH
18+
# accordingly thanks to mo2_configure_tests
19+
target_link_libraries(runner-tests PUBLIC Python::Python)
20+
1221
# add mocks
1322
target_include_directories(runner-tests
1423
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../mocks)
1524

16-
# link to runner
17-
target_link_libraries(runner-tests PUBLIC runner)
18-
1925
set(PYLIB_DIR ${CMAKE_CURRENT_BINARY_DIR}/pylibs)
2026
mo2_python_pip_install(runner-tests
2127
DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/pylibs
@@ -26,20 +32,11 @@ mo2_python_pip_install(runner-tests
2632

2733
add_dependencies(runner-tests mobase)
2834

29-
# we set multiple properties, including:
30-
# - updated PATH for DLLs (Qt, etc.), Python and runner
31-
# - PYTHONPATH
32-
3335
set(pythoncore "${PYTHON_ROOT}/PCbuild/amd64/pythoncore")
3436
set(pythoncorezip "${pythoncore}/python${Python_VERSION_SHORT}.zip")
3537
set(PYTHONPATH "${PYLIB_DIR}\\;$<TARGET_FILE_DIR:mobase>\\;${pythoncore}\\;${pythoncorezip}")
3638

37-
set(extra_paths "${MO2_INSTALL_PATH}/bin/dlls")
38-
string(APPEND extra_paths "\\;${PYTHON_ROOT}/PCbuild/amd64")
39-
string(APPEND extra_paths "\\;$<TARGET_FILE_DIR:runner>")
4039
set_tests_properties(${runner-tests_gtests}
4140
PROPERTIES
42-
ENVIRONMENT "PLUGIN_DIR=${CMAKE_CURRENT_SOURCE_DIR}/plugins"
43-
ENVIRONMENT_MODIFICATION
44-
"PATH=path_list_prepend:${extra_paths};PYTHONPATH=set:${PYTHONPATH}"
41+
ENVIRONMENT "PLUGIN_DIR=${CMAKE_CURRENT_SOURCE_DIR}/plugins;PYTHONPATH=${PYTHONPATH}"
4542
)

0 commit comments

Comments
 (0)