mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-18 02:16:43 +00:00
[llvm-cov] Error-out when an unsupported format is used (PR32087)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296487 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
79e90c5570
commit
09f10e7e60
@ -1,5 +1,7 @@
|
||||
// RUN: llvm-cov show %S/Inputs/prevent_false_instantiations.covmapping -instr-profile %S/Inputs/elf_binary_comdat.profdata -filename-equivalence /dev/null | FileCheck %s -allow-empty -check-prefix=FAKE-FILE-STDOUT
|
||||
// RUN: llvm-cov show %S/Inputs/prevent_false_instantiations.covmapping -instr-profile %S/Inputs/elf_binary_comdat.profdata -filename-equivalence /dev/null 2>&1 | FileCheck %s -check-prefix=FAKE-FILE-STDERR
|
||||
// RUN: not llvm-cov report %S/Inputs/prevent_false_instantiations.covmapping -instr-profile %S/Inputs/elf_binary_comdat.profdata -format=html
|
||||
// RUN: not llvm-cov export %S/Inputs/prevent_false_instantiations.covmapping -instr-profile %S/Inputs/elf_binary_comdat.profdata -format=html
|
||||
|
||||
// FAKE-FILE-STDOUT-NOT: warning: The file '{{.*}}' isn't covered.
|
||||
// FAKE-FILE-STDERR: warning: The file '{{.*}}' isn't covered.
|
||||
|
@ -818,8 +818,10 @@ int CodeCoverageTool::report(int argc, const char **argv,
|
||||
if (Err)
|
||||
return Err;
|
||||
|
||||
if (ViewOpts.Format == CoverageViewOptions::OutputFormat::HTML)
|
||||
if (ViewOpts.Format == CoverageViewOptions::OutputFormat::HTML) {
|
||||
error("HTML output for summary reports is not yet supported.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
auto Coverage = load();
|
||||
if (!Coverage)
|
||||
@ -840,6 +842,11 @@ int CodeCoverageTool::export_(int argc, const char **argv,
|
||||
if (Err)
|
||||
return Err;
|
||||
|
||||
if (ViewOpts.Format != CoverageViewOptions::OutputFormat::Text) {
|
||||
error("Coverage data can only be exported as textual JSON.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
auto Coverage = load();
|
||||
if (!Coverage) {
|
||||
error("Could not load coverage information");
|
||||
|
Loading…
x
Reference in New Issue
Block a user