• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Check the basic discovery process, including a sub-suite.
2#
3# RUN: %{lit} %{inputs}/discovery \
4# RUN:   -j 1 --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
8#
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}}'
12#
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#
21# CHECK-BASIC-OUT: -- Available Tests --
22# CHECK-BASIC-OUT: sub-suite :: test-one
23# CHECK-BASIC-OUT: sub-suite :: test-two
24# CHECK-BASIC-OUT: top-level-suite :: subdir/test-three
25# CHECK-BASIC-OUT: top-level-suite :: test-one
26# CHECK-BASIC-OUT: top-level-suite :: test-two
27
28# Check discovery when providing the special builtin 'config_map'
29# RUN: %{python} %{inputs}/config-map-discovery/driver.py \
30# RUN:           %{inputs}/config-map-discovery/main-config/lit.cfg \
31# RUN:           %{inputs}/config-map-discovery/lit.alt.cfg \
32# RUN:           --single-process --debug --show-tests --show-suites > %t.out 2> %t.err
33# RUN: FileCheck --check-prefix=CHECK-CONFIG-MAP-OUT < %t.out %s
34# RUN: FileCheck --check-prefix=CHECK-CONFIG-MAP-ERR < %t.err %s
35
36# CHECK-CONFIG-MAP-OUT-NOT: ERROR: lit.cfg invoked
37# CHECK-CONFIG-MAP-OUT: -- Test Suites --
38# CHECK-CONFIG-MAP-OUT:   config-map - 2 tests
39# CHECK-CONFIG-MAP-OUT:     Source Root: {{.*[/\\]config-map-discovery[/\\]tests}}
40# CHECK-CONFIG-MAP-OUT:     Exec Root  : {{.*[/\\]tests[/\\]Inputs[/\\]config-map-discovery}}
41# CHECK-CONFIG-MAP-OUT: -- Available Tests --
42# CHECK-CONFIG-MAP-OUT-NOT: invalid-test.txt
43# CHECK-CONFIG-MAP-OUT:   config-map :: test1.txt
44# CHECK-CONFIG-MAP-OUT:   config-map :: test2.txt
45
46# CHECK-CONFIG-MAP-ERR: loading suite config '{{.*}}lit.alt.cfg'
47# CHECK-CONFIG-MAP-ERR: loaded config '{{.*}}lit.alt.cfg'
48# CHECK-CONFIG-MAP-ERR: resolved input '{{.*(/|\\\\)config-map-discovery(/|\\\\)main-config}}' to 'config-map'::()
49
50
51# Check discovery when exact test names are given.
52#
53# RUN: %{lit} \
54# RUN:     %{inputs}/discovery/subdir/test-three.py \
55# RUN:     %{inputs}/discovery/subsuite/test-one.txt \
56# RUN:   -j 1 --show-tests --show-suites -v > %t.out
57# RUN: FileCheck --check-prefix=CHECK-EXACT-TEST < %t.out %s
58#
59# CHECK-EXACT-TEST: -- Available Tests --
60# CHECK-EXACT-TEST: sub-suite :: test-one
61# CHECK-EXACT-TEST: top-level-suite :: subdir/test-three
62
63# Check discovery when config files end in .py
64# RUN: %{lit} %{inputs}/py-config-discovery \
65# RUN:   -j 1 --debug --show-tests --show-suites \
66# RUN:   -v > %t.out 2> %t.err
67# RUN: FileCheck --check-prefix=CHECK-PYCONFIG-OUT < %t.out %s
68# RUN: FileCheck --check-prefix=CHECK-PYCONFIG-ERR < %t.err %s
69#
70# CHECK-PYCONFIG-ERR: loading suite config '{{.*(/|\\\\)py-config-discovery(/|\\\\)lit.site.cfg.py}}'
71# CHECK-PYCONFIG-ERR: load_config from '{{.*(/|\\\\)discovery(/|\\\\)lit.cfg}}'
72# CHECK-PYCONFIG-ERR: loaded config '{{.*(/|\\\\)discovery(/|\\\\)lit.cfg}}'
73# CHECK-PYCONFIG-ERR: loaded config '{{.*(/|\\\\)py-config-discovery(/|\\\\)lit.site.cfg.py}}'
74# CHECK-PYCONFIG-ERR-DAG: loading suite config '{{.*(/|\\\\)discovery(/|\\\\)subsuite(/|\\\\)lit.cfg}}'
75# CHECK-PYCONFIG-ERR-DAG: loading local config '{{.*(/|\\\\)discovery(/|\\\\)subdir(/|\\\\)lit.local.cfg}}'
76#
77# CHECK-PYCONFIG-OUT: -- Test Suites --
78# CHECK-PYCONFIG-OUT:   sub-suite - 2 tests
79# CHECK-PYCONFIG-OUT:     Source Root: {{.*[/\\]discovery[/\\]subsuite$}}
80# CHECK-PYCONFIG-OUT:     Exec Root  : {{.*[/\\]discovery[/\\]subsuite$}}
81# CHECK-PYCONFIG-OUT:   top-level-suite - 3 tests
82# CHECK-PYCONFIG-OUT:     Source Root: {{.*[/\\]discovery$}}
83# CHECK-PYCONFIG-OUT:     Exec Root  : {{.*[/\\]py-config-discovery$}}
84#
85# CHECK-PYCONFIG-OUT: -- Available Tests --
86# CHECK-PYCONFIG-OUT: sub-suite :: test-one
87# CHECK-PYCONFIG-OUT: sub-suite :: test-two
88# CHECK-PYCONFIG-OUT: top-level-suite :: subdir/test-three
89# CHECK-PYCONFIG-OUT: top-level-suite :: test-one
90# CHECK-PYCONFIG-OUT: top-level-suite :: test-two
91
92# Check discovery when using an exec path.
93#
94# RUN: %{lit} %{inputs}/exec-discovery \
95# RUN:   -j 1 --debug --show-tests --show-suites \
96# RUN:   -v > %t.out 2> %t.err
97# RUN: FileCheck --check-prefix=CHECK-ASEXEC-OUT < %t.out %s
98# RUN: FileCheck --check-prefix=CHECK-ASEXEC-ERR < %t.err %s
99#
100# CHECK-ASEXEC-ERR: loading suite config '{{.*(/|\\\\)exec-discovery(/|\\\\)lit.site.cfg}}'
101# CHECK-ASEXEC-ERR: load_config from '{{.*(/|\\\\)discovery(/|\\\\)lit.cfg}}'
102# CHECK-ASEXEC-ERR: loaded config '{{.*(/|\\\\)discovery(/|\\\\)lit.cfg}}'
103# CHECK-ASEXEC-ERR: loaded config '{{.*(/|\\\\)exec-discovery(/|\\\\)lit.site.cfg}}'
104# CHECK-ASEXEC-ERR-DAG: loading suite config '{{.*(/|\\\\)discovery(/|\\\\)subsuite(/|\\\\)lit.cfg}}'
105# CHECK-ASEXEC-ERR-DAG: loading local config '{{.*(/|\\\\)discovery(/|\\\\)subdir(/|\\\\)lit.local.cfg}}'
106#
107# CHECK-ASEXEC-OUT: -- Test Suites --
108# CHECK-ASEXEC-OUT:   sub-suite - 2 tests
109# CHECK-ASEXEC-OUT:     Source Root: {{.*[/\\]discovery[/\\]subsuite$}}
110# CHECK-ASEXEC-OUT:     Exec Root  : {{.*[/\\]discovery[/\\]subsuite$}}
111# CHECK-ASEXEC-OUT:   top-level-suite - 3 tests
112# CHECK-ASEXEC-OUT:     Source Root: {{.*[/\\]discovery$}}
113# CHECK-ASEXEC-OUT:     Exec Root  : {{.*[/\\]exec-discovery$}}
114#
115# CHECK-ASEXEC-OUT: -- Available Tests --
116# CHECK-ASEXEC-OUT: sub-suite :: test-one
117# CHECK-ASEXEC-OUT: sub-suite :: test-two
118# CHECK-ASEXEC-OUT: top-level-suite :: subdir/test-three
119# CHECK-ASEXEC-OUT: top-level-suite :: test-one
120# CHECK-ASEXEC-OUT: top-level-suite :: test-two
121
122# Check discovery when exact test names are given.
123#
124# FIXME: Note that using a path into a subsuite doesn't work correctly here.
125#
126# RUN: %{lit} \
127# RUN:     %{inputs}/exec-discovery/subdir/test-three.py \
128# RUN:   -j 1 --show-tests --show-suites -v > %t.out
129# RUN: FileCheck --check-prefix=CHECK-ASEXEC-EXACT-TEST < %t.out %s
130#
131# CHECK-ASEXEC-EXACT-TEST: -- Available Tests --
132# CHECK-ASEXEC-EXACT-TEST: top-level-suite :: subdir/test-three
133
134
135# Check that we don't recurse infinitely when loading an site specific test
136# suite located inside the test source root.
137#
138# RUN: %{lit} \
139# RUN:     %{inputs}/exec-discovery-in-tree/obj/ \
140# RUN:   -j 1 --show-tests --show-suites -v > %t.out
141# RUN: FileCheck --check-prefix=CHECK-ASEXEC-INTREE < %t.out %s
142#
143# Try it again after cd'ing into the test suite using a short relative path.
144#
145# RUN: cd %{inputs}/exec-discovery-in-tree/obj/
146# RUN: %{lit} . \
147# RUN:   -j 1 --show-tests --show-suites -v > %t.out
148# RUN: FileCheck --check-prefix=CHECK-ASEXEC-INTREE < %t.out %s
149#
150#      CHECK-ASEXEC-INTREE:   exec-discovery-in-tree-suite - 1 tests
151# CHECK-ASEXEC-INTREE-NEXT:     Source Root: {{.*[/\\]exec-discovery-in-tree$}}
152# CHECK-ASEXEC-INTREE-NEXT:     Exec Root  : {{.*[/\\]exec-discovery-in-tree[/\\]obj$}}
153# CHECK-ASEXEC-INTREE-NEXT: -- Available Tests --
154# CHECK-ASEXEC-INTREE-NEXT: exec-discovery-in-tree-suite :: test-one
155