else
P.assign(CWD);
llvm::sys::path::append(P, Filename);
- Filenames.push_back(static_cast<std::string>(P));
+ sys::path::remove_dots(P, /*remove_dot_dot=*/true);
+ Filenames.push_back(static_cast<std::string>(P.str()));
}
}
}
--- /dev/null
+int f() { return 0; }
--- /dev/null
+#include "header.h"
+
+int main() {
+ return f();
+}
--- /dev/null
+f
+# Func Hash:
+24
+# Num Counters:
+1
+# Counter Values:
+1
+
+main
+# Func Hash:
+24
+# Num Counters:
+1
+# Counter Values:
+1
+
# REPORT: {{^}}bar.h{{.*}}
# REPORT: {{^}}TOTAL{{.*}}100.00%
-# LCOV: SF:.{{/|\\+}}bar.h
+# LCOV: SF:bar.h
# LCOV-NOT: SF
Instructions for regenerating the test:
--- /dev/null
+# RUN: llvm-profdata merge %S/Inputs/relative_dir/main.proftext \
+# RUN: -o %t.profdata
+# RUN: llvm-cov report %S/Inputs/relative_dir/main.covmapping \
+# RUN: -instr-profile %t.profdata \
+# RUN: -compilation-dir=%S/Inputs/relative_dir/out/default \
+# RUN: %S/Inputs/relative_dir/header.h \
+# RUN: | FileCheck -DDIR=%S %s
+
+# CHECK: {{^}}[[DIR]]{{/|\\}}Inputs{{/|\\}}relative_dir{{/|\\}}header.h{{.*}}
+# CHECK: {{^}}TOTAL{{.*}}100.00%
for (unsigned I = 1; I < Paths.size(); ++I) {
SmallString<256> P(Paths[0]);
llvm::sys::path::append(P, Paths[I]);
- ASSERT_TRUE(ReadFilenames[I] == P);
+ ASSERT_EQ(ReadFilenames[I], P);
}
}
}
for (unsigned I = 1; I < Paths.size(); ++I) {
SmallString<256> P(CompilationDir);
llvm::sys::path::append(P, Paths[I]);
- ASSERT_TRUE(ReadFilenames[I] == P);
+ ASSERT_EQ(ReadFilenames[I], P);
}
}
}