[llvm] r179401 - lit: Add a test for discovery w/ test_exec_root (out-of-tree test root).

Daniel Dunbar daniel at zuster.org
Fri Apr 12 12:08:57 PDT 2013


Author: ddunbar
Date: Fri Apr 12 14:08:57 2013
New Revision: 179401

URL: http://llvm.org/viewvc/llvm-project?rev=179401&view=rev
Log:
lit: Add a test for discovery w/ test_exec_root (out-of-tree test root).

Added:
    llvm/trunk/utils/lit/tests/Inputs/exec-discovery/
    llvm/trunk/utils/lit/tests/Inputs/exec-discovery/lit.site.cfg
Modified:
    llvm/trunk/utils/lit/tests/Inputs/discovery/lit.cfg
    llvm/trunk/utils/lit/tests/discovery.py

Modified: llvm/trunk/utils/lit/tests/Inputs/discovery/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/tests/Inputs/discovery/lit.cfg?rev=179401&r1=179400&r2=179401&view=diff
==============================================================================
--- llvm/trunk/utils/lit/tests/Inputs/discovery/lit.cfg (original)
+++ llvm/trunk/utils/lit/tests/Inputs/discovery/lit.cfg Fri Apr 12 14:08:57 2013
@@ -1,5 +1,10 @@
 config.name = 'top-level-suite'
 config.suffixes = ['.txt']
 config.test_format = lit.formats.ShTest()
-config.test_source_root = None
-config.test_exec_root = None
+
+# We intentionally don't set the source root or exec root directories here,
+# because this suite gets reused for testing the exec root behavior (in
+# ../exec-discovery).
+#
+#config.test_source_root = None
+#config.test_exec_root = None

Added: llvm/trunk/utils/lit/tests/Inputs/exec-discovery/lit.site.cfg
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/tests/Inputs/exec-discovery/lit.site.cfg?rev=179401&view=auto
==============================================================================
--- llvm/trunk/utils/lit/tests/Inputs/exec-discovery/lit.site.cfg (added)
+++ llvm/trunk/utils/lit/tests/Inputs/exec-discovery/lit.site.cfg Fri Apr 12 14:08:57 2013
@@ -0,0 +1,5 @@
+# Load the discovery suite, but with a separate exec root.
+import os
+config.test_exec_root = os.path.dirname(__file__)
+config.test_source_root = os.path.join(os.path.dirname(config.test_exec_root), "discovery")
+lit.load_config(config, os.path.join(config.test_source_root, "lit.cfg"))

Modified: llvm/trunk/utils/lit/tests/discovery.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/tests/discovery.py?rev=179401&r1=179400&r2=179401&view=diff
==============================================================================
--- llvm/trunk/utils/lit/tests/discovery.py (original)
+++ llvm/trunk/utils/lit/tests/discovery.py Fri Apr 12 14:08:57 2013
@@ -5,17 +5,17 @@
 # RUN: FileCheck --check-prefix=CHECK-BASIC-OUT < %t.out %s
 # RUN: FileCheck --check-prefix=CHECK-BASIC-ERR < %t.err %s
 #
-# CHECK-BASIC-ERR: loading suite config '{{.*}}/tests/Inputs/discovery/lit.cfg'
-# CHECK-BASIC-ERR: loading local config '{{.*}}/tests/Inputs/discovery/subdir/lit.local.cfg'
-# CHECK-BASIC-ERR: loading suite config '{{.*}}/tests/Inputs/discovery/subsuite/lit.cfg'
+# CHECK-BASIC-ERR: loading suite config '{{.*}}/discovery/lit.cfg'
+# CHECK-BASIC-ERR: loading local config '{{.*}}/discovery/subdir/lit.local.cfg'
+# CHECK-BASIC-ERR: loading suite config '{{.*}}/discovery/subsuite/lit.cfg'
 #
 # CHECK-BASIC-OUT: -- Test Suites --
 # CHECK-BASIC-OUT:   sub-suite - 2 tests
-# CHECK-BASIC-OUT:     Source Root:
-# CHECK-BASIC-OUT:     Exec Root  :
+# 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:     Source Root:
-# CHECK-BASIC-OUT:     Exec Root  :
+# CHECK-BASIC-OUT:     Source Root: {{.*/discovery$}}
+# CHECK-BASIC-OUT:     Exec Root  : {{.*/discovery$}}
 #
 # CHECK-BASIC-OUT: -- Testing: 5 tests, 1 threads --
 # CHECK-BASIC-OUT: PASS: sub-suite :: test-one
@@ -38,3 +38,44 @@
 # CHECK-EXACT-TEST: PASS: top-level-suite :: subdir/test-three
 
 
+# Check discovery when using an exec path.
+#
+# RUN: %{lit} %{inputs}/exec-discovery \
+# RUN:   -j 1 --debug --no-execute --show-suites -v > %t.out 2> %t.err
+# RUN: FileCheck --check-prefix=CHECK-ASEXEC-OUT < %t.out %s
+# RUN: FileCheck --check-prefix=CHECK-ASEXEC-ERR < %t.err %s
+#
+# CHECK-ASEXEC-ERR: loading suite config '{{.*}}/exec-discovery/lit.site.cfg'
+# CHECK-ASEXEC-ERR: load_config from '{{.*}}/discovery/lit.cfg'
+# CHECK-ASEXEC-ERR: loaded config '{{.*}}/discovery/lit.cfg'
+# CHECK-ASEXEC-ERR: loaded config '{{.*}}/exec-discovery/lit.site.cfg'
+# CHECK-ASEXEC-ERR: loading local config '{{.*}}/discovery/subdir/lit.local.cfg'
+# CHECK-ASEXEC-ERR: loading suite config '{{.*}}/discovery/subsuite/lit.cfg'
+#
+# CHECK-ASEXEC-OUT: -- Test Suites --
+# CHECK-ASEXEC-OUT:   sub-suite - 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:     Source Root: {{.*/discovery$}}
+# CHECK-ASEXEC-OUT:     Exec Root  : {{.*/exec-discovery$}}
+#
+# CHECK-ASEXEC-OUT: -- Testing: 5 tests, 1 threads --
+# CHECK-ASEXEC-OUT: PASS: sub-suite :: test-one
+# CHECK-ASEXEC-OUT: PASS: sub-suite :: test-two
+# CHECK-ASEXEC-OUT: PASS: top-level-suite :: subdir/test-three
+# CHECK-ASEXEC-OUT: PASS: top-level-suite :: test-one
+# CHECK-ASEXEC-OUT: PASS: top-level-suite :: test-two
+
+
+# Check discovery when exact test names are given.
+#
+# FIXME: Note that using a path into a subsuite doesn't work correctly here.
+#
+# RUN: %{lit} \
+# RUN:     %{inputs}/exec-discovery/subdir/test-three.py \
+# RUN:   -j 1 --no-execute --show-suites -v > %t.out
+# RUN: FileCheck --check-prefix=CHECK-ASEXEC-EXACT-TEST < %t.out %s
+#
+# CHECK-ASEXEC-EXACT-TEST: -- Testing: 1 tests, 1 threads --
+# CHECK-ASEXEC-EXACT-TEST: PASS: top-level-suite :: subdir/test-three





More information about the llvm-commits mailing list