Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent general tests from running while running benchmarks custom target #698

Merged
merged 6 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ The project release numbers follow [Semantic Versioning](http://semver.org/spec/
- Enable C language support and emit a warning when GoogleTest or GoogleMock are enabled but
not the C language.
- Guard HIP C smoketest against projects that don't enable C as a language in their projects.
- Changes benchmark custom target `run_benchmarks` to exclusively run benchmarks (not other general tests).

## [Version 0.6.2] - Release date 2024-03-15

Expand Down
5 changes: 5 additions & 0 deletions cmake/BLTMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,11 @@ macro(blt_add_benchmark)
NUM_OMP_THREADS ${arg_NUM_OMP_THREADS}
CONFIGURATIONS Benchmark ${arg_CONFIGURATIONS})

# The 'LABELS Benchmark` prevents regular tests from
# running when running benchmarks custom target
set_tests_properties( ${arg_NAME}
PROPERTIES LABELS "Benchmark")

endmacro(blt_add_benchmark)


Expand Down
3 changes: 2 additions & 1 deletion docs/api/target.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ CONFIGURATIONS

This macro adds a benchmark test to the ``Benchmark`` CTest configuration
which can be run by the ``run_benchmarks`` build target. These tests are
not run when you use the regular ``test`` build target.
not run when you use the regular ``test`` build target. The ``run_benchmarks``
build target will not run regular tests.

This macro is just a thin wrapper around :ref:`blt_add_test` and assists
with building up the correct command line for running the benchmark. For more
Expand Down
2 changes: 1 addition & 1 deletion thirdparty_builtin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ if(ENABLE_BENCHMARKS)

# This sets up a target to run the benchmarks
add_custom_target(${BLT_RUN_BENCHMARKS_TARGET_NAME}
COMMAND ctest -C Benchmark -VV
COMMAND ctest -C Benchmark -L Benchmark -VV
WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
endif()

Expand Down