llvm.org GIT mirror llvm / b972a0f
[llvm-cov] Improve error messages While we're at it, extend an existing test to make sure that error messages look reasonable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275520 91177308-0d34-0410-b5e6-96231b3b80d8 Vedant Kumar 4 years ago
2 changed file(s) with 9 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
1414
1515 // RUN: FileCheck -check-prefix=REL-INDEX -input-file %t.dir/index.txt %s
1616 // REL-INDEX-NOT: %t.dir
17
18 // Check that we get the right error when writing to an invalid path:
19
20 // RUN: not llvm-cov show %S/Inputs/double_dots.covmapping -instr-profile=%t.profdata -o /dev/null 2>&1 | FileCheck %s -check-prefix=ERROR-MESSAGE
21 // ERROR-MESSAGE: error: Not a directory: Could not create index file!
116116 std::string Str = (Warning ? "warning" : "error");
117117 Str += ": ";
118118 if (!Whence.empty())
119 Str += Whence;
119 Str += Whence.str() + ": ";
120120 Str += Message.str() + "\n";
121121 return Str;
122122 }
503503 if (!Filters.empty()) {
504504 auto OSOrErr = Printer->createViewFile("functions", /*InToplevel=*/true);
505505 if (Error E = OSOrErr.takeError()) {
506 error(toString(std::move(E)));
506 error("Could not create view file!", toString(std::move(E)));
507507 return 1;
508508 }
509509 auto OS = std::move(OSOrErr.get());
539539 // Create an index out of the source files.
540540 if (ViewOpts.hasOutputDirectory()) {
541541 if (Error E = Printer->createIndexFile(SourceFiles)) {
542 error(toString(std::move(E)));
542 error("Could not create index file!", toString(std::move(E)));
543543 return 1;
544544 }
545545 }
560560
561561 auto OSOrErr = Printer->createViewFile(SourceFile, /*InToplevel=*/false);
562562 if (Error E = OSOrErr.takeError()) {
563 deferError(toString(std::move(E)));
563 deferError("Could not create view file!", toString(std::move(E)));
564564 return;
565565 }
566566 auto OS = std::move(OSOrErr.get());