Skip to content

Commit c438360

Browse files
Changes according to code review
Generating rootmaps and shared libraries for the tests using cmake. Fix formatting.
1 parent e8e6b75 commit c438360

File tree

2 files changed

+52
-6
lines changed

2 files changed

+52
-6
lines changed

bindings/pyroot/cppyy/cppyy/test/CMakeLists.txt

+51-6
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,58 @@
44
# For the licensing terms see $ROOTSYS/LICENSE.
55
# For the list of contributors see $ROOTSYS/README/CREDITS.
66

7-
add_custom_target(cppyy_tests_dict ALL COMMAND make all WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bindings/pyroot/cppyy/cppyy/test)
7+
# Dictionary list
8+
set(CPPYY_TEST_DICTS
9+
advancedcpp
10+
advancedcpp2
11+
conversions
12+
cpp11features
13+
crossinheritance
14+
datatypes
15+
doc_helper
16+
example01
17+
fragile
18+
operators
19+
overloads
20+
pythonizables
21+
std_streams
22+
templates
23+
stltypes)
824

9-
file(GLOB CPPYY_TEST_SRC "test_*.py")
25+
foreach(DICT ${CPPYY_TEST_DICTS})
26+
# Generate dictionary for the tests
27+
ROOT_GENERATE_DICTIONARY(G__${DICT} ${CMAKE_CURRENT_SOURCE_DIR}/${DICT}.h ${CMAKE_CURRENT_SOURCE_DIR}/${DICT}.xml NOINSTALL)
28+
# Create shared necessary libraries for the tests
29+
ROOT_LINKER_LIBRARY(${DICT} ${CMAKE_CURRENT_SOURCE_DIR}/${DICT}.cxx NOINSTALL LIBRARIES Python3::Python)
30+
endforeach()
1031

11-
foreach(CPPYY_TEST_FILE ${CPPYY_TEST_SRC})
12-
get_filename_component(CPPYY_TEST_FILE_NAME ${CPPYY_TEST_FILE} NAME)
13-
string(REPLACE ".py" "" CPPYY_TEST_FILE_NO_EXT ${CPPYY_TEST_FILE_NAME})
32+
# Tests list
33+
set(CPPYY_TESTS
34+
test_aclassloader
35+
test_advancedcpp
36+
test_api
37+
test_boost
38+
test_conversions
39+
test_cpp11features
40+
test_crossinheritance
41+
test_datatypes
42+
test_doc_features
43+
test_eigen
44+
test_fragile
45+
test_leakcheck
46+
test_lowlevel
47+
test_numba
48+
test_operators
49+
test_overloads
50+
test_pythonify
51+
test_pythonization
52+
test_regression
53+
test_stltypes
54+
test_streams
55+
test_templates
56+
test_concurrent)
1457

15-
ROOT_ADD_PYUNITTEST(${CPPYY_TEST_FILE_NO_EXT} ${CPPYY_TEST_FILE_NAME} GENERIC PYTHON_DEPS pytest ENVIRONMENT LD_LIBRARY_PATH=${CMAKE_CURRENT_SOURCE_DIR})
58+
# Configure the tests
59+
foreach(TEST ${CPPYY_TESTS})
60+
ROOT_ADD_PYUNITTEST(${TEST} ${TEST}.py GENERIC ENVIRONMENT LD_LIBRARY_PATH=${CMAKE_CURRENT_SOURCE_DIR} PYTHON_DEPS pytest)
1661
endforeach()

bindings/pyroot/cppyy/cppyy/test/test_concurrent.py

+1
Original file line numberDiff line numberDiff line change
@@ -304,5 +304,6 @@ def test(i, state=State):
304304
assert State.c1 == 1000
305305
assert State.c2 == State.c3
306306

307+
307308
if __name__ == "__main__":
308309
exit(pytest.main(args=[__file__]))

0 commit comments

Comments
 (0)