Index: CMakeLists.txt =================================================================== --- CMakeLists.txt +++ CMakeLists.txt @@ -425,7 +425,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: docs/CommandGuide/lit.rst =================================================================== --- docs/CommandGuide/lit.rst +++ docs/CommandGuide/lit.rst @@ -288,9 +288,6 @@ available on the *config* object, some of which must be set by the config and others are optional or predefined: - **name** *[required]* The name of the test suite, for use in reports and - diagnostics. - **test_format** *[required]* The test format object which will be used to discover and run tests in the test suite. Generally this will be a builtin test format available from the *lit.formats* module. 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/Test.py =================================================================== --- utils/lit/lit/Test.py +++ utils/lit/lit/Test.py @@ -203,7 +203,8 @@ self.result.code = XFAIL def getFullName(self): - return self.suite.config.name + ' :: ' + '/'.join(self.path_in_suite) + return self.suite.config.name + self.suite.config.separator + \ + '/'.join(self.path_in_suite) def getFilePath(self): if self.file_path: Index: utils/lit/lit/TestingConfig.py =================================================================== --- utils/lit/lit/TestingConfig.py +++ utils/lit/lit/TestingConfig.py @@ -7,6 +7,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): """ @@ -49,8 +53,17 @@ if litConfig.valgrindLeakCheck: available_features.append('vg_leak') + # FIXME(modocache): The double colon separator exists purely to stage + # the migration to using paths as test suite names. + # It will be removed. + if litConfig.useTestSuiteNames: + test_suite_name_separator = ' :: ' + else: + test_suite_name_separator = '/' + return TestingConfig(None, - name = '', + name = TestingConfig._unnamed_test_suite_name, + separator = test_suite_name_separator, suffixes = set(), test_format = None, environment = environment, @@ -86,6 +99,15 @@ cfg_globals['__file__'] = path try: 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: @@ -102,13 +124,14 @@ self.finish(litConfig) - def __init__(self, parent, name, suffixes, test_format, + def __init__(self, parent, name, separator, suffixes, test_format, environment, substitutions, unsupported, test_exec_root, test_source_root, excludes, available_features, pipefail, limit_to_features = [], is_early = False): self.parent = parent self.name = str(name) + self.separator = separator self.suffixes = set(suffixes) self.test_format = test_format self.environment = dict(environment) Index: utils/lit/lit/main.py =================================================================== --- utils/lit/lit/main.py +++ utils/lit/lit/main.py @@ -270,6 +270,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) @@ -327,7 +335,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 @@ -23,12 +23,12 @@ # RUN: FileCheck --check-prefix=CHECK-INTSH-OUT < %t.intsh.out %s # RUN: FileCheck --check-prefix=CHECK-INTSH-ERR < %t.intsh.err %s -# CHECK-INTSH-OUT: TIMEOUT: per_test_timeout :: infinite_loop.py +# CHECK-INTSH-OUT: TIMEOUT: {{.*/shtest-timeout/infinite_loop.py}} # CHECK-INTSH-OUT: command output: # CHECK-INTSH-OUT-NEXT: Running infinite loop # CHECK-INTSH-OUT: command reached timeout: True -# CHECK-INTSH-OUT: TIMEOUT: per_test_timeout :: quick_then_slow.py +# CHECK-INTSH-OUT: TIMEOUT: {{.*/shtest-timeout/quick_then_slow.py}} # CHECK-INTSH-OUT: Timeout: Reached timeout of 1 seconds # CHECK-INTSH-OUT: Command Output # CHECK-INTSH-OUT: command output: @@ -38,7 +38,7 @@ # CHECK-INTSH-OUT-NEXT: Running in slow mode # CHECK-INTSH-OUT: command reached timeout: True -# CHECK-INTSH-OUT: TIMEOUT: per_test_timeout :: slow.py +# CHECK-INTSH-OUT: TIMEOUT: {{.*/shtest-timeout/slow.py}} # CHECK-INTSH-OUT: command output: # CHECK-INTSH-OUT-NEXT: Running slow program # CHECK-INTSH-OUT: command reached timeout: True @@ -58,20 +58,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 @@ -93,20 +93,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/unittest-adaptor.py =================================================================== --- utils/lit/tests/unittest-adaptor.py +++ utils/lit/tests/unittest-adaptor.py @@ -3,8 +3,8 @@ # RUN: %{python} %s %{inputs}/unittest-adaptor 2> %t.err # RUN: FileCheck < %t.err %s # -# CHECK-DAG: unittest-adaptor :: test-two.txt ... FAIL -# CHECK-DAG: unittest-adaptor :: test-one.txt ... ok +# CHECK-DAG: unittest-adaptor/test-two.txt ... FAIL +# CHECK-DAG: unittest-adaptor/test-one.txt ... ok import unittest import sys 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: