llvm.org GIT mirror llvm / f2c2b20
lit: Add a test for discovery w/ test_exec_root (out-of-tree test root). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179401 91177308-0d34-0410-b5e6-96231b3b80d8 Daniel Dunbar 6 years ago
3 changed file(s) with 60 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
0 config.name = 'top-level-suite'
11 config.suffixes = ['.txt']
22 config.test_format = lit.formats.ShTest()
3 config.test_source_root = None
4 config.test_exec_root = None
3
4 # We intentionally don't set the source root or exec root directories here,
5 # because this suite gets reused for testing the exec root behavior (in
6 # ../exec-discovery).
7 #
8 #config.test_source_root = None
9 #config.test_exec_root = None
0 # Load the discovery suite, but with a separate exec root.
1 import os
2 config.test_exec_root = os.path.dirname(__file__)
3 config.test_source_root = os.path.join(os.path.dirname(config.test_exec_root), "discovery")
4 lit.load_config(config, os.path.join(config.test_source_root, "lit.cfg"))
44 # RUN: FileCheck --check-prefix=CHECK-BASIC-OUT < %t.out %s
55 # RUN: FileCheck --check-prefix=CHECK-BASIC-ERR < %t.err %s
66 #
7 # CHECK-BASIC-ERR: loading suite config '{{.*}}/tests/Inputs/discovery/lit.cfg'
8 # CHECK-BASIC-ERR: loading local config '{{.*}}/tests/Inputs/discovery/subdir/lit.local.cfg'
9 # CHECK-BASIC-ERR: loading suite config '{{.*}}/tests/Inputs/discovery/subsuite/lit.cfg'
7 # CHECK-BASIC-ERR: loading suite config '{{.*}}/discovery/lit.cfg'
8 # CHECK-BASIC-ERR: loading local config '{{.*}}/discovery/subdir/lit.local.cfg'
9 # CHECK-BASIC-ERR: loading suite config '{{.*}}/discovery/subsuite/lit.cfg'
1010 #
1111 # CHECK-BASIC-OUT: -- Test Suites --
1212 # CHECK-BASIC-OUT: sub-suite - 2 tests
13 # CHECK-BASIC-OUT: Source Root:
14 # CHECK-BASIC-OUT: Exec Root :
13 # CHECK-BASIC-OUT: Source Root: {{.*/discovery/subsuite$}}
14 # CHECK-BASIC-OUT: Exec Root : {{.*/discovery/subsuite$}}
1515 # CHECK-BASIC-OUT: top-level-suite - 3 tests
16 # CHECK-BASIC-OUT: Source Root:
17 # CHECK-BASIC-OUT: Exec Root :
16 # CHECK-BASIC-OUT: Source Root: {{.*/discovery$}}
17 # CHECK-BASIC-OUT: Exec Root : {{.*/discovery$}}
1818 #
1919 # CHECK-BASIC-OUT: -- Testing: 5 tests, 1 threads --
2020 # CHECK-BASIC-OUT: PASS: sub-suite :: test-one
3737 # CHECK-EXACT-TEST: PASS: top-level-suite :: subdir/test-three
3838
3939
40 # Check discovery when using an exec path.
41 #
42 # RUN: %{lit} %{inputs}/exec-discovery \
43 # RUN: -j 1 --debug --no-execute --show-suites -v > %t.out 2> %t.err
44 # RUN: FileCheck --check-prefix=CHECK-ASEXEC-OUT < %t.out %s
45 # RUN: FileCheck --check-prefix=CHECK-ASEXEC-ERR < %t.err %s
46 #
47 # CHECK-ASEXEC-ERR: loading suite config '{{.*}}/exec-discovery/lit.site.cfg'
48 # CHECK-ASEXEC-ERR: load_config from '{{.*}}/discovery/lit.cfg'
49 # CHECK-ASEXEC-ERR: loaded config '{{.*}}/discovery/lit.cfg'
50 # CHECK-ASEXEC-ERR: loaded config '{{.*}}/exec-discovery/lit.site.cfg'
51 # CHECK-ASEXEC-ERR: loading local config '{{.*}}/discovery/subdir/lit.local.cfg'
52 # CHECK-ASEXEC-ERR: loading suite config '{{.*}}/discovery/subsuite/lit.cfg'
53 #
54 # CHECK-ASEXEC-OUT: -- Test Suites --
55 # CHECK-ASEXEC-OUT: sub-suite - 2 tests
56 # CHECK-ASEXEC-OUT: Source Root: {{.*/discovery/subsuite$}}
57 # CHECK-ASEXEC-OUT: Exec Root : {{.*/discovery/subsuite$}}
58 # CHECK-ASEXEC-OUT: top-level-suite - 3 tests
59 # CHECK-ASEXEC-OUT: Source Root: {{.*/discovery$}}
60 # CHECK-ASEXEC-OUT: Exec Root : {{.*/exec-discovery$}}
61 #
62 # CHECK-ASEXEC-OUT: -- Testing: 5 tests, 1 threads --
63 # CHECK-ASEXEC-OUT: PASS: sub-suite :: test-one
64 # CHECK-ASEXEC-OUT: PASS: sub-suite :: test-two
65 # CHECK-ASEXEC-OUT: PASS: top-level-suite :: subdir/test-three
66 # CHECK-ASEXEC-OUT: PASS: top-level-suite :: test-one
67 # CHECK-ASEXEC-OUT: PASS: top-level-suite :: test-two
68
69
70 # Check discovery when exact test names are given.
71 #
72 # FIXME: Note that using a path into a subsuite doesn't work correctly here.
73 #
74 # RUN: %{lit} \
75 # RUN: %{inputs}/exec-discovery/subdir/test-three.py \
76 # RUN: -j 1 --no-execute --show-suites -v > %t.out
77 # RUN: FileCheck --check-prefix=CHECK-ASEXEC-EXACT-TEST < %t.out %s
78 #
79 # CHECK-ASEXEC-EXACT-TEST: -- Testing: 1 tests, 1 threads --
80 # CHECK-ASEXEC-EXACT-TEST: PASS: top-level-suite :: subdir/test-three