forked from OSchip/llvm-project
Added coverage check for extensionless headers, and exclude hidden dot directoryies.
llvm-svn: 254785
This commit is contained in:
parent
9e48cda9bc
commit
b3eef01eda
|
@ -370,12 +370,18 @@ bool CoverageChecker::collectFileSystemHeaders(StringRef IncludePath) {
|
|||
I.increment(EC)) {
|
||||
if (EC)
|
||||
return false;
|
||||
std::string file(I->path());
|
||||
//std::string file(I->path());
|
||||
StringRef file(I->path());
|
||||
I->status(Status);
|
||||
sys::fs::file_type type = Status.type();
|
||||
// If the file is a directory, ignore the name (but still recurses).
|
||||
if (type == sys::fs::file_type::directory_file)
|
||||
continue;
|
||||
// Assume directories or files starting with '.' are private and not to
|
||||
// be considered.
|
||||
if (file.startswith(".") || (file.find("\\.") != StringRef::npos)
|
||||
|| (file.find("/.") != StringRef::npos))
|
||||
continue;
|
||||
// If the file does not have a common header extension, ignore it.
|
||||
if (!ModularizeUtilities::isHeader(file))
|
||||
continue;
|
||||
|
|
|
@ -468,7 +468,7 @@ std::string ModularizeUtilities::getCanonicalPath(StringRef FilePath) {
|
|||
bool ModularizeUtilities::isHeader(StringRef FileName) {
|
||||
StringRef Extension = llvm::sys::path::extension(FileName);
|
||||
if (Extension.size() == 0)
|
||||
return false;
|
||||
return true;
|
||||
if (Extension.equals_lower(".h"))
|
||||
return true;
|
||||
if (Extension.equals_lower(".inc"))
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
#error DontFindMe.h shouldn't be found.
|
||||
|
||||
|
|
@ -0,0 +1 @@
|
|||
#define MACRO_3B 1
|
|
@ -1,4 +1,5 @@
|
|||
# RUN: not modularize %S/Inputs/CoverageProblems/module.modulemap 2>&1 | FileCheck %s
|
||||
|
||||
# CHECK: warning: {{.*}}{{[/\\]}}Inputs/CoverageProblems/module.modulemap does not account for file: {{.*}}{{[/\\]}}Inputs/CoverageProblems/Level3A.h
|
||||
# CHECK-NEXT: warning: {{.*}}{{[/\\]}}Inputs/CoverageProblems/module.modulemap does not account for file: {{.*}}{{[/\\]}}Inputs/CoverageProblems/Level3B
|
||||
# CHECK-NEXT: warning: {{.*}}{{[/\\]}}Inputs/CoverageProblems/module.modulemap does not account for file: {{.*}}{{[/\\]}}Inputs/CoverageProblems/Sub/Level3B.h
|
||||
|
|
Loading…
Reference in New Issue