Skip to content

Commit 74a8d51

Browse files
authored
Add test name to all file_test errors (#6011)
Common case is going to be like: ``` Running tests with 64 thread(s) Autoupdate can't discard non-CHECK lines inside conflicts: ......................!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!..!!!!!!!!!!!!!!!!!!!!. ``` -> ``` Running tests with 64 thread(s) toolchain/check/testdata/as/unsafe_as.carbon: Autoupdate can't discard non-CHECK lines inside conflicts: ......................!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!..!!!!!!!!!!!!!!!!!!!!. ``` (i.e., the conflict line was blank) One error had the test name, I'm dropping it here, meaning: ``` ................................................................................ Missing AUTOUPDATE/NOAUTOUPDATE setting: toolchain/codegen/testdata/assembly/basic.carbon ................................................................................ ``` -> ``` ................................................................................ toolchain/codegen/testdata/assembly/basic.carbon: Missing AUTOUPDATE/NOAUTOUPDATE setting ................................................................................ ``` For single-threaded runs, at the top there's already: ``` } else if (single_threaded) { std::unique_lock<std::mutex> lock(output_mutex); llvm::errs() << "\nTEST: " << test.test_name << ' '; } ```
1 parent 70f104a commit 74a8d51

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

testing/file_test/file_test_base.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,10 @@ static auto RunSingleTest(FileTestInfo& test, bool single_threaded,
434434

435435
if (!test.test_result->ok()) {
436436
std::unique_lock<std::mutex> lock(output_mutex);
437-
llvm::errs() << "\n" << test.test_result->error().message() << "\n";
437+
if (!single_threaded) {
438+
llvm::errs() << "\n" << test.test_name << ": ";
439+
}
440+
llvm::errs() << test.test_result->error().message() << "\n";
438441
return true;
439442
}
440443

testing/file_test/test_file.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -833,8 +833,7 @@ auto ProcessTestFile(llvm::StringRef test_name, bool running_autoupdate)
833833
test_file.file_splits, include_files));
834834

835835
if (!found_autoupdate) {
836-
return ErrorBuilder() << "Missing AUTOUPDATE/NOAUTOUPDATE setting: "
837-
<< test_name;
836+
return ErrorBuilder() << "Missing AUTOUPDATE/NOAUTOUPDATE setting";
838837
}
839838

840839
constexpr llvm::StringLiteral AutoupdateSplit = "AUTOUPDATE-SPLIT";

0 commit comments

Comments
 (0)