[LNT] r261851 - [test-suite] Add the ability to pass CMake defines to CMake.

James Molloy via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 25 02:05:00 PST 2016


Author: jamesm
Date: Thu Feb 25 04:05:00 2016
New Revision: 261851

URL: http://llvm.org/viewvc/llvm-project?rev=261851&view=rev
Log:
[test-suite] Add the ability to pass CMake defines to CMake.

While we're here, ensure that we build 'timeit-host' first before anything else. CMake doesn't know that timeit-host is a requirement for building *any other source file*. This kinda works when building at the top level, but when using --only-test things break.

Modified:
    lnt/trunk/lnt/tests/test_suite.py
    lnt/trunk/tests/runtest/test_suite.py

Modified: lnt/trunk/lnt/tests/test_suite.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/tests/test_suite.py?rev=261851&r1=261850&r2=261851&view=diff
==============================================================================
--- lnt/trunk/lnt/tests/test_suite.py (original)
+++ lnt/trunk/lnt/tests/test_suite.py Thu Feb 25 04:05:00 2016
@@ -50,6 +50,9 @@ class TestSuiteTest(BuiltinTest):
         group.add_option("", "--test-externals", dest="test_suite_externals",
                          type=str, metavar="PATH",
                          help="Path to the LLVM test-suite externals")
+        group.add_option("", "--cmake-define", dest="cmake_defines",
+                         action="append",
+                         help="Defines to pass to cmake.")
         parser.add_option_group(group)
                          
         group = OptionGroup(parser, "Test compiler")
@@ -351,6 +354,10 @@ class TestSuiteTest(BuiltinTest):
             defs['TEST_SUITE_BENCHMARKING_ONLY'] = 'ON'
         if self.opts.use_perf:
             defs['TEST_SUITE_USE_PERF'] = 'ON'
+        if self.opts.cmake_defines:
+            for item in self.opts.cmake_defines:
+                k, v = item.split('=', 1)
+                defs[k] = v
             
         lines = ['Configuring with {']
         for k,v in sorted(defs.items()):
@@ -372,6 +379,9 @@ class TestSuiteTest(BuiltinTest):
             subdir = os.path.join(*components)
 
         note('Building...')
+        self._check_call([make_cmd, 'timeit-host',
+                          '-j', str(self._build_threads())],
+                         cwd=path)
         self._check_call([make_cmd,
                           '-j', str(self._build_threads())],
                          cwd=subdir)

Modified: lnt/trunk/tests/runtest/test_suite.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/runtest/test_suite.py?rev=261851&r1=261850&r2=261851&view=diff
==============================================================================
--- lnt/trunk/tests/runtest/test_suite.py (original)
+++ lnt/trunk/tests/runtest/test_suite.py Thu Feb 25 04:05:00 2016
@@ -223,9 +223,16 @@
 # RUN:     --use-make %S/Inputs/test-suite-cmake/fake-make \
 # RUN:     --use-lit %S/Inputs/test-suite-cmake/fake-lit \
 # RUN:     --only-test subtest \
+# RUN:     --cmake-define one=two \
+# RUN:     --cmake-define three=four \
 # RUN:     --verbose \
 # RUN:     > %t.log 2> %t.err
 # RUN: FileCheck --check-prefix CHECK-ONLYTEST < %t.err %s
+# CHECK-ONLYTEST: Configuring with {
+# CHECK-ONLYTEST:   one: 'two'
+# CHECK-ONLYTEST:   three: 'four'
+# CHECK-ONLYTEST: Execute: {{.*}}/fake-make timeit-host -j 1 
+# CHECK-ONLYTEST:            (In {{.*}})
 # CHECK-ONLYTEST: Execute: {{.*}}/fake-make -j 1
 # CHECK-ONLYTEST:            (In {{.*}}/subtest)
 




More information about the llvm-commits mailing list