Skip to content

Commit

Permalink
chore: reduce duplication in file names
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
  • Loading branch information
henryiii committed Aug 22, 2024
1 parent d7282b9 commit 630de1f
Showing 1 changed file with 18 additions and 21 deletions.
39 changes: 18 additions & 21 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,17 @@ nanobind_add_module(test_inter_module_2_ext NB_DOMAIN mydomain test_inter_module
target_link_libraries(test_inter_module_1_ext PRIVATE inter_module)
target_link_libraries(test_inter_module_2_ext PRIVATE inter_module)

set(TEST_PYI_FILES
test_functions_ext.pyi
test_stl_ext.pyi
test_typing_ext.pyi
test_enum_ext.pyi
test_ndarray_ext.pyi
test_make_iterator_ext.pyi
test_classes_ext.pyi
py_stub_test.pyi
)

set(TEST_FILES
common.py
test_classes.py
Expand All @@ -141,19 +152,13 @@ set(TEST_FILES
test_ndarray.py
test_stubs.py
test_typing.py

# Stub reference files
test_classes_ext.pyi.ref
test_functions_ext.pyi.ref
test_make_iterator_ext.pyi.ref
test_ndarray_ext.pyi.ref
test_stl_ext.pyi.ref
test_enum_ext.pyi.ref
test_typing_ext.pyi.ref
py_stub_test.py
py_stub_test.pyi.ref
)

# Stub reference files
list(TRANSOFRM TEST_PYI_FILES APPEND ".ref" OUTPUT_VARIABLE TEST_REF_FILES)
list(APPEND TEST_FILES ${TEST_REF_FILES})

if (NOT (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR) OR MSVC)
if (CMAKE_CONFIGURATION_TYPES)
set(OUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>)
Expand All @@ -175,18 +180,10 @@ endif()

if(DEFINED SKBUILD)
if(NOT CMAKE_CROSSCOMPILING)
list(TRANSFORM TEST_PYI_FILES PREPEND "${CMAKE_CURRENT_BINARY_DIR}/" OUTPUT_VARIABLE TEST_OUT_FILES)
install(
FILES
"${CMAKE_CURRENT_BINARY_DIR}/test_functions_ext.pyi"
"${CMAKE_CURRENT_BINARY_DIR}/test_stl_ext.pyi"
"${CMAKE_CURRENT_BINARY_DIR}/test_typing_ext.pyi"
"${CMAKE_CURRENT_BINARY_DIR}/test_enum_ext.pyi"
"${CMAKE_CURRENT_BINARY_DIR}/test_ndarray_ext.pyi"
"${CMAKE_CURRENT_BINARY_DIR}/test_make_iterator_ext.pyi"
"${CMAKE_CURRENT_BINARY_DIR}/test_classes_ext.pyi"
"${CMAKE_CURRENT_BINARY_DIR}/py_stub_test.pyi"
DESTINATION
.
FILES ${TEST_OUT_FILES}
DESTINATION .
)
endif()
install(
Expand Down

0 comments on commit 630de1f

Please sign in to comment.