lit: Add a test for discovery w/ test_exec_root (out-of-tree test root).
[oota-llvm.git] / utils / lit / tests / discovery.py
1 # Check the basic discovery process, including a sub-suite.
2 #
3 # RUN: %{lit} %{inputs}/discovery \
4 # RUN:   -j 1 --debug --no-execute --show-suites -v > %t.out 2> %t.err
5 # RUN: FileCheck --check-prefix=CHECK-BASIC-OUT < %t.out %s
6 # RUN: FileCheck --check-prefix=CHECK-BASIC-ERR < %t.err %s
7 #
8 # CHECK-BASIC-ERR: loading suite config '{{.*}}/discovery/lit.cfg'
9 # CHECK-BASIC-ERR: loading local config '{{.*}}/discovery/subdir/lit.local.cfg'
10 # CHECK-BASIC-ERR: loading suite config '{{.*}}/discovery/subsuite/lit.cfg'
11 #
12 # CHECK-BASIC-OUT: -- Test Suites --
13 # CHECK-BASIC-OUT:   sub-suite - 2 tests
14 # CHECK-BASIC-OUT:     Source Root: {{.*/discovery/subsuite$}}
15 # CHECK-BASIC-OUT:     Exec Root  : {{.*/discovery/subsuite$}}
16 # CHECK-BASIC-OUT:   top-level-suite - 3 tests
17 # CHECK-BASIC-OUT:     Source Root: {{.*/discovery$}}
18 # CHECK-BASIC-OUT:     Exec Root  : {{.*/discovery$}}
19 #
20 # CHECK-BASIC-OUT: -- Testing: 5 tests, 1 threads --
21 # CHECK-BASIC-OUT: PASS: sub-suite :: test-one
22 # CHECK-BASIC-OUT: PASS: sub-suite :: test-two
23 # CHECK-BASIC-OUT: PASS: top-level-suite :: subdir/test-three
24 # CHECK-BASIC-OUT: PASS: top-level-suite :: test-one
25 # CHECK-BASIC-OUT: PASS: top-level-suite :: test-two
26
27
28 # Check discovery when exact test names are given.
29 #
30 # RUN: %{lit} \
31 # RUN:     %{inputs}/discovery/subdir/test-three.py \
32 # RUN:     %{inputs}/discovery/subsuite/test-one.txt \
33 # RUN:   -j 1 --no-execute --show-suites -v > %t.out
34 # RUN: FileCheck --check-prefix=CHECK-EXACT-TEST < %t.out %s
35 #
36 # CHECK-EXACT-TEST: -- Testing: 2 tests, 1 threads --
37 # CHECK-EXACT-TEST: PASS: sub-suite :: test-one
38 # CHECK-EXACT-TEST: PASS: top-level-suite :: subdir/test-three
39
40
41 # Check discovery when using an exec path.
42 #
43 # RUN: %{lit} %{inputs}/exec-discovery \
44 # RUN:   -j 1 --debug --no-execute --show-suites -v > %t.out 2> %t.err
45 # RUN: FileCheck --check-prefix=CHECK-ASEXEC-OUT < %t.out %s
46 # RUN: FileCheck --check-prefix=CHECK-ASEXEC-ERR < %t.err %s
47 #
48 # CHECK-ASEXEC-ERR: loading suite config '{{.*}}/exec-discovery/lit.site.cfg'
49 # CHECK-ASEXEC-ERR: load_config from '{{.*}}/discovery/lit.cfg'
50 # CHECK-ASEXEC-ERR: loaded config '{{.*}}/discovery/lit.cfg'
51 # CHECK-ASEXEC-ERR: loaded config '{{.*}}/exec-discovery/lit.site.cfg'
52 # CHECK-ASEXEC-ERR: loading local config '{{.*}}/discovery/subdir/lit.local.cfg'
53 # CHECK-ASEXEC-ERR: loading suite config '{{.*}}/discovery/subsuite/lit.cfg'
54 #
55 # CHECK-ASEXEC-OUT: -- Test Suites --
56 # CHECK-ASEXEC-OUT:   sub-suite - 2 tests
57 # CHECK-ASEXEC-OUT:     Source Root: {{.*/discovery/subsuite$}}
58 # CHECK-ASEXEC-OUT:     Exec Root  : {{.*/discovery/subsuite$}}
59 # CHECK-ASEXEC-OUT:   top-level-suite - 3 tests
60 # CHECK-ASEXEC-OUT:     Source Root: {{.*/discovery$}}
61 # CHECK-ASEXEC-OUT:     Exec Root  : {{.*/exec-discovery$}}
62 #
63 # CHECK-ASEXEC-OUT: -- Testing: 5 tests, 1 threads --
64 # CHECK-ASEXEC-OUT: PASS: sub-suite :: test-one
65 # CHECK-ASEXEC-OUT: PASS: sub-suite :: test-two
66 # CHECK-ASEXEC-OUT: PASS: top-level-suite :: subdir/test-three
67 # CHECK-ASEXEC-OUT: PASS: top-level-suite :: test-one
68 # CHECK-ASEXEC-OUT: PASS: top-level-suite :: test-two
69
70
71 # Check discovery when exact test names are given.
72 #
73 # FIXME: Note that using a path into a subsuite doesn't work correctly here.
74 #
75 # RUN: %{lit} \
76 # RUN:     %{inputs}/exec-discovery/subdir/test-three.py \
77 # RUN:   -j 1 --no-execute --show-suites -v > %t.out
78 # RUN: FileCheck --check-prefix=CHECK-ASEXEC-EXACT-TEST < %t.out %s
79 #
80 # CHECK-ASEXEC-EXACT-TEST: -- Testing: 1 tests, 1 threads --
81 # CHECK-ASEXEC-EXACT-TEST: PASS: top-level-suite :: subdir/test-three