[LNT] r308946 - tests/test_suite: Define compiler before applying cache files

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 24 19:19:26 PDT 2017


Author: matze
Date: Mon Jul 24 19:19:26 2017
New Revision: 308946

URL: http://llvm.org/viewvc/llvm-project?rev=308946&view=rev
Log:
tests/test_suite: Define compiler before applying cache files

This allows caches files to adapt to the given compiler (like
conditionally apply flags).

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=308946&r1=308945&r2=308946&view=diff
==============================================================================
--- lnt/trunk/lnt/tests/test_suite.py (original)
+++ lnt/trunk/lnt/tests/test_suite.py Mon Jul 24 19:19:26 2017
@@ -505,7 +505,17 @@ class TestSuiteTest(BuiltinTest):
         for l in lines:
             logger.info(l)
 
-        cmake_cmd = [cmake_cmd] + cmake_flags + [self._test_suite_dir()] + \
+        # Define compilers before specifying the cache files.
+        early_defs = {}
+        for key in ['CMAKE_C_COMPILER:FILEPATH',
+                    'CMAKE_CXX_COMPILER:FILEPATH']:
+            value = defs.pop(key, None)
+            if value is not None:
+                early_defs[key] = value
+
+        cmake_cmd = [cmake_cmd] + \
+                    ['-D%s=%s' % (k, v) for k, v in early_defs.items()] + \
+                    cmake_flags + [self._test_suite_dir()] + \
                     ['-D%s=%s' % (k, v) for k, v in defs.items()]
         if execute:
             self._check_call(cmake_cmd, cwd=path)

Modified: lnt/trunk/tests/runtest/test_suite.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/runtest/test_suite.py?rev=308946&r1=308945&r2=308946&view=diff
==============================================================================
--- lnt/trunk/tests/runtest/test_suite.py (original)
+++ lnt/trunk/tests/runtest/test_suite.py Mon Jul 24 19:19:26 2017
@@ -325,6 +325,8 @@
 # CHECK-RESULTS-FAIL: "run_order": "123"
 
 # Check a run of test-suite using a cmake cache
+# Also make sure we get: compiler defines, cache, other defines on the cmake
+# commandline.
 # RUN: lnt runtest test-suite \
 # RUN:     --sandbox %t.SANDBOX \
 # RUN:     --no-timestamp \
@@ -334,10 +336,10 @@
 # RUN:     --use-make %S/Inputs/test-suite-cmake/fake-make \
 # RUN:     --use-lit %S/Inputs/test-suite-cmake/fake-lit \
 # RUN:     --cmake-cache Release \
+# RUN:     --cmake-define FOO=BAR \
 # RUN:     &> %t.cmake-cache.log
 # RUN: FileCheck  --check-prefix CHECK-CACHE < %t.cmake-cache.log %s
-# CHECK-CACHE: Cmake Cache
-# CHECK-CACHE: Release
+# CHECK-CACHE: Execute: {{.*}}cmake -DCMAKE_CXX_COMPILER:FILEPATH={{.*}}/FakeCompilers/clang++-r154331 -DCMAKE_C_COMPILER:FILEPATH={{.*}}FakeCompilers/clang-r154331 -C {{.*}}/Release.cmake {{.*}}-DFOO=BAR
 
 
 # Check a run of test-suite using a invalid cmake cache




More information about the llvm-commits mailing list