mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 03:02:36 +01:00
Revert "[llvm-cov] don't include all source files when provided source files are filtered out"
This reverts commit c2bd20ef652 and the follow up fix 16605bba6fb. The tools/llvm-cov/warnings.h continues to fail on Windows platforms even after the follow up, for example on the llvm-clang-win-x-armv7l builder: http://lab.llvm.org:8011/#/builders/60/builds/94
This commit is contained in:
parent
8139d279fa
commit
6e0168ca1b
@ -8,7 +8,7 @@
|
|||||||
// RUN: llvm-profdata merge %S/Inputs/double_dots.proftext -o %t.profdata
|
// RUN: llvm-profdata merge %S/Inputs/double_dots.proftext -o %t.profdata
|
||||||
// RUN: llvm-cov show %S/Inputs/native_separators.covmapping -instr-profile=%t.profdata -o %t.dir
|
// RUN: llvm-cov show %S/Inputs/native_separators.covmapping -instr-profile=%t.profdata -o %t.dir
|
||||||
// RUN: FileCheck -check-prefixes=TEXT-INDEX -input-file=%t.dir/index.txt %s
|
// RUN: FileCheck -check-prefixes=TEXT-INDEX -input-file=%t.dir/index.txt %s
|
||||||
// RUN: llvm-cov show -format=html %S/Inputs/native_separators.covmapping -instr-profile=%t.profdata -path-equivalence=/tmp,%S %S/../llvm-"config"/../llvm-"cov"/native_separators.c -o %t.dir
|
// RUN: llvm-cov show -format=html %S/Inputs/native_separators.covmapping -instr-profile=%t.profdata -path-equivalence=/tmp,%S ../llvm-"config"/../llvm-"cov"/native_separators.c -o %t.dir
|
||||||
// RUN: FileCheck -check-prefixes=HTML-INDEX -input-file=%t.dir/index.html %s
|
// RUN: FileCheck -check-prefixes=HTML-INDEX -input-file=%t.dir/index.html %s
|
||||||
// RUN: llvm-cov show -format=html %S/Inputs/native_separators.covmapping -instr-profile=%t.profdata -path-equivalence=/tmp,%S %s -o %t.dir
|
// RUN: llvm-cov show -format=html %S/Inputs/native_separators.covmapping -instr-profile=%t.profdata -path-equivalence=/tmp,%S %s -o %t.dir
|
||||||
// RUN: FileCheck -check-prefixes=HTML -input-file=%t.dir/coverage/tmp/native_separators.c.html %s
|
// RUN: FileCheck -check-prefixes=HTML -input-file=%t.dir/coverage/tmp/native_separators.c.html %s
|
||||||
|
@ -10,18 +10,6 @@ RUN: %S/Inputs/sources_specified/main.covmapping \
|
|||||||
RUN: %S/Inputs/sources_specified/main.cc %S/Inputs/sources_specified/extra \
|
RUN: %S/Inputs/sources_specified/main.cc %S/Inputs/sources_specified/extra \
|
||||||
RUN: | FileCheck -check-prefix=SHOW %s
|
RUN: | FileCheck -check-prefix=SHOW %s
|
||||||
|
|
||||||
# Don't include all source files when provided source files are filtered out.
|
|
||||||
RUN: llvm-cov show -instr-profile %S/Inputs/sources_specified/main.profdata \
|
|
||||||
RUN: -path-equivalence=/tmp,%S/Inputs \
|
|
||||||
RUN: %S/Inputs/sources_specified/main.covmapping \
|
|
||||||
RUN: --ignore-filename-regex='.*' \
|
|
||||||
RUN: %S/Inputs/sources_specified/main.cc %S/Inputs/sources_specified/extra \
|
|
||||||
RUN: | FileCheck -allow-empty -check-prefix=IGNORE %s
|
|
||||||
|
|
||||||
IGNORE-NOT: {{.*}}main.cc{{.*}}
|
|
||||||
IGNORE-NOT: {{.*}}inc.h{{.*}}
|
|
||||||
IGNORE-NOT: {{.*}}dec.h{{.*}}
|
|
||||||
|
|
||||||
# Order of files may differ, check the total values calculated.
|
# Order of files may differ, check the total values calculated.
|
||||||
REPORT-NOT: {{.*}}abs.h{{.*}}
|
REPORT-NOT: {{.*}}abs.h{{.*}}
|
||||||
REPORT: {{^}}TOTAL 3{{.*}}72.73%
|
REPORT: {{^}}TOTAL 3{{.*}}72.73%
|
||||||
|
@ -17,11 +17,11 @@ REQUIRES: zlib
|
|||||||
RUN: llvm-profdata merge %S/Inputs/universal_bin_wrapping_archives/universal_bin_wrapping_archives.proftext -o %t.profdata
|
RUN: llvm-profdata merge %S/Inputs/universal_bin_wrapping_archives/universal_bin_wrapping_archives.proftext -o %t.profdata
|
||||||
|
|
||||||
RUN: llvm-cov show %S/Inputs/universal_bin_wrapping_archives/universal_bin_wrapping_archives \
|
RUN: llvm-cov show %S/Inputs/universal_bin_wrapping_archives/universal_bin_wrapping_archives \
|
||||||
RUN: -instr-profile %t.profdata -path-equivalence=/tmp,%S/Inputs/universal_bin_wrapping_archives -arch i386 \
|
RUN: -instr-profile %t.profdata -path-equivalence=/tmp,%S/Inputs/universal_bin_wrapping_archives %s -arch i386 \
|
||||||
RUN: | FileCheck %s --check-prefix=SHOW_ARCHIVE
|
RUN: | FileCheck %s --check-prefix=SHOW_ARCHIVE
|
||||||
|
|
||||||
RUN: llvm-cov show %S/Inputs/universal_bin_wrapping_archives/universal_bin_wrapping_archives \
|
RUN: llvm-cov show %S/Inputs/universal_bin_wrapping_archives/universal_bin_wrapping_archives \
|
||||||
RUN: -instr-profile %t.profdata -path-equivalence=/tmp,%S/Inputs/universal_bin_wrapping_archives -arch x86_64 \
|
RUN: -instr-profile %t.profdata -path-equivalence=/tmp,%S/Inputs/universal_bin_wrapping_archives %s -arch x86_64 \
|
||||||
RUN: | FileCheck %s --check-prefix=SHOW_ARCHIVE
|
RUN: | FileCheck %s --check-prefix=SHOW_ARCHIVE
|
||||||
|
|
||||||
SHOW_ARCHIVE: {{.*}}obj1.c:
|
SHOW_ARCHIVE: {{.*}}obj1.c:
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
// RUN: llvm-cov show %S/Inputs/prevent_false_instantiations.covmapping -instr-profile %S/Inputs/elf_binary_comdat.profdata -path-equivalence=/tmp,%S | 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 -path-equivalence=/tmp,%S /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 -path-equivalence=/tmp,%S 2>&1 | FileCheck %s -check-prefix=FAKE-FILE-STDERR
|
// RUN: llvm-cov show %S/Inputs/prevent_false_instantiations.covmapping -instr-profile %S/Inputs/elf_binary_comdat.profdata -path-equivalence=/tmp,%S /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 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
|
// 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-STDOUT-NOT: warning: The file '{{.*}}' isn't covered.
|
||||||
// FAKE-FILE-STDERR: warning: The file '{{.*}}' isn't covered.
|
// FAKE-FILE-STDERR: warning: The file '{{.*}}' isn't covered.
|
||||||
|
|
||||||
// RUN: llvm-cov show %S/Inputs/prevent_false_instantiations.covmapping -instr-profile %S/Inputs/elf_binary_comdat.profdata -path-equivalence=/tmp,%S -name ".*" | FileCheck %s -allow-empty -check-prefix=FAKE-FUNC-STDOUT
|
// RUN: llvm-cov show %S/Inputs/prevent_false_instantiations.covmapping -instr-profile %S/Inputs/elf_binary_comdat.profdata -path-equivalence=/tmp,%S -name ".*" /dev/null | FileCheck %s -allow-empty -check-prefix=FAKE-FUNC-STDOUT
|
||||||
// RUN: llvm-cov show %S/Inputs/prevent_false_instantiations.covmapping -instr-profile %S/Inputs/elf_binary_comdat.profdata -path-equivalence=/tmp,%S -name-regex ".*" 2>&1 | FileCheck %s -check-prefix=FAKE-FUNC-STDERR
|
// RUN: llvm-cov show %S/Inputs/prevent_false_instantiations.covmapping -instr-profile %S/Inputs/elf_binary_comdat.profdata -path-equivalence=/tmp,%S -name-regex ".*" /dev/null 2>&1 | FileCheck %s -check-prefix=FAKE-FUNC-STDERR
|
||||||
|
|
||||||
// FAKE-FUNC-STDOUT-NOT: warning: Could not read coverage for '{{.*}}'.
|
// FAKE-FUNC-STDOUT-NOT: warning: Could not read coverage for '{{.*}}'.
|
||||||
// FAKE-FUNC-STDERR: Could not read coverage for '{{.*}}'.
|
// FAKE-FUNC-STDERR: Could not read coverage for '{{.*}}'.
|
||||||
|
@ -130,9 +130,6 @@ private:
|
|||||||
CoverageFiltersMatchAll Filters;
|
CoverageFiltersMatchAll Filters;
|
||||||
CoverageFilters IgnoreFilenameFilters;
|
CoverageFilters IgnoreFilenameFilters;
|
||||||
|
|
||||||
/// True if InputSourceFiles are provided.
|
|
||||||
bool HadSourceFiles = false;
|
|
||||||
|
|
||||||
/// The path to the indexed profile.
|
/// The path to the indexed profile.
|
||||||
std::string PGOFilename;
|
std::string PGOFilename;
|
||||||
|
|
||||||
@ -197,7 +194,6 @@ void CodeCoverageTool::addCollectedPath(const std::string &Path) {
|
|||||||
sys::path::remove_dots(EffectivePath, /*remove_dot_dots=*/true);
|
sys::path::remove_dots(EffectivePath, /*remove_dot_dots=*/true);
|
||||||
if (!IgnoreFilenameFilters.matchesFilename(EffectivePath))
|
if (!IgnoreFilenameFilters.matchesFilename(EffectivePath))
|
||||||
SourceFiles.emplace_back(EffectivePath.str());
|
SourceFiles.emplace_back(EffectivePath.str());
|
||||||
HadSourceFiles = !SourceFiles.empty();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CodeCoverageTool::collectPaths(const std::string &Path) {
|
void CodeCoverageTool::collectPaths(const std::string &Path) {
|
||||||
@ -401,7 +397,6 @@ void CodeCoverageTool::remapPathNames(const CoverageMapping &Coverage) {
|
|||||||
sys::path::native(Path, NativePath);
|
sys::path::native(Path, NativePath);
|
||||||
if (!sys::path::is_separator(NativePath.back()))
|
if (!sys::path::is_separator(NativePath.back()))
|
||||||
NativePath += sys::path::get_separator();
|
NativePath += sys::path::get_separator();
|
||||||
sys::path::remove_dots(NativePath, true);
|
|
||||||
return NativePath.c_str();
|
return NativePath.c_str();
|
||||||
};
|
};
|
||||||
std::string RemapFrom = nativeWithTrailing(PathRemapping->first);
|
std::string RemapFrom = nativeWithTrailing(PathRemapping->first);
|
||||||
@ -411,7 +406,6 @@ void CodeCoverageTool::remapPathNames(const CoverageMapping &Coverage) {
|
|||||||
for (StringRef Filename : Coverage.getUniqueSourceFiles()) {
|
for (StringRef Filename : Coverage.getUniqueSourceFiles()) {
|
||||||
SmallString<128> NativeFilename;
|
SmallString<128> NativeFilename;
|
||||||
sys::path::native(Filename, NativeFilename);
|
sys::path::native(Filename, NativeFilename);
|
||||||
sys::path::remove_dots(NativeFilename, true);
|
|
||||||
if (NativeFilename.startswith(RemapFrom)) {
|
if (NativeFilename.startswith(RemapFrom)) {
|
||||||
RemappedFilenames[Filename] =
|
RemappedFilenames[Filename] =
|
||||||
RemapTo + NativeFilename.substr(RemapFrom.size()).str();
|
RemapTo + NativeFilename.substr(RemapFrom.size()).str();
|
||||||
@ -901,7 +895,7 @@ int CodeCoverageTool::doShow(int argc, const char **argv,
|
|||||||
|
|
||||||
auto Printer = CoveragePrinter::create(ViewOpts);
|
auto Printer = CoveragePrinter::create(ViewOpts);
|
||||||
|
|
||||||
if (SourceFiles.empty() && !HadSourceFiles)
|
if (SourceFiles.empty())
|
||||||
// Get the source files from the function coverage mapping.
|
// Get the source files from the function coverage mapping.
|
||||||
for (StringRef Filename : Coverage->getUniqueSourceFiles()) {
|
for (StringRef Filename : Coverage->getUniqueSourceFiles()) {
|
||||||
if (!IgnoreFilenameFilters.matchesFilename(Filename))
|
if (!IgnoreFilenameFilters.matchesFilename(Filename))
|
||||||
|
Loading…
Reference in New Issue
Block a user