Skip to content

Commit 65312c4

Browse files
committed
Made the public test setup more reliable
- Switched the GoogleTest fallback to a pinned Git checkout instead of a brittle zip download - Made the test helper rerun CMake setup every time before it builds - Let broken or half-finished build folders recover cleanly
1 parent 70884cf commit 65312c4

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ if(ENABLE_TESTING)
129129
message(STATUS "GTest not found via package manager; fetching v1.14.0")
130130
FetchContent_Declare(
131131
googletest
132-
GIT_REPOSITORY https://github.com/google/googletest.git
133-
GIT_TAG f8d7d77c06936315286eb55f8de22cd23c188571
134-
GIT_SHALLOW TRUE
132+
GIT_REPOSITORY https://github.com/google/googletest.git
133+
GIT_TAG f8d7d77c06936315286eb55f8de22cd23c188571
134+
GIT_SHALLOW TRUE
135135
)
136136
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
137137
FetchContent_MakeAvailable(googletest)

run_tests.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
set -euo pipefail
44
BUILD_DIR="build"
55

6-
if [ ! -d "$BUILD_DIR" ]; then
7-
cmake -S . -B "$BUILD_DIR" -DENABLE_TESTING=ON
8-
fi
6+
cmake -S . -B "$BUILD_DIR" -DENABLE_TESTING=ON
97
cmake --build "$BUILD_DIR" --target gates_tests -j "${JOBS:-4}"
108
# Run discovered tests (gtest_discover_tests creates them at build time)
119
ctest --test-dir "$BUILD_DIR" --output-on-failure "$@"

0 commit comments

Comments
 (0)