Skip to content

Commit

Permalink
Disable debug-only test in release builds to avoid expected failures. (
Browse files Browse the repository at this point in the history
…#1595)

Co-authored-by: Andy Christiansen <[email protected]>
  • Loading branch information
macandy13 and Andy Christiansen authored May 10, 2023
1 parent 2dd015d commit 318dd44
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/diagnostics_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,16 @@ void BM_diagnostic_test_keep_running(benchmark::State& state) {
BENCHMARK(BM_diagnostic_test_keep_running);

int main(int argc, char* argv[]) {
#ifdef NDEBUG
// This test is exercising functionality for debug builds, which are not
// available in release builds. Skip the test if we are in that environment
// to avoid a test failure.
std::cout << "Diagnostic test disabled in release build" << std::endl;
(void)argc;
(void)argv;
#else
benchmark::internal::GetAbortHandler() = &TestHandler;
benchmark::Initialize(&argc, argv);
benchmark::RunSpecifiedBenchmarks();
#endif
}

0 comments on commit 318dd44

Please sign in to comment.