Disable debug-only test in release builds to avoid expected failures. (#1595)

Co-authored-by: Andy Christiansen <achristiansen@google.com>
This commit is contained in:
Andy Christiansen 2023-05-10 11:18:43 +02:00 committed by GitHub
parent 2dd015dfef
commit 318dd44225
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -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
}