Index: CMakeLists.txt =================================================================== --- CMakeLists.txt +++ CMakeLists.txt @@ -422,7 +422,10 @@ # Define the default arguments to use with 'lit', and an option for the user to # override. -set(LIT_ARGS_DEFAULT "-sv") +# FIXME(modocache): The --use-test-suite-names option exists purely to stage +# the migration to using paths as test suite names. It will +# be removed. +set(LIT_ARGS_DEFAULT "-sv --use-test-suite-names") if (MSVC_IDE OR XCODE) set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar") endif() Index: utils/lit/TODO =================================================================== --- utils/lit/TODO +++ utils/lit/TODO @@ -41,17 +41,7 @@ for directories, but allow the test format control over what happens for individual tests). -2. Consider move to identifying all tests by path-to-test-suite and then path to - subtest, and don't use test suite names. - - Currently the test suite name is presented as part of test names, but it has - no other useful function, and it is something that has to be skipped over to - cut-and-paste a name to subsequently use to rerun a test. If we just - represented each test suite by the path to its suite, then it would allow more - easy cut-and-paste of the test output lines. This has the downside that the - lines might get rather long. - -3. Allow 'lit' driver to cooperate with test formats and suites to add options +2. Allow 'lit' driver to cooperate with test formats and suites to add options (or at least sanitize accepted params). We have started to use the --params method more and more extensively, and it is @@ -86,7 +76,7 @@ about (or even be aware of) the distinction between the generic lit infrastructure and format or suite specific options. -4. Eliminate duplicate execution models for ShTest tests. +3. Eliminate duplicate execution models for ShTest tests. Currently, the ShTest format uses tests written with shell-script like syntax, and executes them in one of two ways. The first way is by converting them into @@ -121,7 +111,7 @@ tests, or add additional features to the internal shell handling to allow them to pass. -5. Consider changing core to support setup vs. execute distinction. +4. Consider changing core to support setup vs. execute distinction. Many of the existing test formats are cleanly divided into two phases, once parses the test format and extracts XFAIL and REQUIRES information, etc., and Index: utils/lit/lit/LitConfig.py =================================================================== --- utils/lit/lit/LitConfig.py +++ utils/lit/lit/LitConfig.py @@ -24,7 +24,8 @@ noExecute, debug, isWindows, params, config_prefix = None, maxIndividualTestTime = 0, - maxFailures = None): + maxFailures = None, + useTestSuiteNames = False): # The name of the test runner. self.progname = progname # The items to add to the PATH environment variable. @@ -62,6 +63,7 @@ self.maxIndividualTestTime = maxIndividualTestTime self.maxFailures = maxFailures + self.useTestSuiteNames = useTestSuiteNames @property def maxIndividualTestTime(self): Index: utils/lit/lit/TestingConfig.py =================================================================== --- utils/lit/lit/TestingConfig.py +++ utils/lit/lit/TestingConfig.py @@ -8,6 +8,10 @@ TestingConfig - Information on the tests inside a suite. """ + # The name used for test suites with lit configs that don't + # specify a name, and are run with --use-test-suite-names. + _unnamed_test_suite_name = '' + @staticmethod def fromdefaults(litConfig): """ @@ -51,7 +55,7 @@ available_features.append('vg_leak') return TestingConfig(None, - name = '', + name = TestingConfig._unnamed_test_suite_name, suffixes = set(), test_format = None, environment = environment, @@ -91,6 +95,15 @@ execfile(path, cfg_globals) else: exec(compile(data, path, 'exec'), cfg_globals, None) + + if not litConfig.useTestSuiteNames: + if self.name != self.__class__._unnamed_test_suite_name: + litConfig.note( + 'Test suite names have been deprecated. The name ' + 'specified by the the configuration, "{}", will be ' + 'ignored.'.format(self.name)) + self.name = os.path.dirname(path) + if litConfig.debug: litConfig.note('... loaded config %r' % path) except SystemExit: Index: utils/lit/lit/main.py =================================================================== --- utils/lit/lit/main.py +++ utils/lit/lit/main.py @@ -271,6 +271,14 @@ debug_group.add_argument("--show-tests", dest="showTests", help="Show all discovered tests", action="store_true", default=False) + debug_group.add_argument( + "--use-test-suite-names", + help="Display the test suite name specified in the 'lit' config " + + "file, instead of the path to that config file. This is " + + "deprecated behavior that will be removed in an upcoming " + + "version of 'lit'", + action="store_true", + dest="useTestSuiteNames") debug_group.add_argument("--use-processes", dest="useProcesses", help="Run tests in parallel with processes (not threads)", action="store_true", default=True) @@ -328,7 +336,8 @@ params = userParams, config_prefix = opts.configPrefix, maxIndividualTestTime = maxIndividualTestTime, - maxFailures = opts.maxFailures) + maxFailures = opts.maxFailures, + useTestSuiteNames = opts.useTestSuiteNames) # Perform test discovery. run = lit.run.Run(litConfig, Index: utils/lit/tests/Inputs/discovery/lit.cfg =================================================================== --- utils/lit/tests/Inputs/discovery/lit.cfg +++ utils/lit/tests/Inputs/discovery/lit.cfg @@ -1,5 +1,4 @@ import lit.formats -config.name = 'top-level-suite' config.suffixes = ['.txt'] config.test_format = lit.formats.ShTest() Index: utils/lit/tests/Inputs/discovery/subsuite/lit.cfg =================================================================== --- utils/lit/tests/Inputs/discovery/subsuite/lit.cfg +++ utils/lit/tests/Inputs/discovery/subsuite/lit.cfg @@ -1,5 +1,4 @@ import lit.formats -config.name = 'sub-suite' config.suffixes = ['.txt'] config.test_format = lit.formats.ShTest() config.test_source_root = None Index: utils/lit/tests/Inputs/exec-discovery-in-tree/lit.cfg =================================================================== --- utils/lit/tests/Inputs/exec-discovery-in-tree/lit.cfg +++ utils/lit/tests/Inputs/exec-discovery-in-tree/lit.cfg @@ -4,6 +4,5 @@ if config.test_source_root is None or config.test_exec_root is None: lit_config.fatal("No site specific configuration") -config.name = 'exec-discovery-in-tree-suite' config.suffixes = ['.txt'] config.test_format = lit.formats.ShTest() Index: utils/lit/tests/Inputs/googletest-format/lit.cfg =================================================================== --- utils/lit/tests/Inputs/googletest-format/lit.cfg +++ utils/lit/tests/Inputs/googletest-format/lit.cfg @@ -1,3 +1,2 @@ import lit.formats -config.name = 'googletest-format' config.test_format = lit.formats.GoogleTest('DummySubDir', 'Test') Index: utils/lit/tests/Inputs/googletest-timeout/lit.cfg =================================================================== --- utils/lit/tests/Inputs/googletest-timeout/lit.cfg +++ utils/lit/tests/Inputs/googletest-timeout/lit.cfg @@ -1,5 +1,4 @@ import lit.formats -config.name = 'googletest-timeout' config.test_format = lit.formats.GoogleTest('DummySubDir', 'Test') configSetTimeout = lit_config.params.get('set_timeout', '0') Index: utils/lit/tests/Inputs/googletest-upstream-format/lit.cfg =================================================================== --- utils/lit/tests/Inputs/googletest-upstream-format/lit.cfg +++ utils/lit/tests/Inputs/googletest-upstream-format/lit.cfg @@ -1,3 +1,2 @@ import lit.formats -config.name = 'googletest-upstream-format' config.test_format = lit.formats.GoogleTest('DummySubDir', 'Test') Index: utils/lit/tests/Inputs/progress-bar/lit.cfg =================================================================== --- utils/lit/tests/Inputs/progress-bar/lit.cfg +++ utils/lit/tests/Inputs/progress-bar/lit.cfg @@ -1,5 +1,4 @@ import lit.formats -config.name = 'shtest-shell' config.suffixes = ['.txt'] config.test_format = lit.formats.ShTest() config.test_source_root = None Index: utils/lit/tests/Inputs/shtest-format/lit.cfg =================================================================== --- utils/lit/tests/Inputs/shtest-format/lit.cfg +++ utils/lit/tests/Inputs/shtest-format/lit.cfg @@ -1,5 +1,4 @@ import lit.formats -config.name = 'shtest-format' config.suffixes = ['.txt'] config.test_format = lit.formats.ShTest() config.test_source_root = None Index: utils/lit/tests/Inputs/shtest-output-printing/lit.cfg =================================================================== --- utils/lit/tests/Inputs/shtest-output-printing/lit.cfg +++ utils/lit/tests/Inputs/shtest-output-printing/lit.cfg @@ -1,4 +1,3 @@ import lit.formats -config.name = 'shtest-output-printing' config.suffixes = ['.txt'] config.test_format = lit.formats.ShTest(execute_external=False) Index: utils/lit/tests/Inputs/shtest-shell/lit.cfg =================================================================== --- utils/lit/tests/Inputs/shtest-shell/lit.cfg +++ utils/lit/tests/Inputs/shtest-shell/lit.cfg @@ -1,5 +1,4 @@ import lit.formats -config.name = 'shtest-shell' config.suffixes = ['.txt'] config.test_format = lit.formats.ShTest() config.test_source_root = None Index: utils/lit/tests/Inputs/shtest-timeout/lit.cfg =================================================================== --- utils/lit/tests/Inputs/shtest-timeout/lit.cfg +++ utils/lit/tests/Inputs/shtest-timeout/lit.cfg @@ -4,8 +4,6 @@ import lit.formats -config.name = 'per_test_timeout' - shellType = lit_config.params.get('external', '1') if shellType == '0': Index: utils/lit/tests/Inputs/test-data/lit.cfg =================================================================== --- utils/lit/tests/Inputs/test-data/lit.cfg +++ utils/lit/tests/Inputs/test-data/lit.cfg @@ -36,7 +36,6 @@ return result -config.name = 'test-data' config.suffixes = ['.ini'] config.test_format = DummyFormat() config.test_source_root = None Index: utils/lit/tests/Inputs/unittest-adaptor/lit.cfg =================================================================== --- utils/lit/tests/Inputs/unittest-adaptor/lit.cfg +++ utils/lit/tests/Inputs/unittest-adaptor/lit.cfg @@ -1,5 +1,4 @@ import lit.formats -config.name = 'unittest-adaptor' config.suffixes = ['.txt'] config.test_format = lit.formats.ShTest() config.test_source_root = None Index: utils/lit/tests/Inputs/use-test-suite-names/named/lit.cfg =================================================================== --- utils/lit/tests/Inputs/use-test-suite-names/named/lit.cfg +++ utils/lit/tests/Inputs/use-test-suite-names/named/lit.cfg @@ -1,6 +1,7 @@ import lit.formats -config.name = 'shtest-shell' +config.name = 'A named test suite' config.suffixes = ['.txt'] config.test_format = lit.formats.ShTest() config.test_source_root = None config.test_exec_root = None + Index: utils/lit/tests/Inputs/use-test-suite-names/named/test-one.txt =================================================================== --- /dev/null +++ utils/lit/tests/Inputs/use-test-suite-names/named/test-one.txt @@ -0,0 +1,2 @@ +# RUN: true + Index: utils/lit/tests/Inputs/use-test-suite-names/unnamed/lit.cfg =================================================================== --- utils/lit/tests/Inputs/use-test-suite-names/unnamed/lit.cfg +++ utils/lit/tests/Inputs/use-test-suite-names/unnamed/lit.cfg @@ -1,6 +1,6 @@ import lit.formats -config.name = 'sub-suite' config.suffixes = ['.txt'] config.test_format = lit.formats.ShTest() config.test_source_root = None config.test_exec_root = None + Index: utils/lit/tests/Inputs/use-test-suite-names/unnamed/test-one.txt =================================================================== --- /dev/null +++ utils/lit/tests/Inputs/use-test-suite-names/unnamed/test-one.txt @@ -0,0 +1,2 @@ +# RUN: true + Index: utils/lit/tests/discovery.py =================================================================== --- utils/lit/tests/discovery.py +++ utils/lit/tests/discovery.py @@ -11,19 +11,19 @@ # CHECK-BASIC-ERR-DAG: loading local config '{{.*}}/discovery/subdir/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: top-level-suite - 3 tests +# CHECK-BASIC-OUT: {{.*/discovery}} - 3 tests # CHECK-BASIC-OUT: Source Root: {{.*/discovery$}} # CHECK-BASIC-OUT: Exec Root : {{.*/discovery$}} +# CHECK-BASIC-OUT: {{.*/discovery/subsuite}} - 2 tests +# CHECK-BASIC-OUT: Source Root: {{.*/discovery/subsuite$}} +# CHECK-BASIC-OUT: Exec Root : {{.*/discovery/subsuite$}} # # 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 +# CHECK-BASIC-OUT: {{.*/discovery}} :: test-two +# CHECK-BASIC-OUT: {{.*/discovery/subsuite}} :: test-one +# CHECK-BASIC-OUT: {{.*/discovery/subsuite}} :: test-two # Check discovery when exact test names are given. @@ -35,8 +35,8 @@ # RUN: FileCheck --check-prefix=CHECK-EXACT-TEST < %t.out %s # # CHECK-EXACT-TEST: -- Available Tests -- -# CHECK-EXACT-TEST: sub-suite :: test-one -# CHECK-EXACT-TEST: top-level-suite :: subdir/test-three +# CHECK-EXACT-TEST: {{.*/discovery}} :: subdir/test-three +# CHECK-EXACT-TEST: {{.*/discovery/subsuite}} :: test-one # Check discovery when using an exec path. @@ -55,19 +55,19 @@ # CHECK-ASEXEC-ERR-DAG: loading local config '{{.*}}/discovery/subdir/lit.local.cfg' # # CHECK-ASEXEC-OUT: -- Test Suites -- -# CHECK-ASEXEC-OUT: sub-suite - 2 tests +# CHECK-ASEXEC-OUT: {{.*/discovery/subsuite}} - 2 tests # CHECK-ASEXEC-OUT: Source Root: {{.*/discovery/subsuite$}} # CHECK-ASEXEC-OUT: Exec Root : {{.*/discovery/subsuite$}} -# CHECK-ASEXEC-OUT: top-level-suite - 3 tests +# CHECK-ASEXEC-OUT: {{.*/exec-discovery}} - 3 tests # CHECK-ASEXEC-OUT: Source Root: {{.*/discovery$}} # CHECK-ASEXEC-OUT: Exec Root : {{.*/exec-discovery$}} # # CHECK-ASEXEC-OUT: -- Available Tests -- -# CHECK-ASEXEC-OUT: sub-suite :: test-one -# CHECK-ASEXEC-OUT: sub-suite :: test-two -# CHECK-ASEXEC-OUT: top-level-suite :: subdir/test-three -# CHECK-ASEXEC-OUT: top-level-suite :: test-one -# CHECK-ASEXEC-OUT: top-level-suite :: test-two +# CHECK-ASEXEC-OUT: {{.*/discovery/subsuite}} :: test-one +# CHECK-ASEXEC-OUT: {{.*/discovery/subsuite}} :: test-two +# CHECK-ASEXEC-OUT: {{.*/exec-discovery}} :: subdir/test-three +# CHECK-ASEXEC-OUT: {{.*/exec-discovery}} :: test-one +# CHECK-ASEXEC-OUT: {{.*/exec-discovery}} :: test-two # Check discovery when exact test names are given. # @@ -79,7 +79,7 @@ # RUN: FileCheck --check-prefix=CHECK-ASEXEC-EXACT-TEST < %t.out %s # # CHECK-ASEXEC-EXACT-TEST: -- Available Tests -- -# CHECK-ASEXEC-EXACT-TEST: top-level-suite :: subdir/test-three +# CHECK-ASEXEC-EXACT-TEST: {{.*/exec-discovery}} :: subdir/test-three # Check that we don't recurse infinitely when loading an site specific test @@ -90,8 +90,8 @@ # RUN: -j 1 --show-tests --show-suites -v > %t.out # RUN: FileCheck --check-prefix=CHECK-ASEXEC-INTREE < %t.out %s # -# CHECK-ASEXEC-INTREE: exec-discovery-in-tree-suite - 1 tests +# CHECK-ASEXEC-INTREE: {{.*/exec-discovery-in-tree/obj}} - 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: -- Available Tests -- -# CHECK-ASEXEC-INTREE-NEXT: exec-discovery-in-tree-suite :: test-one +# CHECK-ASEXEC-INTREE-NEXT: {{.*/exec-discovery-in-tree/obj}} :: test-one Index: utils/lit/tests/googletest-format.py =================================================================== --- utils/lit/tests/googletest-format.py +++ utils/lit/tests/googletest-format.py @@ -6,14 +6,14 @@ # END. # CHECK: -- Testing: -# CHECK: PASS: googletest-format :: DummySubDir/OneTest/FirstTest.subTestA -# CHECK: FAIL: googletest-format :: DummySubDir/OneTest/FirstTest.subTestB -# CHECK-NEXT: *** TEST 'googletest-format :: DummySubDir/OneTest/FirstTest.subTestB' FAILED *** +# CHECK: PASS: {{.*/googletest-format}} :: DummySubDir/OneTest/FirstTest.subTestA +# CHECK: FAIL: {{.*/googletest-format}} :: DummySubDir/OneTest/FirstTest.subTestB +# CHECK-NEXT: *** TEST '{{.*/googletest-format}} :: DummySubDir/OneTest/FirstTest.subTestB' FAILED *** # CHECK-NEXT: I am subTest B, I FAIL # CHECK-NEXT: And I have two lines of output # CHECK: *** -# CHECK: PASS: googletest-format :: DummySubDir/OneTest/ParameterizedTest/0.subTest -# CHECK: PASS: googletest-format :: DummySubDir/OneTest/ParameterizedTest/1.subTest +# CHECK: PASS: {{.*/googletest-format}} :: DummySubDir/OneTest/ParameterizedTest/0.subTest +# CHECK: PASS: {{.*/googletest-format}} :: DummySubDir/OneTest/ParameterizedTest/1.subTest # CHECK: Failing Tests (1) # CHECK: Expected Passes : 3 # CHECK: Unexpected Failures: 1 Index: utils/lit/tests/googletest-timeout.py =================================================================== --- utils/lit/tests/googletest-timeout.py +++ utils/lit/tests/googletest-timeout.py @@ -13,9 +13,9 @@ # RUN: FileCheck < %t.cfgset.out %s # CHECK: -- Testing: -# CHECK: PASS: googletest-timeout :: DummySubDir/OneTest/FirstTest.subTestA -# CHECK: TIMEOUT: googletest-timeout :: DummySubDir/OneTest/FirstTest.subTestB -# CHECK: TIMEOUT: googletest-timeout :: DummySubDir/OneTest/FirstTest.subTestC +# CHECK: PASS: {{.*/googletest-timeout}} :: DummySubDir/OneTest/FirstTest.subTestA +# CHECK: TIMEOUT: {{.*/googletest-timeout}} :: DummySubDir/OneTest/FirstTest.subTestB +# CHECK: TIMEOUT: {{.*/googletest-timeout}} :: DummySubDir/OneTest/FirstTest.subTestC # CHECK: Expected Passes : 1 # CHECK: Individual Timeouts: 2 Index: utils/lit/tests/googletest-upstream-format.py =================================================================== --- utils/lit/tests/googletest-upstream-format.py +++ utils/lit/tests/googletest-upstream-format.py @@ -6,15 +6,15 @@ # END. # CHECK: -- Testing: -# CHECK: PASS: googletest-upstream-format :: DummySubDir/OneTest/FirstTest.subTestA -# CHECK: FAIL: googletest-upstream-format :: DummySubDir/OneTest/FirstTest.subTestB -# CHECK-NEXT: *** TEST 'googletest-upstream-format :: DummySubDir/OneTest/FirstTest.subTestB' FAILED *** +# CHECK: PASS: {{.*/googletest-upstream-format}} :: DummySubDir/OneTest/FirstTest.subTestA +# CHECK: FAIL: {{.*/googletest-upstream-format}} :: DummySubDir/OneTest/FirstTest.subTestB +# CHECK-NEXT: *** TEST '{{.*/googletest-upstream-format}} :: DummySubDir/OneTest/FirstTest.subTestB' FAILED *** # CHECK-NEXT: Running main() from gtest_main.cc # CHECK-NEXT: I am subTest B, I FAIL # CHECK-NEXT: And I have two lines of output # CHECK: *** -# CHECK: PASS: googletest-upstream-format :: DummySubDir/OneTest/ParameterizedTest/0.subTest -# CHECK: PASS: googletest-upstream-format :: DummySubDir/OneTest/ParameterizedTest/1.subTest +# CHECK: PASS: {{.*/googletest-upstream-format}} :: DummySubDir/OneTest/ParameterizedTest/0.subTest +# CHECK: PASS: {{.*/googletest-upstream-format}} :: DummySubDir/OneTest/ParameterizedTest/1.subTest # CHECK: Failing Tests (1) # CHECK: Expected Passes : 3 # CHECK: Unexpected Failures: 1 Index: utils/lit/tests/lit.cfg =================================================================== --- utils/lit/tests/lit.cfg +++ utils/lit/tests/lit.cfg @@ -7,9 +7,6 @@ # Configuration file for the 'lit' test runner. -# name: The name of this test suite. -config.name = 'lit' - # testFormat: The test format to use to interpret tests. config.test_format = lit.formats.ShTest(execute_external=False) Index: utils/lit/tests/progress-bar.py =================================================================== --- utils/lit/tests/progress-bar.py +++ utils/lit/tests/progress-bar.py @@ -4,10 +4,10 @@ # RUN: FileCheck < %t.out %s # # CHECK: Testing: 0 .. 10.. 20 -# CHECK: FAIL: shtest-shell :: test-1.txt (1 of 4) +# CHECK: FAIL: {{.*/progress-bar}} :: test-1.txt (1 of 4) # CHECK: Testing: 0 .. 10.. 20.. 30.. 40.. -# CHECK: FAIL: shtest-shell :: test-2.txt (2 of 4) +# CHECK: FAIL: {{.*/progress-bar}} :: test-2.txt (2 of 4) # CHECK: Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70 -# CHECK: FAIL: shtest-shell :: test-3.txt (3 of 4) +# CHECK: FAIL: {{.*/progress-bar}} :: test-3.txt (3 of 4) # CHECK: Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. -# CHECK: FAIL: shtest-shell :: test-4.txt (4 of 4) +# CHECK: FAIL: {{.*/progress-bar}} :: test-4.txt (4 of 4) Index: utils/lit/tests/shtest-format.py =================================================================== --- utils/lit/tests/shtest-format.py +++ utils/lit/tests/shtest-format.py @@ -7,9 +7,9 @@ # CHECK: -- Testing: -# CHECK: PASS: shtest-format :: argv0.txt -# CHECK: FAIL: shtest-format :: external_shell/fail.txt -# CHECK-NEXT: *** TEST 'shtest-format :: external_shell/fail.txt' FAILED *** +# CHECK: PASS: {{.*/shtest-format}} :: argv0.txt +# CHECK: FAIL: {{.*/shtest-format}} :: external_shell/fail.txt +# CHECK-NEXT: *** TEST '{{.*/shtest-format}} :: external_shell/fail.txt' FAILED *** # CHECK: Command Output (stdout): # CHECK-NEXT: -- # CHECK-NEXT: line 1: failed test output on stdout @@ -19,17 +19,17 @@ # CHECK-NEXT: cat: does-not-exist: No such file or directory # CHECK: -- -# CHECK: FAIL: shtest-format :: external_shell/fail_with_bad_encoding.txt -# CHECK-NEXT: *** TEST 'shtest-format :: external_shell/fail_with_bad_encoding.txt' FAILED *** +# CHECK: FAIL: {{.*/shtest-format}} :: external_shell/fail_with_bad_encoding.txt +# CHECK-NEXT: *** TEST '{{.*/shtest-format}} :: external_shell/fail_with_bad_encoding.txt' FAILED *** # CHECK: Command Output (stdout): # CHECK-NEXT: -- # CHECK-NEXT: a line with bad encoding: # CHECK: -- -# CHECK: PASS: shtest-format :: external_shell/pass.txt +# CHECK: PASS: {{.*/shtest-format}} :: external_shell/pass.txt -# CHECK: FAIL: shtest-format :: fail.txt -# CHECK-NEXT: *** TEST 'shtest-format :: fail.txt' FAILED *** +# CHECK: FAIL: {{.*/shtest-format}} :: fail.txt +# CHECK-NEXT: *** TEST '{{.*/shtest-format}} :: fail.txt' FAILED *** # CHECK-NEXT: Script: # CHECK-NEXT: -- # CHECK-NEXT: printf "line 1 @@ -44,18 +44,18 @@ # CHECK-NEXT: line 1: failed test output on stdout # CHECK-NEXT: line 2: failed test output on stdout -# CHECK: UNRESOLVED: shtest-format :: no-test-line.txt -# CHECK: PASS: shtest-format :: pass.txt -# CHECK: UNSUPPORTED: shtest-format :: requires-any-missing.txt -# CHECK: PASS: shtest-format :: requires-any-present.txt -# CHECK: UNSUPPORTED: shtest-format :: requires-missing.txt -# CHECK: PASS: shtest-format :: requires-present.txt -# CHECK: UNSUPPORTED: shtest-format :: unsupported_dir/some-test.txt -# CHECK: XFAIL: shtest-format :: xfail-feature.txt -# CHECK: XFAIL: shtest-format :: xfail-target.txt -# CHECK: XFAIL: shtest-format :: xfail.txt -# CHECK: XPASS: shtest-format :: xpass.txt -# CHECK-NEXT: *** TEST 'shtest-format :: xpass.txt' FAILED *** +# CHECK: UNRESOLVED: {{.*/shtest-format}} :: no-test-line.txt +# CHECK: PASS: {{.*/shtest-format}} :: pass.txt +# CHECK: UNSUPPORTED: {{.*/shtest-format}} :: requires-any-missing.txt +# CHECK: PASS: {{.*/shtest-format}} :: requires-any-present.txt +# CHECK: UNSUPPORTED: {{.*/shtest-format}} :: requires-missing.txt +# CHECK: PASS: {{.*/shtest-format}} :: requires-present.txt +# CHECK: UNSUPPORTED: {{.*/shtest-format}} :: unsupported_dir/some-test.txt +# CHECK: XFAIL: {{.*/shtest-format}} :: xfail-feature.txt +# CHECK: XFAIL: {{.*/shtest-format}} :: xfail-target.txt +# CHECK: XFAIL: {{.*/shtest-format}} :: xfail.txt +# CHECK: XPASS: {{.*/shtest-format}} :: xpass.txt +# CHECK-NEXT: *** TEST '{{.*/shtest-format}} :: xpass.txt' FAILED *** # CHECK-NEXT: Script # CHECK-NEXT: -- # CHECK-NEXT: true @@ -63,12 +63,12 @@ # CHECK: Testing Time # CHECK: Unexpected Passing Tests (1) -# CHECK: shtest-format :: xpass.txt +# CHECK: {{.*/shtest-format}} :: xpass.txt # CHECK: Failing Tests (3) -# CHECK: shtest-format :: external_shell/fail.txt -# CHECK: shtest-format :: external_shell/fail_with_bad_encoding.txt -# CHECK: shtest-format :: fail.txt +# CHECK: {{.*/shtest-format}} :: external_shell/fail.txt +# CHECK: {{.*/shtest-format}} :: external_shell/fail_with_bad_encoding.txt +# CHECK: {{.*/shtest-format}} :: fail.txt # CHECK: Expected Passes : 5 # CHECK: Expected Failures : 3 Index: utils/lit/tests/shtest-output-printing.py =================================================================== --- utils/lit/tests/shtest-output-printing.py +++ utils/lit/tests/shtest-output-printing.py @@ -7,8 +7,8 @@ # CHECK: -- Testing: -# CHECK: FAIL: shtest-output-printing :: basic.txt -# CHECK-NEXT: *** TEST 'shtest-output-printing :: basic.txt' FAILED *** +# CHECK: FAIL: {{.*/shtest-output-printing}} :: basic.txt +# CHECK-NEXT: *** TEST '{{.*/shtest-output-printing}} :: basic.txt' FAILED *** # CHECK-NEXT: Script: # CHECK-NEXT: -- # CHECK: -- Index: utils/lit/tests/shtest-shell.py =================================================================== --- utils/lit/tests/shtest-shell.py +++ utils/lit/tests/shtest-shell.py @@ -7,8 +7,8 @@ # CHECK: -- Testing: -# CHECK: FAIL: shtest-shell :: error-0.txt -# CHECK: *** TEST 'shtest-shell :: error-0.txt' FAILED *** +# CHECK: FAIL: {{.*/shtest-shell}} :: error-0.txt +# CHECK: *** TEST '{{.*/shtest-shell}} :: error-0.txt' FAILED *** # CHECK: $ "not-a-real-command" # CHECK: # command stderr: # CHECK: 'not-a-real-command': command not found @@ -17,17 +17,17 @@ # FIXME: The output here sucks. # -# CHECK: FAIL: shtest-shell :: error-1.txt -# CHECK: *** TEST 'shtest-shell :: error-1.txt' FAILED *** +# CHECK: FAIL: {{.*/shtest-shell}} :: error-1.txt +# CHECK: *** TEST '{{.*/shtest-shell}} :: error-1.txt' FAILED *** # CHECK: shell parser error on: 'echo "missing quote' # CHECK: *** -# CHECK: FAIL: shtest-shell :: error-2.txt -# CHECK: *** TEST 'shtest-shell :: error-2.txt' FAILED *** +# CHECK: FAIL: {{.*/shtest-shell}} :: error-2.txt +# CHECK: *** TEST '{{.*/shtest-shell}} :: error-2.txt' FAILED *** # CHECK: Unsupported redirect: # CHECK: *** -# CHECK: PASS: shtest-shell :: redirects.txt -# CHECK: PASS: shtest-shell :: sequencing-0.txt -# CHECK: XFAIL: shtest-shell :: sequencing-1.txt +# CHECK: PASS: {{.*/shtest-shell}} :: redirects.txt +# CHECK: PASS: {{.*/shtest-shell}} :: sequencing-0.txt +# CHECK: XFAIL: {{.*/shtest-shell}} :: sequencing-1.txt # CHECK: Failing Tests (3) Index: utils/lit/tests/shtest-timeout.py =================================================================== --- utils/lit/tests/shtest-timeout.py +++ utils/lit/tests/shtest-timeout.py @@ -59,20 +59,20 @@ # # CHECK-CFGSET-ERR: Using internal shell -# CHECK-OUT-COMMON: TIMEOUT: per_test_timeout :: infinite_loop.py +# CHECK-OUT-COMMON: TIMEOUT: {{.*/shtest-timeout}} :: infinite_loop.py # CHECK-OUT-COMMON: Timeout: Reached timeout of 1 seconds # CHECK-OUT-COMMON: Command {{([0-9]+ )?}}Output # CHECK-OUT-COMMON: Running infinite loop -# CHECK-OUT-COMMON: TIMEOUT: per_test_timeout :: quick_then_slow.py +# CHECK-OUT-COMMON: TIMEOUT: {{.*/shtest-timeout}} :: quick_then_slow.py # CHECK-OUT-COMMON: Timeout: Reached timeout of 1 seconds # CHECK-OUT-COMMON: Command {{([0-9]+ )?}}Output # CHECK-OUT-COMMON: Running in quick mode # CHECK-OUT-COMMON: Running in slow mode -# CHECK-OUT-COMMON: PASS: per_test_timeout :: short.py +# CHECK-OUT-COMMON: PASS: {{.*/shtest-timeout}} :: short.py -# CHECK-OUT-COMMON: TIMEOUT: per_test_timeout :: slow.py +# CHECK-OUT-COMMON: TIMEOUT: {{.*/shtest-timeout}} :: slow.py # CHECK-OUT-COMMON: Timeout: Reached timeout of 1 seconds # CHECK-OUT-COMMON: Command {{([0-9]+ )?}}Output # CHECK-OUT-COMMON: Running slow program @@ -94,20 +94,20 @@ # CHECK-CMDLINE-OVERRIDE-ERR: Forcing timeout to be 2 seconds -# CHECK-CMDLINE-OVERRIDE-OUT: TIMEOUT: per_test_timeout :: infinite_loop.py +# CHECK-CMDLINE-OVERRIDE-OUT: TIMEOUT: {{.*/shtest-timeout}} :: infinite_loop.py # CHECK-CMDLINE-OVERRIDE-OUT: Timeout: Reached timeout of 2 seconds # CHECK-CMDLINE-OVERRIDE-OUT: Command {{([0-9]+ )?}}Output # CHECK-CMDLINE-OVERRIDE-OUT: Running infinite loop -# CHECK-CMDLINE-OVERRIDE-OUT: TIMEOUT: per_test_timeout :: quick_then_slow.py +# CHECK-CMDLINE-OVERRIDE-OUT: TIMEOUT: {{.*/shtest-timeout}} :: quick_then_slow.py # CHECK-CMDLINE-OVERRIDE-OUT: Timeout: Reached timeout of 2 seconds # CHECK-CMDLINE-OVERRIDE-OUT: Command {{([0-9]+ )?}}Output # CHECK-CMDLINE-OVERRIDE-OUT: Running in quick mode # CHECK-CMDLINE-OVERRIDE-OUT: Running in slow mode -# CHECK-CMDLINE-OVERRIDE-OUT: PASS: per_test_timeout :: short.py +# CHECK-CMDLINE-OVERRIDE-OUT: PASS: {{.*/shtest-timeout}} :: short.py -# CHECK-CMDLINE-OVERRIDE-OUT: TIMEOUT: per_test_timeout :: slow.py +# CHECK-CMDLINE-OVERRIDE-OUT: TIMEOUT: {{.*/shtest-timeout}} :: slow.py # CHECK-CMDLINE-OVERRIDE-OUT: Timeout: Reached timeout of 2 seconds # CHECK-CMDLINE-OVERRIDE-OUT: Command {{([0-9]+ )?}}Output # CHECK-CMDLINE-OVERRIDE-OUT: Running slow program Index: utils/lit/tests/test-data.py =================================================================== --- utils/lit/tests/test-data.py +++ utils/lit/tests/test-data.py @@ -5,8 +5,8 @@ # CHECK: -- Testing: -# CHECK: PASS: test-data :: metrics.ini -# CHECK-NEXT: *** TEST 'test-data :: metrics.ini' RESULTS *** +# CHECK: PASS: {{.*/test-data}} :: metrics.ini +# CHECK-NEXT: *** TEST '{{.*/test-data}} :: metrics.ini' RESULTS *** # CHECK-NEXT: value0: 1 # CHECK-NEXT: value1: 2.3456 # CHECK-NEXT: *** Index: utils/lit/tests/test-output.py =================================================================== --- utils/lit/tests/test-output.py +++ utils/lit/tests/test-output.py @@ -12,7 +12,7 @@ # CHECK-NEXT: "value0": 1, # CHECK-NEXT: "value1": 2.3456 # CHECK-NEXT: } -# CHECK-NEXT: "name": "test-data :: metrics.ini", +# CHECK-NEXT: "name": "{{.*/test-data}} :: metrics.ini", # CHECK-NEXT: "output": "Test passed." # CHECK-NEXT: } # CHECK-NEXT: ] Index: utils/lit/tests/use-test-suite-names.py =================================================================== --- /dev/null +++ utils/lit/tests/use-test-suite-names.py @@ -0,0 +1,27 @@ +# Check the behavior of the --use-test-suite-names option. + +# When --use-test-suite-names is not specified, the path to the test +# suite is used instead of its name, and a note is printed to stderr. + +# RUN: %{lit} -j 1 -v %{inputs}/use-test-suite-names/named > %t.named.out 2> %t.named.err +# RUN: FileCheck < %t.named.out %s +# RUN: FileCheck < %t.named.err %s --check-prefix=CHECK-ERR +# CHECK: {{.*/use-test-suite-names/named}} :: test-one.txt +# CHECK-ERR: Test suite names have been deprecated.{{.*}}"A named test suite" + +# When --use-test-suite-names is specified, the name is used instead of +# the path to the suite. Nothing is printed to stderr. + +# RUN: %{lit} -j 1 -v --use-test-suite-names %{inputs}/use-test-suite-names/named 2>&1 > %t.named.usename.out +# RUN: FileCheck < %t.named.usename.out %s --check-prefix=CHECK-USE-NAME +# CHECK-USE-NAME: A named test suite :: test-one.txt +# CHECK-USE-NAME-NOT: Test suite names have been deprecated. + +# When --use-test-suite-names is specified, but no name is given, +# the suite is named "". Nothing is printed to stderr. + +# RUN: %{lit} -j 1 -v --use-test-suite-names %{inputs}/use-test-suite-names/unnamed 2>&1 > %t.unnamed.usename.out +# RUN: FileCheck < %t.unnamed.usename.out %s --check-prefix=CHECK-UNNAMED-USE-NAME +# CHECK-UNNAMED-USE-NAME: :: test-one.txt +# CHECK-UNNAMED-USE-NAME-NOT: Test suite names have been deprecated. + Index: utils/lit/tests/xunit-output.py =================================================================== --- utils/lit/tests/xunit-output.py +++ utils/lit/tests/xunit-output.py @@ -4,7 +4,7 @@ # CHECK: # CHECK: -# CHECK: -# CHECK: +# CHECK: +# CHECK: # CHECK: # CHECK: