summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-09-21 00:24:52 +0000
committerZachary Turner <zturner@google.com>2017-09-21 00:24:52 +0000
commit1e4a12522612e29dc0d7e3597f6455da19e7fb8b (patch)
treedead30dd7246ea29d83b3de33332cc4555b5d4c5 /test
parent8d6f84c7d5658030b4d12074b679fe55e9eb3639 (diff)
[lit] Make lit support config files with .py extension.
Many editors and Python-related diagnostics tools such as debuggers break or fail in mysterious ways when python files don't end in .py. This is especially true on Windows, but still exists on other platforms. I don't want to be too heavy handed in changing everything across the board, but I do want to at least *allow* lit configs to have .py extensions. This patch makes the discovery process first look for a config file with a .py extension, and if one is not found, then looks for a config file using the old method. So for existing users, there should be no functional change. Differential Revision: https://reviews.llvm.org/D37838 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313849 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt16
-rw-r--r--test/Unit/lit.cfg.py (renamed from test/Unit/lit.cfg)0
-rw-r--r--test/Unit/lit.site.cfg.py.in (renamed from test/Unit/lit.site.cfg.in)2
-rw-r--r--test/lit.cfg.py (renamed from test/lit.cfg)0
-rw-r--r--test/lit.site.cfg.py.in (renamed from test/lit.site.cfg.in)2
5 files changed, 10 insertions, 10 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 28bec84989f..33e5da0eb1b 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -11,12 +11,16 @@ llvm_canonicalize_cmake_booleans(
BUILD_SHARED_LIBS)
configure_lit_site_cfg(
- ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
- ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
+ ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
+ ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py
+ MAIN_CONFIG
+ ${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py
)
configure_lit_site_cfg(
- ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in
- ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
+ ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in
+ ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg.py
+ MAIN_CONFIG
+ ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.cfg.py
)
# Don't include check-llvm into check-all without LLVM_BUILD_TOOLS.
@@ -148,15 +152,11 @@ set_target_properties(llvm-test-depends PROPERTIES FOLDER "Tests")
add_lit_testsuite(check-llvm "Running the LLVM regression tests"
${CMAKE_CURRENT_BINARY_DIR}
- PARAMS llvm_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
- llvm_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
DEPENDS ${LLVM_TEST_DEPENDS}
)
set_target_properties(check-llvm PROPERTIES FOLDER "Tests")
add_lit_testsuites(LLVM ${CMAKE_CURRENT_SOURCE_DIR}
- PARAMS llvm_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
- llvm_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
DEPENDS ${LLVM_TEST_DEPENDS}
)
diff --git a/test/Unit/lit.cfg b/test/Unit/lit.cfg.py
index 609408d1dd8..609408d1dd8 100644
--- a/test/Unit/lit.cfg
+++ b/test/Unit/lit.cfg.py
diff --git a/test/Unit/lit.site.cfg.in b/test/Unit/lit.site.cfg.py.in
index 9d736f473ce..1fef001be62 100644
--- a/test/Unit/lit.site.cfg.in
+++ b/test/Unit/lit.site.cfg.py.in
@@ -20,4 +20,4 @@ except KeyError:
lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key))
# Let the main config do the real work.
-lit_config.load_config(config, "@LLVM_SOURCE_DIR@/test/Unit/lit.cfg")
+lit_config.load_config(config, "@LLVM_SOURCE_DIR@/test/Unit/lit.cfg.py")
diff --git a/test/lit.cfg b/test/lit.cfg.py
index 87e2a06e387..87e2a06e387 100644
--- a/test/lit.cfg
+++ b/test/lit.cfg.py
diff --git a/test/lit.site.cfg.in b/test/lit.site.cfg.py.in
index a45a000624c..45f265afb97 100644
--- a/test/lit.site.cfg.in
+++ b/test/lit.site.cfg.py.in
@@ -55,4 +55,4 @@ except KeyError:
@LIT_SITE_CFG_IN_FOOTER@
# Let the main config do the real work.
-lit_config.load_config(config, "@LLVM_SOURCE_DIR@/test/lit.cfg")
+lit_config.load_config(config, "@LLVM_SOURCE_DIR@/test/lit.cfg.py")