Skip to content

Commit

Permalink
Move PrettyStackTraceString to CRC scope
Browse files Browse the repository at this point in the history
  • Loading branch information
jonmeow committed Feb 28, 2025
1 parent 7a33be3 commit 3895eb2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions testing/file_test/file_test_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,6 @@ static auto RunSingleTest(FileTestInfo& test, bool single_threaded,
std::mutex& output_mutex) -> bool {
std::unique_ptr<FileTestBase> test_instance(test.factory_fn());

// Add a crash trace entry with the single-file test command.
std::string test_command = GetBazelCommand(BazelMode::Test, test.test_name);
llvm::PrettyStackTraceString stack_trace_entry(test_command.c_str());

if (absl::GetFlag(FLAGS_dump_output)) {
std::unique_lock<std::mutex> lock(output_mutex);
llvm::errs() << "\n--- Dumping: " << test.test_name << "\n\n";
Expand All @@ -381,6 +377,11 @@ static auto RunSingleTest(FileTestInfo& test, bool single_threaded,
}

auto run_test_file = [&] {
// Add a crash trace entry with the single-file test command.
std::string test_command =
GetBazelCommand(BazelMode::Test, test.test_name);
llvm::PrettyStackTraceString stack_trace_entry(test_command.c_str());

if (auto err =
RunTestFile(*test_instance, absl::GetFlag(FLAGS_dump_output),
**test.test_result);
Expand Down

0 comments on commit 3895eb2

Please sign in to comment.