Skip to content

Commit 6251610

Browse files
committed
Merge bitcoin/bitcoin#31015: build: have "make test" depend on "make all"
2957ca9 build: have "make test" depend on "make all" (Cory Fields) Pull request description: See [Upstream docs](https://cmake.org/cmake/help/latest/variable/CMAKE_SKIP_TEST_ALL_DEPENDENCY.html) for specifics. Unfortunately, this **seems to have no effect when directly executing `ctest`** :( This brings the test -> hack -> test cycle more inline with how it worked with autotools. With `CMAKE_SKIP_TEST_ALL_DEPENDENCY` set to FALSE, `make test` will trigger a rebuild, ensuring that test binaries are current before running them. To test: ``` cmake -S . -B build make -C build -j24 touch src/primitives/transaction.cpp make -C build test ARGS=-j24 ``` Without this commit, the above will not rebuild before running tests. ACKs for top commit: tdb3: ACK 2957ca9 itornaza: ACK 2957ca9 laanwj: ACK 2957ca9 Tree-SHA512: 46e6d53fd9c28b2f47b34c42ae0b061b01ef7614cdf5ee7d49fb9d3413ca92983d8a996379a9067ac8a8cfc16b230946401e68cf114bd4e3c5c02db2c55ec6bb
2 parents 4a31f8c + 2957ca9 commit 6251610

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,12 @@ endif()
542542
if(BUILD_TESTS)
543543
enable_testing()
544544
endif()
545+
546+
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.29)
547+
# have "make test" depend on "make all"
548+
set(CMAKE_SKIP_TEST_ALL_DEPENDENCY FALSE)
549+
endif()
550+
545551
# TODO: The `CMAKE_SKIP_BUILD_RPATH` variable setting can be deleted
546552
# in the future after reordering Guix script commands to
547553
# perform binary checks after the installation step.

0 commit comments

Comments
 (0)