Skip to content

Commit ede7102

Browse files
committed
add compat entrypoint for tests
1 parent 4e4fef8 commit ede7102

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

test/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,18 @@ endforeach()
138138
# Number of test jobs to run in parallel
139139
set(CTEST_PARALLEL_JOBS 4)
140140

141+
# Create a legacy matx_test script for CI compatibility
142+
configure_file(
143+
${CMAKE_CURRENT_SOURCE_DIR}/matx_test.sh
144+
${CMAKE_CURRENT_BINARY_DIR}/matx_test
145+
COPYONLY
146+
)
147+
# Make the script executable
148+
file(CHMOD ${CMAKE_CURRENT_BINARY_DIR}/matx_test
149+
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
150+
GROUP_READ GROUP_EXECUTE
151+
WORLD_READ WORLD_EXECUTE)
152+
141153
# Add a custom target to run CTest from the main build directory
142154
add_custom_target(test
143155
COMMAND ${CMAKE_CTEST_COMMAND} -j${CTEST_PARALLEL_JOBS} --output-on-failure

test/matx_test.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
echo "MatX Test Wrapper - Running CTest in parallel..."
4+
5+
# Change to the directory where this script is located (test directory)
6+
cd "$(dirname "$0")"
7+
8+
# Build the ctest command with parallel jobs and output on failure
9+
CTEST_CMD="ctest -j4 --output-on-failure"
10+
11+
# Forward any additional arguments to ctest
12+
if [ $# -gt 0 ]; then
13+
CTEST_CMD="$CTEST_CMD $*"
14+
fi
15+
16+
echo "Executing: $CTEST_CMD"
17+
18+
# Execute ctest and preserve its exit code
19+
exec $CTEST_CMD

0 commit comments

Comments
 (0)