[PATCH] D28636: [libFuzzer] Fix coverage tests for Windows.

Marcos Pividori via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 17 20:45:33 PST 2017

mpividori added inline comments.

Comment at: lib/Fuzzer/test/coverage.test:6
 CHECK-DAG: COVERED: {{.*}}in LLVMFuzzerTestOneInput {{.*}}NullDerefTest.cpp:19
-CHECK: COVERED_DIRS: {{.*}}lib/Fuzzer/test
+CHECK: COVERED_DIRS: {{.*}}lib{{[/\\]}}Fuzzer{{[/\\]}}test
 RUN: not LLVMFuzzer-NullDerefTest -print_coverage=1 2>&1 | FileCheck %s
zturner wrote:
> A couple of alternatives:
> 1. Check whether this line would work: `CHECK: COVERED_DIRS: %S`
> 2. Use `%{pathsep}` instead of the regex.  `CHECK: COVERED_DIRS: {{.*}}lib%{pathsep}Fuzzer%{pathsep}test`
> The first would be ideal, but if the output only prints a relative path and not an absolute path, it won't work since `%S` uses an absolute path.
@zturner I think we need to use `{{[/\\]}}`. I see that many tests use that.  We can't use `%S` and `%{pathsep}`, because they can only be used inside `RUN:` lines, because they are replaced by `lit`, not  by `FileCheck`.


More information about the llvm-commits mailing list