[PATCH] D27701: [lit] Fix discovery test on Windows
Brian Gesiak via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 13 00:22:32 PST 2016
modocache created this revision.
modocache added reviewers: ddunbar, echristo, beanz, delcypher.
modocache added a subscriber: llvm-commits.
Herald added a subscriber: mehdi_amini.
Many lit tests fail when run on Windows, because file path
separators are hard-coded as '/', whereas on Windows they're '\'.
Fix one such test, discovery.py, by using FileCheck variables.
As far as I understood, FileCheck does not contain a built-in variable
that matches '/' or '\', so I do this manually.
An alternative approach would be to add such a variable to FileCheck,
but for now this approach seemed less intrusive.
https://reviews.llvm.org/D27701
Files:
utils/lit/tests/discovery.py
Index: utils/lit/tests/discovery.py
===================================================================
--- utils/lit/tests/discovery.py
+++ utils/lit/tests/discovery.py
@@ -6,17 +6,17 @@
# RUN: FileCheck --check-prefix=CHECK-BASIC-OUT < %t.out %s
# RUN: FileCheck --check-prefix=CHECK-BASIC-ERR < %t.err %s
#
-# CHECK-BASIC-ERR: loading suite config '{{.*}}/discovery/lit.cfg'
-# CHECK-BASIC-ERR-DAG: loading suite config '{{.*}}/discovery/subsuite/lit.cfg'
-# CHECK-BASIC-ERR-DAG: loading local config '{{.*}}/discovery/subdir/lit.local.cfg'
+# CHECK-BASIC-ERR: loading suite config '{{.*}}[[SEP:[/\\]+]]discovery[[SEP]]lit.cfg'
+# CHECK-BASIC-ERR-DAG: loading suite config '{{.*}}[[SEP]]discovery[[SEP]]subsuite[[SEP]]lit.cfg'
+# CHECK-BASIC-ERR-DAG: loading local config '{{.*}}[[SEP]]discovery[[SEP]]subdir[[SEP]]lit.local.cfg'
#
# CHECK-BASIC-OUT: -- Test Suites --
# CHECK-BASIC-OUT: sub-suite - 2 tests
-# CHECK-BASIC-OUT: Source Root: {{.*/discovery/subsuite$}}
-# CHECK-BASIC-OUT: Exec Root : {{.*/discovery/subsuite$}}
+# CHECK-BASIC-OUT: Source Root: {{.*}}[[SEP:[/\\]+]]discovery[[SEP]]subsuite{{$}}
+# CHECK-BASIC-OUT: Exec Root : {{.*}}[[SEP]]discovery[[SEP]]subsuite{{$}}
# CHECK-BASIC-OUT: top-level-suite - 3 tests
-# CHECK-BASIC-OUT: Source Root: {{.*/discovery$}}
-# CHECK-BASIC-OUT: Exec Root : {{.*/discovery$}}
+# CHECK-BASIC-OUT: Source Root: {{.*}}[[SEP]]discovery{{$}}
+# CHECK-BASIC-OUT: Exec Root : {{.*}}[[SEP]]discovery{{$}}
#
# CHECK-BASIC-OUT: -- Available Tests --
# CHECK-BASIC-OUT: sub-suite :: test-one
@@ -47,20 +47,20 @@
# RUN: FileCheck --check-prefix=CHECK-ASEXEC-OUT < %t.out %s
# RUN: FileCheck --check-prefix=CHECK-ASEXEC-ERR < %t.err %s
#
-# CHECK-ASEXEC-ERR: loading suite config '{{.*}}/exec-discovery/lit.site.cfg'
-# CHECK-ASEXEC-ERR: load_config from '{{.*}}/discovery/lit.cfg'
-# CHECK-ASEXEC-ERR: loaded config '{{.*}}/discovery/lit.cfg'
-# CHECK-ASEXEC-ERR: loaded config '{{.*}}/exec-discovery/lit.site.cfg'
-# CHECK-ASEXEC-ERR-DAG: loading suite config '{{.*}}/discovery/subsuite/lit.cfg'
-# CHECK-ASEXEC-ERR-DAG: loading local config '{{.*}}/discovery/subdir/lit.local.cfg'
+# CHECK-ASEXEC-ERR: loading suite config '{{.*}}[[SEP:[/\\]+]]exec-discovery[[SEP]]lit.site.cfg'
+# CHECK-ASEXEC-ERR: load_config from '{{.*}}[[SEP]]discovery[[SEP]]lit.cfg'
+# CHECK-ASEXEC-ERR: loaded config '{{.*}}[[SEP]]discovery[[SEP]]lit.cfg'
+# CHECK-ASEXEC-ERR: loaded config '{{.*}}[[SEP]]exec-discovery[[SEP]]lit.site.cfg'
+# CHECK-ASEXEC-ERR-DAG: loading suite config '{{.*}}[[SEP]]discovery[[SEP]]subsuite[[SEP]]lit.cfg'
+# CHECK-ASEXEC-ERR-DAG: loading local config '{{.*}}[[SEP]]discovery[[SEP]]subdir[[SEP]]lit.local.cfg'
#
# CHECK-ASEXEC-OUT: -- Test Suites --
# CHECK-ASEXEC-OUT: sub-suite - 2 tests
-# CHECK-ASEXEC-OUT: Source Root: {{.*/discovery/subsuite$}}
-# CHECK-ASEXEC-OUT: Exec Root : {{.*/discovery/subsuite$}}
+# CHECK-ASEXEC-OUT: Source Root: {{.*}}[[SEP:[/\\]+]]discovery[[SEP]]subsuite{{$}}
+# CHECK-ASEXEC-OUT: Exec Root : {{.*}}[[SEP]]discovery[[SEP]]subsuite{{$}}
# CHECK-ASEXEC-OUT: top-level-suite - 3 tests
-# CHECK-ASEXEC-OUT: Source Root: {{.*/discovery$}}
-# CHECK-ASEXEC-OUT: Exec Root : {{.*/exec-discovery$}}
+# CHECK-ASEXEC-OUT: Source Root: {{.*}}[[SEP]]discovery{{$}}
+# CHECK-ASEXEC-OUT: Exec Root : {{.*}}[[SEP]]exec-discovery{{$}}
#
# CHECK-ASEXEC-OUT: -- Available Tests --
# CHECK-ASEXEC-OUT: sub-suite :: test-one
@@ -91,7 +91,7 @@
# RUN: FileCheck --check-prefix=CHECK-ASEXEC-INTREE < %t.out %s
#
# CHECK-ASEXEC-INTREE: exec-discovery-in-tree-suite - 1 tests
-# CHECK-ASEXEC-INTREE-NEXT: Source Root: {{.*/exec-discovery-in-tree$}}
-# CHECK-ASEXEC-INTREE-NEXT: Exec Root : {{.*/exec-discovery-in-tree/obj$}}
+# CHECK-ASEXEC-INTREE-NEXT: Source Root: {{.*}}[[SEP:[/\\]+]]exec-discovery-in-tree{{$}}
+# CHECK-ASEXEC-INTREE-NEXT: Exec Root : {{.*}}[[SEP]]exec-discovery-in-tree[[SEP]]obj{{$}}
# CHECK-ASEXEC-INTREE-NEXT: -- Available Tests --
# CHECK-ASEXEC-INTREE-NEXT: exec-discovery-in-tree-suite :: test-one
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27701.81191.patch
Type: text/x-patch
Size: 4121 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161213/e896b98e/attachment.bin>
More information about the llvm-commits
mailing list