1 # Check the basic discovery process, including a sub-suite.
3 # RUN: %{lit} %{inputs}/discovery \
4 # RUN: --debug --show-tests --show-suites \
5 # RUN: -v > %t.out 2> %t.err
6 # RUN: FileCheck --check-prefix=CHECK-BASIC-OUT < %t.out %s
7 # RUN: FileCheck --check-prefix=CHECK-BASIC-ERR < %t.err %s
9 # CHECK-BASIC-ERR: loading suite config '{{.*(/|\\\\)discovery(/|\\\\)lit.cfg}}'
10 # CHECK-BASIC-ERR-DAG: loading suite config '{{.*(/|\\\\)discovery(/|\\\\)subsuite(/|\\\\)lit.cfg}}'
11 # CHECK-BASIC-ERR-DAG: loading local config '{{.*(/|\\\\)discovery(/|\\\\)subdir(/|\\\\)lit.local.cfg}}'
13 # CHECK-BASIC-OUT: -- Test Suites --
14 # CHECK-BASIC-OUT: sub-suite - 2 tests
15 # CHECK-BASIC-OUT: Source Root: {{.*[/\\]discovery[/\\]subsuite$}}
16 # CHECK-BASIC-OUT: Exec Root : {{.*[/\\]discovery[/\\]subsuite$}}
17 # CHECK-BASIC-OUT: top-level-suite - 3 tests
18 # CHECK-BASIC-OUT: Source Root: {{.*[/\\]discovery$}}
19 # CHECK-BASIC-OUT: Exec Root : {{.*[/\\]discovery$}}
20 # CHECK-BASIC-OUT: Available Features: feature1 feature2
21 # CHECK-BASIC-OUT: Available Substitutions: %key1 => value1
22 # CHECK-BASIC-OUT: %key2 => value2
24 # CHECK-BASIC-OUT: -- Available Tests --
25 # CHECK-BASIC-OUT: sub-suite :: test-one
26 # CHECK-BASIC-OUT: sub-suite :: test-two
27 # CHECK-BASIC-OUT: top-level-suite :: subdir/test-three
28 # CHECK-BASIC-OUT: top-level-suite :: test-one
29 # CHECK-BASIC-OUT: top-level-suite :: test-two
31 # Check discovery when providing the special builtin 'config_map'
32 # RUN: %{python} %{inputs}/config-map-discovery/driver.py \
33 # RUN: %{inputs}/config-map-discovery/main-config/lit.cfg \
34 # RUN: %{inputs}/config-map-discovery/lit.alt.cfg \
35 # RUN: --workers=1 --debug --show-tests --show-suites > %t.out 2> %t.err
36 # RUN: FileCheck --check-prefix=CHECK-CONFIG-MAP-OUT < %t.out %s
37 # RUN: FileCheck --check-prefix=CHECK-CONFIG-MAP-ERR < %t.err %s
39 # CHECK-CONFIG-MAP-OUT-NOT: ERROR: lit.cfg invoked
40 # CHECK-CONFIG-MAP-OUT: -- Test Suites --
41 # CHECK-CONFIG-MAP-OUT: config-map - 2 tests
42 # CHECK-CONFIG-MAP-OUT: Source Root: {{.*[/\\]config-map-discovery[/\\]tests}}
43 # CHECK-CONFIG-MAP-OUT: Exec Root : {{.*[/\\]tests[/\\]Inputs[/\\]config-map-discovery}}
44 # CHECK-CONFIG-MAP-OUT: -- Available Tests --
45 # CHECK-CONFIG-MAP-OUT-NOT: invalid-test.txt
46 # CHECK-CONFIG-MAP-OUT: config-map :: test1.txt
47 # CHECK-CONFIG-MAP-OUT: config-map :: test2.txt
49 # CHECK-CONFIG-MAP-ERR: loading suite config '{{.*}}lit.alt.cfg'
50 # CHECK-CONFIG-MAP-ERR: loaded config '{{.*}}lit.alt.cfg'
51 # CHECK-CONFIG-MAP-ERR: resolved input '{{.*(/|\\\\)config-map-discovery(/|\\\\)main-config}}' to 'config-map'::()
54 # Check discovery when tests are named directly.
57 # RUN: %{inputs}/discovery/subdir/test-three.py \
58 # RUN: %{inputs}/discovery/subsuite/test-one.txt \
59 # RUN: --show-tests --show-suites -v > %t.out
60 # RUN: FileCheck --check-prefix=CHECK-DIRECT-TEST < %t.out %s
62 # CHECK-DIRECT-TEST: -- Available Tests --
63 # CHECK-DIRECT-TEST: sub-suite :: test-one
64 # CHECK-DIRECT-TEST: top-level-suite :: subdir/test-three
66 # Check discovery when config files end in .py
67 # RUN: %{lit} %{inputs}/py-config-discovery \
68 # RUN: --debug --show-tests --show-suites \
69 # RUN: -v > %t.out 2> %t.err
70 # RUN: FileCheck --check-prefix=CHECK-PYCONFIG-OUT < %t.out %s
71 # RUN: FileCheck --check-prefix=CHECK-PYCONFIG-ERR < %t.err %s
73 # CHECK-PYCONFIG-ERR: loading suite config '{{.*(/|\\\\)py-config-discovery(/|\\\\)lit.site.cfg.py}}'
74 # CHECK-PYCONFIG-ERR: load_config from '{{.*(/|\\\\)discovery(/|\\\\)lit.cfg}}'
75 # CHECK-PYCONFIG-ERR: loaded config '{{.*(/|\\\\)discovery(/|\\\\)lit.cfg}}'
76 # CHECK-PYCONFIG-ERR: loaded config '{{.*(/|\\\\)py-config-discovery(/|\\\\)lit.site.cfg.py}}'
77 # CHECK-PYCONFIG-ERR-DAG: loading suite config '{{.*(/|\\\\)discovery(/|\\\\)subsuite(/|\\\\)lit.cfg}}'
78 # CHECK-PYCONFIG-ERR-DAG: loading local config '{{.*(/|\\\\)discovery(/|\\\\)subdir(/|\\\\)lit.local.cfg}}'
80 # CHECK-PYCONFIG-OUT: -- Test Suites --
81 # CHECK-PYCONFIG-OUT: sub-suite - 2 tests
82 # CHECK-PYCONFIG-OUT: Source Root: {{.*[/\\]discovery[/\\]subsuite$}}
83 # CHECK-PYCONFIG-OUT: Exec Root : {{.*[/\\]discovery[/\\]subsuite$}}
84 # CHECK-PYCONFIG-OUT: top-level-suite - 3 tests
85 # CHECK-PYCONFIG-OUT: Source Root: {{.*[/\\]discovery$}}
86 # CHECK-PYCONFIG-OUT: Exec Root : {{.*[/\\]py-config-discovery$}}
88 # CHECK-PYCONFIG-OUT: -- Available Tests --
89 # CHECK-PYCONFIG-OUT: sub-suite :: test-one
90 # CHECK-PYCONFIG-OUT: sub-suite :: test-two
91 # CHECK-PYCONFIG-OUT: top-level-suite :: subdir/test-three
92 # CHECK-PYCONFIG-OUT: top-level-suite :: test-one
93 # CHECK-PYCONFIG-OUT: top-level-suite :: test-two
95 # Check discovery when using an exec path.
97 # RUN: %{lit} %{inputs}/exec-discovery \
98 # RUN: --debug --show-tests --show-suites \
99 # RUN: -v > %t.out 2> %t.err
100 # RUN: FileCheck --check-prefix=CHECK-ASEXEC-OUT < %t.out %s
101 # RUN: FileCheck --check-prefix=CHECK-ASEXEC-ERR < %t.err %s
103 # CHECK-ASEXEC-ERR: loading suite config '{{.*(/|\\\\)exec-discovery(/|\\\\)lit.site.cfg}}'
104 # CHECK-ASEXEC-ERR: load_config from '{{.*(/|\\\\)discovery(/|\\\\)lit.cfg}}'
105 # CHECK-ASEXEC-ERR: loaded config '{{.*(/|\\\\)discovery(/|\\\\)lit.cfg}}'
106 # CHECK-ASEXEC-ERR: loaded config '{{.*(/|\\\\)exec-discovery(/|\\\\)lit.site.cfg}}'
107 # CHECK-ASEXEC-ERR-DAG: loading suite config '{{.*(/|\\\\)discovery(/|\\\\)subsuite(/|\\\\)lit.cfg}}'
108 # CHECK-ASEXEC-ERR-DAG: loading local config '{{.*(/|\\\\)discovery(/|\\\\)subdir(/|\\\\)lit.local.cfg}}'
110 # CHECK-ASEXEC-OUT: -- Test Suites --
111 # CHECK-ASEXEC-OUT: sub-suite - 2 tests
112 # CHECK-ASEXEC-OUT: Source Root: {{.*[/\\]discovery[/\\]subsuite$}}
113 # CHECK-ASEXEC-OUT: Exec Root : {{.*[/\\]discovery[/\\]subsuite$}}
114 # CHECK-ASEXEC-OUT: top-level-suite - 3 tests
115 # CHECK-ASEXEC-OUT: Source Root: {{.*[/\\]discovery$}}
116 # CHECK-ASEXEC-OUT: Exec Root : {{.*[/\\]exec-discovery$}}
118 # CHECK-ASEXEC-OUT: -- Available Tests --
119 # CHECK-ASEXEC-OUT: sub-suite :: test-one
120 # CHECK-ASEXEC-OUT: sub-suite :: test-two
121 # CHECK-ASEXEC-OUT: top-level-suite :: subdir/test-three
122 # CHECK-ASEXEC-OUT: top-level-suite :: test-one
123 # CHECK-ASEXEC-OUT: top-level-suite :: test-two
125 # Check discovery when tests are named directly.
127 # FIXME: Note that using a path into a subsuite doesn't work correctly here.
130 # RUN: %{inputs}/exec-discovery/subdir/test-three.py \
131 # RUN: --show-tests --show-suites -v > %t.out
132 # RUN: FileCheck --check-prefix=CHECK-ASEXEC-DIRECT-TEST < %t.out %s
134 # CHECK-ASEXEC-DIRECT-TEST: -- Available Tests --
135 # CHECK-ASEXEC-DIRECT-TEST: top-level-suite :: subdir/test-three
137 # Check an error is emitted when the directly named test would not be run
138 # indirectly (e.g. when the directory containing the test is specified).
141 # RUN: %{inputs}/discovery/test.not-txt 2>%t.err
142 # RUN: FileCheck --check-prefix=CHECK-ERROR-INDIRECT-RUN-CHECK < %t.err %s
144 # CHECK-ERROR-INDIRECT-RUN-CHECK: error: 'top-level-suite :: test.not-txt' would not be run indirectly
146 # Check that no error is emitted with --no-indirectly-run-check.
149 # RUN: %{inputs}/discovery/test.not-txt --no-indirectly-run-check
151 # Check that a standalone test with no suffixes set is run without any errors.
153 # RUN: %{lit} %{inputs}/standalone-tests/true.txt > %t.out
154 # RUN: FileCheck --check-prefix=CHECK-STANDALONE < %t.out %s
156 # CHECK-STANDALONE: PASS: Standalone tests :: true.txt
158 # Check that an error is produced if suffixes variable is set for a suite with
161 # RUN: not %{lit} %{inputs}/standalone-tests-with-suffixes 2> %t.err
162 # RUN: FileCheck --check-prefixes=CHECK-STANDALONE-SUFFIXES,CHECK-STANDALONE-DISCOVERY < %t.err %s
164 # CHECK-STANDALONE-SUFFIXES: standalone_tests set {{.*}} but suffixes
166 # Check that an error is produced if excludes variable is set for a suite with
169 # RUN: not %{lit} %{inputs}/standalone-tests-with-excludes 2> %t.err
170 # RUN: FileCheck --check-prefixes=CHECK-STANDALONE-EXCLUDES,CHECK-STANDALONE-DISCOVERY < %t.err %s
172 # CHECK-STANDALONE-EXCLUDES: standalone_tests set {{.*}} but {{.*}} excludes
174 # Check that no discovery is done for testsuite with standalone tests.
176 # RUN: not %{lit} %{inputs}/standalone-tests 2>%t.err
177 # RUN: FileCheck --check-prefix=CHECK-STANDALONE-DISCOVERY < %t.err %s
179 # CHECK-STANDALONE-DISCOVERY: error: did not discover any tests for provided path(s)
181 # Check that we don't recurse infinitely when loading an site specific test
182 # suite located inside the test source root.
185 # RUN: %{inputs}/exec-discovery-in-tree/obj/ \
186 # RUN: --show-tests --show-suites -v > %t.out
187 # RUN: FileCheck --check-prefix=CHECK-ASEXEC-INTREE < %t.out %s
189 # Try it again after cd'ing into the test suite using a short relative path.
191 # RUN: cd %{inputs}/exec-discovery-in-tree/obj/
193 # RUN: --show-tests --show-suites -v > %t.out
194 # RUN: FileCheck --check-prefix=CHECK-ASEXEC-INTREE < %t.out %s
196 # CHECK-ASEXEC-INTREE: exec-discovery-in-tree-suite - 1 tests
197 # CHECK-ASEXEC-INTREE-NEXT: Source Root: {{.*[/\\]exec-discovery-in-tree$}}
198 # CHECK-ASEXEC-INTREE-NEXT: Exec Root : {{.*[/\\]exec-discovery-in-tree[/\\]obj$}}
199 # CHECK-ASEXEC-INTREE-NEXT: Available Features:
200 # CHECK-ASEXEC-INTREE-NEXT: Available Substitutions:
201 # CHECK-ASEXEC-INTREE-NEXT: -- Available Tests --
202 # CHECK-ASEXEC-INTREE-NEXT: exec-discovery-in-tree-suite :: test-one