[PATCH] D25398: [lit] Use path as test suite name

Dan Liew via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 3 11:43:02 PDT 2016


delcypher added a comment.

Sorry for taking so long to look at this. I've taken a quick glance over the code changes. They look reasonable to me. I'm not sure about the output of lit though (see my other comments).



================
Comment at: utils/lit/tests/discovery.py:14
 # 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:   top-level-suite - 3 tests
+# CHECK-BASIC-OUT:   {{.*/discovery}} - 3 tests
 # CHECK-BASIC-OUT:     Source Root: {{.*/discovery$}}
----------------
modocache wrote:
> kastiglione wrote:
> > Can `%s` or some substitution be used to avoid repetition, and make file renaming more straight forward?
> Good suggestion, but I //believe// that substitutions are only available for lit `RUN` commands, not for input to `FileCheck`. I might be wrong, but I don't think we'll be able to use something like `%{inputs}/discovery` here.
@modocache I believe you are correct that the substitutions are only available in `RUN:` lines. You could use FileCheck's variable support (http://llvm.org/docs/CommandGuide/FileCheck.html#filecheck-variables ) to remove some duplication if you wanted to but I prefer the clarity of how the test is written now.


================
Comment at: utils/lit/tests/discovery.py:22
 # CHECK-BASIC-OUT: -- Available Tests --
-# CHECK-BASIC-OUT: sub-suite :: test-one
-# CHECK-BASIC-OUT: sub-suite :: test-two
-# CHECK-BASIC-OUT: top-level-suite :: subdir/test-three
-# CHECK-BASIC-OUT: top-level-suite :: test-one
-# CHECK-BASIC-OUT: top-level-suite :: test-two
+# CHECK-BASIC-OUT: {{.*/discovery}} :: subdir/test-three
+# CHECK-BASIC-OUT: {{.*/discovery}} :: test-one
----------------
I'm not sure if this is the output that @ddunbar intended. One of the motivations for making this change is so that paths to tests could be copied and pasted and given to lit. If I'm reading these test correctly there's `  ::  ` in between the root path to the test and path to the test in the test suite.


================
Comment at: utils/lit/tests/xunit-output.py:8
+# CHECK: <testsuite name='{{.*/test-data}}' tests='1' failures='0'>
+# CHECK: <testcase classname='{{.*/test-data}}.{{.*/test-data}}' name='metrics.ini' time='0.{{[0-9]+}}'/>
 # CHECK: </testsuite>
----------------
You should probably talk to some of the consumers of this format about this change. A quick `git blame` suggestes that talking to Chris Matthews and David Chisnall about this would be a good place to start.


https://reviews.llvm.org/D25398





More information about the llvm-commits mailing list