@@ -85,28 +85,23 @@ add_custom_target(run_tests_with_junit_report
8585
8686set_target_properties (run_tests_with_junit_report PROPERTIES FOLDER "Tests utilities" )
8787
88- # Polars integration test helper - Native Python Extension Module
89- # ===============================================================
90- # This builds a proper Python extension module (.cpython-*.so) that shares
91- # the same Python runtime as the interpreter, avoiding dual-runtime issues.
88+ Python_add_library(test_sparrow_helper MODULE test_sparrow_helper_module.cpp)
9289
93- Python_add_library(test_polars_helper MODULE test_polars_helper_module.cpp)
94-
95- target_link_libraries (test_polars_helper
90+ target_link_libraries (test_sparrow_helper
9691 PRIVATE
9792 sparrow-pycapsule
9893 sparrow::sparrow
9994)
10095
101- target_compile_features (test_polars_helper PRIVATE cxx_std_20)
96+ target_compile_features (test_sparrow_helper PRIVATE cxx_std_20)
10297
10398if (MSVC )
104- target_compile_options (test_polars_helper PRIVATE /W4)
99+ target_compile_options (test_sparrow_helper PRIVATE /W4)
105100else ()
106- target_compile_options (test_polars_helper PRIVATE -Wall -Wextra -Wpedantic)
101+ target_compile_options (test_sparrow_helper PRIVATE -Wall -Wextra -Wpedantic)
107102endif ()
108103
109- set_target_properties (test_polars_helper PROPERTIES
104+ set_target_properties (test_sparrow_helper PROPERTIES
110105 FOLDER tests
111106 LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} /bin/${CMAKE_BUILD_TYPE}
112107 # Python modules must not have a debug suffix - Python won't find them
@@ -120,77 +115,76 @@ find_package(Python COMPONENTS Interpreter QUIET)
120115if (Python_Interpreter_FOUND)
121116 # Add a test that runs the Python integration script
122117 add_test (
123- NAME test_polars_integration
124- COMMAND ${Python_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR} /test_polars_integration .py
118+ NAME test_sparrow_integration
119+ COMMAND ${Python_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR} /test_sparrow_integration .py
125120 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
126121 )
127122
128123 # Set environment variables so Python can find the libraries
129124 # Use generator expressions to get the actual library paths from targets
130- set_tests_properties (test_polars_integration PROPERTIES
131- ENVIRONMENT "TEST_POLARS_HELPER_LIB_PATH =$<TARGET_FILE:test_polars_helper >;SPARROW_PYCAPSULE_LIB_PATH=$<TARGET_FILE:sparrow-pycapsule>"
125+ set_tests_properties (test_sparrow_integration PROPERTIES
126+ ENVIRONMENT "TEST_SPARROW_HELPER_LIB_PATH =$<TARGET_FILE:test_sparrow_helper >;SPARROW_PYCAPSULE_LIB_PATH=$<TARGET_FILE:sparrow-pycapsule>"
132127 TIMEOUT 300
133- DEPENDS test_polars_helper
128+ DEPENDS test_sparrow_helper
134129 )
135130
136- message (STATUS "Added Polars integration test (Python ${Python_VERSION} )" )
131+ message (STATUS "Added sparrow integration test (Python ${Python_VERSION} )" )
137132else ()
138- message (WARNING "Python interpreter not found, skipping Polars integration test" )
133+ message (WARNING "Python interpreter not found, skipping sparrow integration test" )
139134endif ()
140135
141- # Custom target to run Polars tests directly (with better output)
142136if (Python_Interpreter_FOUND)
143- add_custom_target (run_polars_tests_direct
137+ add_custom_target (run_sparrow_tests_direct
144138 COMMAND ${CMAKE_COMMAND} -E echo "=================================="
145- COMMAND ${CMAKE_COMMAND} -E echo "Polars Integration Test Runner"
139+ COMMAND ${CMAKE_COMMAND} -E echo "Sparrow Integration Test Runner"
146140 COMMAND ${CMAKE_COMMAND} -E echo "=================================="
147141 COMMAND ${CMAKE_COMMAND} -E echo ""
148142 COMMAND ${CMAKE_COMMAND} -E echo "Checking Python dependencies..."
149143 COMMAND ${Python_EXECUTABLE} -c "import polars" || ${CMAKE_COMMAND} -E cmake_echo_color --red "ERROR: polars not installed. Install with: pip install polars"
150144 COMMAND ${Python_EXECUTABLE} -c "import pyarrow" || ${CMAKE_COMMAND} -E cmake_echo_color --red "ERROR: pyarrow not installed. Install with: pip install pyarrow"
151145 COMMAND ${CMAKE_COMMAND} -E echo ""
152146 COMMAND ${CMAKE_COMMAND} -E echo "Library paths:"
153- COMMAND ${CMAKE_COMMAND} -E echo " TEST_POLARS_HELPER_LIB_PATH =$<TARGET_FILE:test_polars_helper >"
147+ COMMAND ${CMAKE_COMMAND} -E echo " TEST_SPARROW_HELPER_LIB_PATH =$<TARGET_FILE:test_sparrow_helper >"
154148 COMMAND ${CMAKE_COMMAND} -E echo " SPARROW_PYCAPSULE_LIB_PATH=$<TARGET_FILE:sparrow-pycapsule>"
155149 COMMAND ${CMAKE_COMMAND} -E echo ""
156150 COMMAND ${CMAKE_COMMAND} -E echo "Running tests..."
157151 COMMAND ${CMAKE_COMMAND} -E echo ""
158152 COMMAND ${CMAKE_COMMAND} -E env
159- "TEST_POLARS_HELPER_LIB_PATH =$<TARGET_FILE:test_polars_helper >"
153+ "TEST_SPARROW_HELPER_LIB_PATH =$<TARGET_FILE:test_sparrow_helper >"
160154 "SPARROW_PYCAPSULE_LIB_PATH=$<TARGET_FILE:sparrow-pycapsule>"
161- ${Python_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR} /test_polars_integration .py
155+ ${Python_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR} /test_sparrow_integration .py
162156 COMMAND ${CMAKE_COMMAND} -E echo ""
163- DEPENDS test_polars_helper sparrow-pycapsule
157+ DEPENDS test_sparrow_helper sparrow-pycapsule
164158 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
165- COMMENT "Running Polars integration tests directly"
159+ COMMENT "Running Sparrow integration tests directly"
166160 USES_TERMINAL
167161 )
168162
169- set_target_properties (run_polars_tests_direct PROPERTIES FOLDER "Tests utilities" )
163+ set_target_properties (run_sparrow_tests_direct PROPERTIES FOLDER "Tests utilities" )
170164
171- # Custom target to check Polars dependencies
172- add_custom_target (check_polars_deps
173- COMMAND ${CMAKE_COMMAND} -E echo "Checking Polars integration test dependencies..."
165+ # Custom target to check Sparrow dependencies
166+ add_custom_target (check_sparrow_deps
167+ COMMAND ${CMAKE_COMMAND} -E echo "Checking Sparrow integration test dependencies..."
174168 COMMAND ${Python_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR} /check_deps.py
175169 COMMAND ${CMAKE_COMMAND} -E echo "Environment variables that will be set:"
176- COMMAND ${CMAKE_COMMAND} -E echo " TEST_POLARS_HELPER_LIB_PATH =$<TARGET_FILE:test_polars_helper >"
170+ COMMAND ${CMAKE_COMMAND} -E echo " TEST_SPARROW_HELPER_LIB_PATH =$<TARGET_FILE:test_sparrow_helper >"
177171 COMMAND ${CMAKE_COMMAND} -E echo " SPARROW_PYCAPSULE_LIB_PATH=$<TARGET_FILE:sparrow-pycapsule>"
178172 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
179- COMMENT "Checking Polars test dependencies"
173+ COMMENT "Checking Sparrow test dependencies"
180174 USES_TERMINAL
181175 )
182176
183- set_target_properties (check_polars_deps PROPERTIES FOLDER "Tests utilities" )
177+ set_target_properties (check_sparrow_deps PROPERTIES FOLDER "Tests utilities" )
184178
185179 # Minimal library loading test for debugging segfaults
186180 add_custom_target (test_library_load
187181 COMMAND ${CMAKE_COMMAND} -E env
188- "TEST_POLARS_HELPER_LIB_PATH =$<TARGET_FILE:test_polars_helper >"
182+ "TEST_SPARROW_HELPER_LIB_PATH =$<TARGET_FILE:test_sparrow_helper >"
189183 "SPARROW_PYCAPSULE_LIB_PATH=$<TARGET_FILE:sparrow-pycapsule>"
190184 "PYTHONUNBUFFERED=1"
191185 ${Python_EXECUTABLE} -u ${CMAKE_CURRENT_SOURCE_DIR} /test_library_load.py
192186 DEPENDS
193- test_polars_helper
187+ test_sparrow_helper
194188 sparrow-pycapsule
195189 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
196190 COMMENT "Testing library loading step-by-step"
0 commit comments