Skip to content

Commit

Permalink
Merge bitcoin/bitcoin#31015: build: have "make test" depend on "make …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
achow101 committed Oct 30, 2024
2 parents 4a31f8c + 2957ca9 commit 6251610
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,12 @@ endif()
if(BUILD_TESTS)
enable_testing()
endif()

if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.29)
# have "make test" depend on "make all"
set(CMAKE_SKIP_TEST_ALL_DEPENDENCY FALSE)
endif()

# TODO: The `CMAKE_SKIP_BUILD_RPATH` variable setting can be deleted
# in the future after reordering Guix script commands to
# perform binary checks after the installation step.
Expand Down

0 comments on commit 6251610

Please sign in to comment.