forked from jupyter-xeus/xeus-uv
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
63 lines (43 loc) · 1.76 KB
/
CMakeLists.txt
File metadata and controls
63 lines (43 loc) · 1.76 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
############################################################################
# Copyright (c) 2026, Dr. Thorsten Beier #
# Copyright (c) 2024, Isabel Paredes #
# Copyright (c) 2024, QuantStack #
# #
# Distributed under the terms of the BSD 3-Clause License. #
# #
# The full license is in the file LICENSE, distributed with this software. #
############################################################################
# add test executable
add_executable(test_kernel
xmock_interpreter.cpp
main.cpp)
# link to xeus-uv and xeus-zmq
if(XEUS_UV_BUILD_SHARED_LIBS)
target_link_libraries(test_kernel PRIVATE xeus-uv)
else()
target_link_libraries(test_kernel PRIVATE xeus-uv-static xeus-zmq-static)
endif()
target_compile_definitions(test_kernel PUBLIC UVW_AS_LIB)
target_compile_features(test_kernel PRIVATE cxx_std_17)
# include current source dir for xmock_interpreter.hpp
target_include_directories(test_kernel PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/include
${UVW_INCLUDE_DIRS}
)
enable_testing()
find_program(PYTEST
NAMES pytest-3 pytest py.test-3 py.test REQUIRED)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/test_kernel/kernel.json.in"
"kernels/test_kernel/kernel.json"
)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/test_kernel.py"
"${CMAKE_CURRENT_BINARY_DIR}/"
COPYONLY)
add_test(NAME test_kernel
COMMAND ${PYTEST} test_kernel.py)
set_tests_properties(test_kernel
PROPERTIES
ENVIRONMENT "JUPYTER_PATH=${CMAKE_CURRENT_BINARY_DIR}")