From 75acad41bcd6cbe688e0609cbd7649ea8a533195 Mon Sep 17 00:00:00 2001 From: Sam McCall Date: Tue, 15 Mar 2022 23:15:56 +0100 Subject: [PATCH] Use lit_config.substitute instead of foo % lit_config.params everywhere This mechanically applies the same changes from D121427 everywhere. Differential Revision: https://reviews.llvm.org/D121746 --- bolt/test/Unit/lit.site.cfg.py.in | 16 ++------ bolt/test/lit.site.cfg.py.in | 17 ++------- clang/test/Unit/lit.site.cfg.py.in | 21 ++--------- clang/test/lit.site.cfg.py.in | 20 ++-------- clang/utils/perf-training/lit.site.cfg.in | 11 +----- .../perf-training/order-files.lit.site.cfg.in | 11 +----- compiler-rt/test/lit.common.configured.in | 10 ++--- .../unittests/lit.common.unit.configured.in | 16 ++------ cross-project-tests/lit.site.cfg.py.in | 14 +------ flang/test/NonGtestUnit/lit.site.cfg.py.in | 16 ++------ flang/test/Unit/lit.site.cfg.py.in | 16 ++------ flang/test/lit.site.cfg.py.in | 17 ++------- lld/test/Unit/lit.site.cfg.py.in | 22 +++-------- lld/test/lit.site.cfg.py.in | 19 ++-------- lldb/test/API/lit.site.cfg.py.in | 37 +++++-------------- lldb/test/Shell/lit.site.cfg.py.in | 25 +++---------- lldb/test/Unit/lit.site.cfg.py.in | 16 ++------ lldb/test/lit.site.cfg.py.in | 16 ++------ llvm/test/Unit/lit.site.cfg.py.in | 17 ++------- llvm/test/lit.site.cfg.py.in | 17 ++------- llvm/utils/lit/tests/lit.site.cfg.in | 11 +----- .../standalone/test/lit.site.cfg.py.in | 18 ++------- mlir/test/Unit/lit.site.cfg.py.in | 17 ++------- mlir/test/lit.site.cfg.py.in | 17 ++------- polly/test/Unit/lit.site.cfg.in | 18 ++------- polly/test/lit.site.cfg.in | 14 +------ 26 files changed, 85 insertions(+), 364 deletions(-) diff --git a/bolt/test/Unit/lit.site.cfg.py.in b/bolt/test/Unit/lit.site.cfg.py.in index 45a36c58923f..2e04fa0ca32e 100644 --- a/bolt/test/Unit/lit.site.cfg.py.in +++ b/bolt/test/Unit/lit.site.cfg.py.in @@ -2,25 +2,15 @@ config.llvm_src_root = "@LLVM_SOURCE_DIR@" config.llvm_obj_root = "@LLVM_BINARY_DIR@" -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.llvm_libs_dir = "@LLVM_LIBS_DIR@" -config.llvm_build_mode = "@LLVM_BUILD_MODE@" +config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") +config.llvm_libs_dir = lit_config.substitute("@LLVM_LIBS_DIR@") +config.llvm_build_mode = lit_config.substitute("@LLVM_BUILD_MODE@") config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.bolt_obj_root = "@BOLT_BINARY_DIR@" config.bolt_src_root = "@BOLT_SOURCE_DIR@" config.target_triple = "@LLVM_TARGET_TRIPLE@" config.python_executable = "@Python3_EXECUTABLE@" -# Support substitution of the tools and libs dirs with user parameters. This is -# used when we can't determine the tool dir at configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params - config.llvm_build_mode = config.llvm_build_mode % lit_config.params -except KeyError as e: - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) - import lit.llvm lit.llvm.initialize(lit_config, config) diff --git a/bolt/test/lit.site.cfg.py.in b/bolt/test/lit.site.cfg.py.in index 8c94a5609a9d..1bc8e59b183d 100644 --- a/bolt/test/lit.site.cfg.py.in +++ b/bolt/test/lit.site.cfg.py.in @@ -6,9 +6,9 @@ config.llvm_src_root = "@LLVM_SOURCE_DIR@" config.llvm_obj_root = "@LLVM_BINARY_DIR@" config.bolt_obj_root = "@BOLT_BINARY_DIR@" config.bolt_enable_runtime = @BOLT_ENABLE_RUNTIME@ -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.llvm_libs_dir = "@LLVM_LIBS_DIR@" -config.llvm_shlib_dir = "@SHLIBDIR@" +config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") +config.llvm_libs_dir = lit_config.substitute("@LLVM_LIBS_DIR@") +config.llvm_shlib_dir = lit_config.substitute("@SHLIBDIR@") config.llvm_plugin_ext = "@LLVM_PLUGIN_EXT@" config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.host_triple = "@LLVM_HOST_TRIPLE@" @@ -22,17 +22,6 @@ config.python_executable = "@PYTHON_EXECUTABLE@" config.bolt_clang = "@BOLT_CLANG_EXE@" config.bolt_lld = "@BOLT_LLD_EXE@" -# Support substitution of the tools and libs dirs with user parameters. This is -# used when we can't determine the tool dir at configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_shlib_dir = config.llvm_shlib_dir % lit_config.params - config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params -except KeyError: - e = sys.exc_info()[1] - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) - import lit.llvm lit.llvm.initialize(lit_config, config) diff --git a/clang/test/Unit/lit.site.cfg.py.in b/clang/test/Unit/lit.site.cfg.py.in index acd3cc8f29e9..778ab2ef0515 100644 --- a/clang/test/Unit/lit.site.cfg.py.in +++ b/clang/test/Unit/lit.site.cfg.py.in @@ -4,27 +4,14 @@ import sys config.llvm_src_root = path(r"@LLVM_SOURCE_DIR@") config.llvm_obj_root = path(r"@LLVM_BINARY_DIR@") -config.llvm_tools_dir = path(r"@LLVM_TOOLS_DIR@") -config.llvm_libs_dir = path(r"@LLVM_LIBS_DIR@") -config.llvm_build_mode = "@LLVM_BUILD_MODE@" +config.llvm_tools_dir = lit_config.substitute(path(r"@LLVM_TOOLS_DIR@")) +config.llvm_libs_dir = lit_config.substitute(path(r"@LLVM_LIBS_DIR@")) +config.llvm_build_mode = lit_config.substitute("@LLVM_BUILD_MODE@") config.clang_obj_root = path(r"@CLANG_BINARY_DIR@") config.enable_shared = @ENABLE_SHARED@ -config.shlibdir = path(r"@SHLIBDIR@") +config.shlibdir = lit_config.substitute(path(r"@SHLIBDIR@")) config.target_triple = "@LLVM_TARGET_TRIPLE@" -# Support substitution of the tools_dir, libs_dirs, and build_mode with user -# parameters. This is used when we can't determine the tool dir at -# configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params - config.llvm_build_mode = config.llvm_build_mode % lit_config.params - config.shlibdir = config.shlibdir % lit_config.params -except KeyError: - e = sys.exc_info()[1] - key, = e.args - 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, os.path.join(path(r"@CLANG_SOURCE_DIR@"), "test/Unit/lit.cfg.py")) diff --git a/clang/test/lit.site.cfg.py.in b/clang/test/lit.site.cfg.py.in index 227262607911..fde1a6222ea2 100644 --- a/clang/test/lit.site.cfg.py.in +++ b/clang/test/lit.site.cfg.py.in @@ -4,16 +4,16 @@ import sys config.llvm_src_root = path(r"@LLVM_SOURCE_DIR@") config.llvm_obj_root = path(r"@LLVM_BINARY_DIR@") -config.llvm_tools_dir = path(r"@LLVM_TOOLS_DIR@") -config.llvm_libs_dir = path(r"@LLVM_LIBS_DIR@") -config.llvm_shlib_dir = path(r"@SHLIBDIR@") +config.llvm_tools_dir = lit_config.substitute(path(r"@LLVM_TOOLS_DIR@")) +config.llvm_libs_dir = lit_config.substitute(path(r"@LLVM_LIBS_DIR@")) +config.llvm_shlib_dir = lit_config.substitute(path(r"@SHLIBDIR@")) config.llvm_plugin_ext = "@LLVM_PLUGIN_EXT@" config.lit_tools_dir = path(r"@LLVM_LIT_TOOLS_DIR@") config.errc_messages = "@LLVM_LIT_ERRC_MESSAGES@" config.clang_lit_site_cfg = __file__ config.clang_obj_root = path(r"@CLANG_BINARY_DIR@") config.clang_src_dir = path(r"@CLANG_SOURCE_DIR@") -config.clang_tools_dir = path(r"@CLANG_TOOLS_DIR@") +config.clang_tools_dir = lit_config.substitute(path(r"@CLANG_TOOLS_DIR@")) config.clang_lib_dir = path(r"@CMAKE_LIBRARY_OUTPUT_DIRECTORY@") config.host_triple = "@LLVM_HOST_TRIPLE@" config.target_triple = "@LLVM_TARGET_TRIPLE@" @@ -38,18 +38,6 @@ config.has_plugins = @CLANG_PLUGIN_SUPPORT@ config.clang_vendor_uti = "@CLANG_VENDOR_UTI@" config.llvm_external_lit = path(r"@LLVM_EXTERNAL_LIT@") -# Support substitution of the tools and libs dirs with user parameters. This is -# used when we can't determine the tool dir at configuration time. -try: - config.clang_tools_dir = config.clang_tools_dir % lit_config.params - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_shlib_dir = config.llvm_shlib_dir % lit_config.params - config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params -except KeyError: - e = sys.exc_info()[1] - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) - import lit.llvm lit.llvm.initialize(lit_config, config) diff --git a/clang/utils/perf-training/lit.site.cfg.in b/clang/utils/perf-training/lit.site.cfg.in index a41c88901cf3..c9624aa7339b 100644 --- a/clang/utils/perf-training/lit.site.cfg.in +++ b/clang/utils/perf-training/lit.site.cfg.in @@ -2,21 +2,12 @@ import sys -config.clang_tools_dir = "@CLANG_TOOLS_DIR@" +config.clang_tools_dir = lit_config.substitute("@CLANG_TOOLS_DIR@") config.perf_helper_dir = "@CMAKE_CURRENT_SOURCE_DIR@" config.test_exec_root = "@CMAKE_CURRENT_BINARY_DIR@" config.test_source_root = "@CLANG_PGO_TRAINING_DATA@" config.target_triple = "@LLVM_TARGET_TRIPLE@" config.python_exe = "@Python3_EXECUTABLE@" -# Support substitution of the tools and libs dirs with user parameters. This is -# used when we can't determine the tool dir at configuration time. -try: - config.clang_tools_dir = config.clang_tools_dir % lit_config.params -except KeyError: - e = sys.exc_info()[1] - key, = e.args - 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, "@CLANG_SOURCE_DIR@/utils/perf-training/lit.cfg") diff --git a/clang/utils/perf-training/order-files.lit.site.cfg.in b/clang/utils/perf-training/order-files.lit.site.cfg.in index f8294e740542..5923eae9a3b0 100644 --- a/clang/utils/perf-training/order-files.lit.site.cfg.in +++ b/clang/utils/perf-training/order-files.lit.site.cfg.in @@ -2,21 +2,12 @@ import sys -config.clang_tools_dir = "@CLANG_TOOLS_DIR@" +config.clang_tools_dir = lit_config.substitute("@CLANG_TOOLS_DIR@") config.perf_helper_dir = "@CMAKE_CURRENT_SOURCE_DIR@" config.test_exec_root = "@CMAKE_CURRENT_BINARY_DIR@" config.test_source_root = "@CLANG_PGO_TRAINING_DATA@" config.target_triple = "@LLVM_TARGET_TRIPLE@" config.python_exe = "@Python3_EXECUTABLE@" -# Support substitution of the tools and libs dirs with user parameters. This is -# used when we can't determine the tool dir at configuration time. -try: - config.clang_tools_dir = config.clang_tools_dir % lit_config.params -except KeyError: - e = sys.exc_info()[1] - key, = e.args - 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, "@CLANG_SOURCE_DIR@/utils/perf-training/order-files.lit.cfg") diff --git a/compiler-rt/test/lit.common.configured.in b/compiler-rt/test/lit.common.configured.in index 42a5b559b913..e495396aa528 100644 --- a/compiler-rt/test/lit.common.configured.in +++ b/compiler-rt/test/lit.common.configured.in @@ -70,13 +70,9 @@ set_default("libcxx_used", "@LLVM_LIBCXX_USED@") # LLVM tools dir can be passed in lit parameters, so try to # apply substitution. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.clang = config.clang % lit_config.params - config.compiler_rt_libdir = config.compiler_rt_libdir % lit_config.params -except KeyError as e: - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key, key)) +config.llvm_tools_dir = lit_config.substitute(config.llvm_tools_dir) +config.clang = lit_config.substitute(config.clang) +config.compiler_rt_libdir = lit_config.substitute(config.compiler_rt_libdir) if not os.path.exists(config.clang): lit_config.fatal("Can't find compiler on path %r" % config.clang) diff --git a/compiler-rt/unittests/lit.common.unit.configured.in b/compiler-rt/unittests/lit.common.unit.configured.in index 66cb4295baff..3e42e83c9e70 100644 --- a/compiler-rt/unittests/lit.common.unit.configured.in +++ b/compiler-rt/unittests/lit.common.unit.configured.in @@ -4,26 +4,16 @@ config.target_triple = "@LLVM_TARGET_TRIPLE@" config.llvm_src_root = "@LLVM_MAIN_SRC_DIR@" config.llvm_obj_root = "@LLVM_BINARY_DIR@" -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" +config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@" -config.compiler_rt_libdir = "@COMPILER_RT_RESOLVED_LIBRARY_OUTPUT_DIR@" +config.compiler_rt_libdir = lit_config.substitute("@COMPILER_RT_RESOLVED_LIBRARY_OUTPUT_DIR@") config.enable_per_target_runtime_dir = @LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_PYBOOL@ -config.llvm_build_mode = "@LLVM_BUILD_MODE@" +config.llvm_build_mode = lit_config.substitute("@LLVM_BUILD_MODE@") config.host_arch = "@HOST_ARCH@" config.host_os = "@HOST_OS@" config.llvm_lib_dir = "@LLVM_LIBRARY_DIR@" config.gwp_asan = @COMPILER_RT_HAS_GWP_ASAN_PYBOOL@ config.emulator = "@COMPILER_RT_EMULATOR@" -# LLVM tools dir and build mode can be passed in lit parameters, -# so try to apply substitution. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.compiler_rt_libdir = config.compiler_rt_libdir % lit_config.params - config.llvm_build_mode = config.llvm_build_mode % lit_config.params -except KeyError as e: - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key, key)) - # Setup attributes common for all compiler-rt unit tests. lit_config.load_config(config, "@COMPILER_RT_SOURCE_DIR@/unittests/lit.common.unit.cfg.py") diff --git a/cross-project-tests/lit.site.cfg.py.in b/cross-project-tests/lit.site.cfg.py.in index c184a600e0f3..39458dfc79af 100644 --- a/cross-project-tests/lit.site.cfg.py.in +++ b/cross-project-tests/lit.site.cfg.py.in @@ -5,9 +5,9 @@ import lit.util config.targets_to_build = "@TARGETS_TO_BUILD@".split() config.llvm_src_root = "@LLVM_SOURCE_DIR@" -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" +config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") config.llvm_libs_dir = "@LLVM_LIBS_DIR@" -config.llvm_shlib_dir = "@SHLIBDIR@" +config.llvm_shlib_dir = lit_config.substitute("@SHLIBDIR@") config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.llvm_plugin_ext = "@LLVM_PLUGIN_EXT@" config.cross_project_tests_obj_root = "@CROSS_PROJECT_TESTS_BINARY_DIR@" @@ -21,16 +21,6 @@ config.mlir_src_root = "@MLIR_SOURCE_DIR@" config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@" -# Support substitution of the tools_dir with user parameters. This is -# used when we can't determine the tool dir at configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_shlib_dir = config.llvm_shlib_dir % lit_config.params -except KeyError: - e = sys.exc_info()[1] - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) - import lit.llvm lit.llvm.initialize(lit_config, config) diff --git a/flang/test/NonGtestUnit/lit.site.cfg.py.in b/flang/test/NonGtestUnit/lit.site.cfg.py.in index 3833e223a431..9e4545754ab8 100644 --- a/flang/test/NonGtestUnit/lit.site.cfg.py.in +++ b/flang/test/NonGtestUnit/lit.site.cfg.py.in @@ -2,9 +2,9 @@ config.llvm_src_root = "@LLVM_SOURCE_DIR@" config.llvm_obj_root = "@LLVM_BINARY_DIR@" -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.llvm_libs_dir = "@LLVM_LIBS_DIR@" -config.llvm_build_mode = "@LLVM_BUILD_MODE@" +config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") +config.llvm_libs_dir = lit_config.substitute("@LLVM_LIBS_DIR@") +config.llvm_build_mode = lit_config.substitute("@LLVM_BUILD_MODE@") config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.flang_obj_root = "@FLANG_BINARY_DIR@" config.flang_src_root = "@FLANG_SOURCE_DIR@" @@ -13,15 +13,5 @@ config.flang_tools_dir = "@LLVM_RUNTIME_OUTPUT_INTDIR@" config.target_triple = "@LLVM_TARGET_TRIPLE@" config.python_executable = "@Python3_EXECUTABLE@" -# Support substitution of the tools and libs dirs with user parameters. This is -# used when we can't determine the tool dir at configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params - config.llvm_build_mode = config.llvm_build_mode % lit_config.params -except KeyError as e: - key, = e.args - 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, "@FLANG_SOURCE_DIR@/test/NonGtestUnit/lit.cfg.py") diff --git a/flang/test/Unit/lit.site.cfg.py.in b/flang/test/Unit/lit.site.cfg.py.in index d96f51d934d3..07d3ca344c97 100644 --- a/flang/test/Unit/lit.site.cfg.py.in +++ b/flang/test/Unit/lit.site.cfg.py.in @@ -2,9 +2,9 @@ config.llvm_src_root = "@LLVM_SOURCE_DIR@" config.llvm_obj_root = "@LLVM_BINARY_DIR@" -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.llvm_libs_dir = "@LLVM_LIBS_DIR@" -config.llvm_build_mode = "@LLVM_BUILD_MODE@" +config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") +config.llvm_libs_dir = lit_config.substitute("@LLVM_LIBS_DIR@") +config.llvm_build_mode = lit_config.substitute("@LLVM_BUILD_MODE@") config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.flang_obj_root = "@FLANG_BINARY_DIR@" config.flang_src_root = "@FLANG_SOURCE_DIR@" @@ -13,15 +13,5 @@ config.flang_tools_dir = "@LLVM_RUNTIME_OUTPUT_INTDIR@" config.target_triple = "@LLVM_TARGET_TRIPLE@" config.python_executable = "@Python3_EXECUTABLE@" -# Support substitution of the tools and libs dirs with user parameters. This is -# used when we can't determine the tool dir at configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params - config.llvm_build_mode = config.llvm_build_mode % lit_config.params -except KeyError as e: - key, = e.args - 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, "@FLANG_SOURCE_DIR@/test/Unit/lit.cfg.py") diff --git a/flang/test/lit.site.cfg.py.in b/flang/test/lit.site.cfg.py.in index 5619dd62b1f2..dcdb119524fd 100644 --- a/flang/test/lit.site.cfg.py.in +++ b/flang/test/lit.site.cfg.py.in @@ -2,14 +2,14 @@ import sys -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.llvm_shlib_dir = path(r"@SHLIBDIR@") +config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") +config.llvm_shlib_dir = lit_config.substitute(path(r"@SHLIBDIR@")) config.llvm_plugin_ext = "@LLVM_PLUGIN_EXT@" config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.errc_messages = "@LLVM_LIT_ERRC_MESSAGES@" config.flang_obj_root = "@FLANG_BINARY_DIR@" config.flang_src_dir = "@FLANG_SOURCE_DIR@" -config.flang_tools_dir = "@FLANG_TOOLS_DIR@" +config.flang_tools_dir = lit_config.substitute("@FLANG_TOOLS_DIR@") config.flang_intrinsic_modules_dir = "@FLANG_INTRINSIC_MODULES_DIR@" config.flang_llvm_tools_dir = "@CMAKE_BINARY_DIR@/bin" config.flang_lib_dir = "@CMAKE_BINARY_DIR@/lib" @@ -20,17 +20,6 @@ config.has_plugins = @LLVM_ENABLE_PLUGINS@ config.cc = "@CMAKE_C_COMPILER@" config.targets_to_build = "@TARGETS_TO_BUILD@" -# Support substitution of the tools_dir with user parameters. This is -# used when we can't determine the tool dir at configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.flang_tools_dir = config.flang_tools_dir % lit_config.params - config.llvm_shlib_dir = config.llvm_shlib_dir % lit_config.params -except KeyError: - e = sys.exc_info()[1] - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) - import lit.llvm lit.llvm.initialize(lit_config, config) diff --git a/lld/test/Unit/lit.site.cfg.py.in b/lld/test/Unit/lit.site.cfg.py.in index 812a07125bc7..ccabf0545182 100644 --- a/lld/test/Unit/lit.site.cfg.py.in +++ b/lld/test/Unit/lit.site.cfg.py.in @@ -2,28 +2,16 @@ config.llvm_src_root = "@LLVM_SOURCE_DIR@" config.llvm_obj_root = "@LLVM_BINARY_DIR@" -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.llvm_libs_dir = "@LLVM_LIBS_DIR@" -config.llvm_build_mode = "@LLVM_BUILD_MODE@" +config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") +config.llvm_libs_dir = lit_config.substitute("@LLVM_LIBS_DIR@") +config.llvm_build_mode = lit_config.substitute("@LLVM_BUILD_MODE@") config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.lld_obj_root = "@LLD_BINARY_DIR@" config.lld_src_root = "@LLD_SOURCE_DIR@" -config.lld_libs_dir = "@LLD_LIBS_DIR@" -config.lld_tools_dir = "@LLD_TOOLS_DIR@" +config.lld_libs_dir = lit_config.substitute("@LLD_LIBS_DIR@") +config.lld_tools_dir = lit_config.substitute("@LLD_TOOLS_DIR@") config.target_triple = "@LLVM_TARGET_TRIPLE@" config.python_executable = "@Python3_EXECUTABLE@" -# Support substitution of the tools and libs dirs with user parameters. This is -# used when we can't determine the tool dir at configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params - config.llvm_build_mode = config.llvm_build_mode % lit_config.params - config.lld_libs_dir = config.lld_libs_dir % lit_config.params - config.lld_tools_dir = config.lld_tools_dir % lit_config.params -except KeyError as e: - key, = e.args - 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, "@LLD_SOURCE_DIR@/test/Unit/lit.cfg.py") diff --git a/lld/test/lit.site.cfg.py.in b/lld/test/lit.site.cfg.py.in index f47717aef53a..ffc762d89e6a 100644 --- a/lld/test/lit.site.cfg.py.in +++ b/lld/test/lit.site.cfg.py.in @@ -5,13 +5,13 @@ import lit.util config.have_dia_sdk = lit.util.pythonize_bool("@LLVM_ENABLE_DIA_SDK@") config.llvm_src_root = "@LLVM_SOURCE_DIR@" config.llvm_obj_root = "@LLVM_BINARY_DIR@" -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.llvm_libs_dir = "@LLVM_LIBS_DIR@" +config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") +config.llvm_libs_dir = lit_config.substitute("@LLVM_LIBS_DIR@") config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.errc_messages = "@LLVM_LIT_ERRC_MESSAGES@" config.lld_obj_root = "@LLD_BINARY_DIR@" -config.lld_libs_dir = "@LLD_LIBS_DIR@" -config.lld_tools_dir = "@LLD_TOOLS_DIR@" +config.lld_libs_dir = lit_config.substitute("@LLD_LIBS_DIR@") +config.lld_tools_dir = lit_config.substitute("@LLD_TOOLS_DIR@") config.target_triple = "@LLVM_TARGET_TRIPLE@" config.python_executable = "@Python3_EXECUTABLE@" config.have_zlib = @LLVM_ENABLE_ZLIB@ @@ -20,17 +20,6 @@ config.have_libxml2 = @LLVM_ENABLE_LIBXML2@ config.sizeof_void_p = @CMAKE_SIZEOF_VOID_P@ config.ld_lld_default_mingw = @LLD_DEFAULT_LD_LLD_IS_MINGW@ -# Support substitution of the tools and libs dirs with user parameters. This is -# used when we can't determine the tool dir at configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params - config.lld_libs_dir = config.lld_libs_dir % lit_config.params - config.lld_tools_dir = config.lld_tools_dir % lit_config.params -except KeyError as e: - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) - import lit.llvm lit.llvm.initialize(lit_config, config) diff --git a/lldb/test/API/lit.site.cfg.py.in b/lldb/test/API/lit.site.cfg.py.in index d5eb624f4b8d..75d588a30b37 100644 --- a/lldb/test/API/lit.site.cfg.py.in +++ b/lldb/test/API/lit.site.cfg.py.in @@ -2,15 +2,15 @@ config.llvm_src_root = "@LLVM_SOURCE_DIR@" config.llvm_obj_root = "@LLVM_BINARY_DIR@" -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.llvm_libs_dir = "@LLVM_LIBS_DIR@" -config.llvm_shlib_dir = "@SHLIBDIR@" -config.llvm_build_mode = "@LLVM_BUILD_MODE@" +config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") +config.llvm_libs_dir = lit_config.substitute("@LLVM_LIBS_DIR@") +config.llvm_shlib_dir = lit_config.substitute("@SHLIBDIR@") +config.llvm_build_mode = lit_config.substitute("@LLVM_BUILD_MODE@") config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.lldb_obj_root = "@LLDB_BINARY_DIR@" config.lldb_src_root = "@LLDB_SOURCE_DIR@" -config.lldb_libs_dir = "@LLDB_LIBS_DIR@" -config.lldb_framework_dir = "@LLDB_FRAMEWORK_DIR@" +config.lldb_libs_dir = lit_config.substitute("@LLDB_LIBS_DIR@") +config.lldb_framework_dir = lit_config.substitute("@LLDB_FRAMEWORK_DIR@") config.cmake_cxx_compiler = "@CMAKE_CXX_COMPILER@" config.host_os = "@HOST_OS@" config.host_triple = "@LLVM_HOST_TRIPLE@" @@ -21,14 +21,14 @@ config.lldb_build_directory = "@LLDB_TEST_BUILD_DIRECTORY@" config.python_executable = "@Python3_EXECUTABLE@" config.lua_executable = "@Lua_EXECUTABLE@" config.lua_test_entry = "TestLuaAPI.py" -config.dotest_args_str = "@LLDB_DOTEST_ARGS@" +config.dotest_args_str = lit_config.substitute("@LLDB_DOTEST_ARGS@") config.lldb_enable_python = @LLDB_ENABLE_PYTHON@ config.dotest_lit_args_str = None config.enabled_plugins = [] -config.lldb_executable = '@LLDB_TEST_EXECUTABLE@' +config.lldb_executable = lit_config.substitute('@LLDB_TEST_EXECUTABLE@') config.test_arch = '@LLDB_TEST_ARCH@' -config.test_compiler = '@LLDB_TEST_COMPILER@' -config.dsymutil = '@LLDB_TEST_DSYMUTIL@' +config.test_compiler = lit_config.substitute('@LLDB_TEST_COMPILER@') +config.dsymutil = lit_config.substitute('@LLDB_TEST_DSYMUTIL@') # The API tests use their own module caches. config.lldb_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_LLDB@", "lldb-api") config.clang_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_CLANG@", "lldb-api") @@ -44,22 +44,5 @@ dotest_lit_args_str = lit_config.params.get('dotest-args', None) if dotest_lit_args_str: config.dotest_lit_args_str = dotest_lit_args_str -# Support substitution of the tools and libs dirs with user parameters. This is -# used when we can't determine the tool dir at configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params - config.llvm_shlib_dir = config.llvm_shlib_dir % lit_config.params - config.llvm_build_mode = config.llvm_build_mode % lit_config.params - config.lldb_executable = config.lldb_executable % lit_config.params - config.lldb_libs_dir = config.lldb_libs_dir % lit_config.params - config.test_compiler = config.test_compiler % lit_config.params - config.dsymutil = config.dsymutil % lit_config.params - config.lldb_framework_dir = config.lldb_framework_dir % lit_config.params - config.dotest_args_str = config.dotest_args_str % lit_config.params -except KeyError as e: - key, = e.args - 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, os.path.join(config.lldb_src_root, "test", "API", "lit.cfg.py")) diff --git a/lldb/test/Shell/lit.site.cfg.py.in b/lldb/test/Shell/lit.site.cfg.py.in index b8b08b3d7436..29d309ca9183 100644 --- a/lldb/test/Shell/lit.site.cfg.py.in +++ b/lldb/test/Shell/lit.site.cfg.py.in @@ -2,17 +2,17 @@ config.llvm_src_root = "@LLVM_SOURCE_DIR@" config.llvm_obj_root = "@LLVM_BINARY_DIR@" -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.llvm_libs_dir = "@LLVM_LIBS_DIR@" -config.llvm_shlib_dir = "@SHLIBDIR@" +config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") +config.llvm_libs_dir = lit_config.substitute("@LLVM_LIBS_DIR@") +config.llvm_shlib_dir = lit_config.substitute("@SHLIBDIR@") config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.lldb_src_root = "@LLDB_SOURCE_DIR@" config.lldb_obj_root = "@LLDB_BINARY_DIR@" -config.lldb_libs_dir = "@LLDB_LIBS_DIR@" -config.lldb_tools_dir = "@LLDB_TOOLS_DIR@" +config.lldb_libs_dir = lit_config.substitute("@LLDB_LIBS_DIR@") +config.lldb_tools_dir = lit_config.substitute("@LLDB_TOOLS_DIR@") # Since it comes from the command line, it may have backslashes which # should not need to be escaped. -config.lldb_lit_tools_dir = r"@LLDB_LIT_TOOLS_DIR@" +config.lldb_lit_tools_dir = lit_config.substitute(r"@LLDB_LIT_TOOLS_DIR@") config.target_triple = "@LLVM_TARGET_TRIPLE@" config.python_executable = "@Python3_EXECUTABLE@" config.have_zlib = @LLVM_ENABLE_ZLIB@ @@ -27,19 +27,6 @@ config.lldb_system_debugserver = @LLDB_USE_SYSTEM_DEBUGSERVER@ config.lldb_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_LLDB@", "lldb-shell") config.clang_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_CLANG@", "lldb-shell") -# Support substitution of the tools and libs dirs with user parameters. This is -# used when we can't determine the tool dir at configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params - config.llvm_shlib_dir = config.llvm_shlib_dir % lit_config.params - config.lldb_libs_dir = config.lldb_libs_dir % lit_config.params - config.lldb_tools_dir = config.lldb_tools_dir % lit_config.params - config.lldb_lit_tools_dir = config.lldb_lit_tools_dir % lit_config.params -except KeyError as e: - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) - import lit.llvm lit.llvm.initialize(lit_config, config) diff --git a/lldb/test/Unit/lit.site.cfg.py.in b/lldb/test/Unit/lit.site.cfg.py.in index d6352c01251d..b22af0f38143 100644 --- a/lldb/test/Unit/lit.site.cfg.py.in +++ b/lldb/test/Unit/lit.site.cfg.py.in @@ -2,25 +2,15 @@ config.llvm_src_root = "@LLVM_SOURCE_DIR@" config.llvm_obj_root = "@LLVM_BINARY_DIR@" -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.llvm_libs_dir = "@LLVM_LIBS_DIR@" -config.llvm_build_mode = "@LLVM_BUILD_MODE@" +config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") +config.llvm_libs_dir = lit_config.substitute("@LLVM_LIBS_DIR@") +config.llvm_build_mode = lit_config.substitute("@LLVM_BUILD_MODE@") config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.lldb_obj_root = "@LLDB_BINARY_DIR@" config.lldb_src_root = "@LLDB_SOURCE_DIR@" config.target_triple = "@LLVM_TARGET_TRIPLE@" config.python_executable = "@Python3_EXECUTABLE@" -# Support substitution of the tools and libs dirs with user parameters. This is -# used when we can't determine the tool dir at configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params - config.llvm_build_mode = config.llvm_build_mode % lit_config.params -except KeyError as e: - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) - import lit.llvm lit.llvm.initialize(lit_config, config) diff --git a/lldb/test/lit.site.cfg.py.in b/lldb/test/lit.site.cfg.py.in index e79f2fd0106a..5e1f60920638 100644 --- a/lldb/test/lit.site.cfg.py.in +++ b/lldb/test/lit.site.cfg.py.in @@ -2,25 +2,15 @@ config.llvm_src_root = "@LLVM_SOURCE_DIR@" config.llvm_obj_root = "@LLVM_BINARY_DIR@" -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.llvm_libs_dir = "@LLVM_LIBS_DIR@" -config.llvm_build_mode = "@LLVM_BUILD_MODE@" +config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") +config.llvm_libs_dir = lit_config.substitute("@LLVM_LIBS_DIR@") +config.llvm_build_mode = lit_config.substitute("@LLVM_BUILD_MODE@") config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.lldb_obj_root = "@LLDB_BINARY_DIR@" config.lldb_src_root = "@LLDB_SOURCE_DIR@" config.target_triple = "@LLVM_TARGET_TRIPLE@" config.python_executable = "@Python3_EXECUTABLE@" -# Support substitution of the tools and libs dirs with user parameters. This is -# used when we can't determine the tool dir at configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params - config.llvm_build_mode = config.llvm_build_mode % lit_config.params -except KeyError as e: - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) - import lit.llvm lit.llvm.initialize(lit_config, config) diff --git a/llvm/test/Unit/lit.site.cfg.py.in b/llvm/test/Unit/lit.site.cfg.py.in index 7fc93b403631..9535dde62aee 100644 --- a/llvm/test/Unit/lit.site.cfg.py.in +++ b/llvm/test/Unit/lit.site.cfg.py.in @@ -4,21 +4,10 @@ import sys config.llvm_src_root = path(r"@LLVM_SOURCE_DIR@") config.llvm_obj_root = path(r"@LLVM_BINARY_DIR@") -config.llvm_tools_dir = path(r"@LLVM_TOOLS_DIR@") -config.llvm_build_mode = "@LLVM_BUILD_MODE@" +config.llvm_tools_dir = lit_config.substitute(path(r"@LLVM_TOOLS_DIR@")) +config.llvm_build_mode = lit_config.substitute("@LLVM_BUILD_MODE@") config.enable_shared = @ENABLE_SHARED@ -config.shlibdir = path(r"@SHLIBDIR@") - -# Support substitution of the tools_dir and build_mode with user parameters. -# This is used when we can't determine the tool dir at configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_build_mode = config.llvm_build_mode % lit_config.params - config.shlibdir = config.shlibdir % lit_config.params -except KeyError: - e = sys.exc_info()[1] - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) +config.shlibdir = lit_config.substitute(path(r"@SHLIBDIR@")) # Let the main config do the real work. lit_config.load_config( diff --git a/llvm/test/lit.site.cfg.py.in b/llvm/test/lit.site.cfg.py.in index 233dd605a04b..393caff63a37 100644 --- a/llvm/test/lit.site.cfg.py.in +++ b/llvm/test/lit.site.cfg.py.in @@ -6,9 +6,9 @@ config.host_triple = "@LLVM_HOST_TRIPLE@" config.target_triple = "@LLVM_TARGET_TRIPLE@" config.llvm_src_root = path(r"@LLVM_SOURCE_DIR@") config.llvm_obj_root = path(r"@LLVM_BINARY_DIR@") -config.llvm_tools_dir = path(r"@LLVM_TOOLS_DIR@") -config.llvm_lib_dir = path(r"@LLVM_LIBS_DIR@") -config.llvm_shlib_dir = path(r"@SHLIBDIR@") +config.llvm_tools_dir = lit_config.substitute(path(r"@LLVM_TOOLS_DIR@")) +config.llvm_lib_dir = lit_config.substitute(path(r"@LLVM_LIBS_DIR@")) +config.llvm_shlib_dir = lit_config.substitute(path(r"@SHLIBDIR@")) config.llvm_shlib_ext = "@SHLIBEXT@" config.llvm_plugin_ext = "@LLVM_PLUGIN_EXT@" config.llvm_exe_ext = "@EXEEXT@" @@ -58,17 +58,6 @@ config.llvm_inliner_model_autogenerated = @LLVM_INLINER_MODEL_AUTOGENERATED@ config.llvm_raevict_model_autogenerated = @LLVM_RAEVICT_MODEL_AUTOGENERATED@ config.expensive_checks = @LLVM_ENABLE_EXPENSIVE_CHECKS@ -# Support substitution of the tools_dir with user parameters. This is -# used when we can't determine the tool dir at configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_lib_dir = config.llvm_lib_dir % lit_config.params - config.llvm_shlib_dir = config.llvm_shlib_dir % lit_config.params -except KeyError: - e = sys.exc_info()[1] - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) - import lit.llvm lit.llvm.initialize(lit_config, config) diff --git a/llvm/utils/lit/tests/lit.site.cfg.in b/llvm/utils/lit/tests/lit.site.cfg.in index 43f4e4002af6..5a253e5b55cb 100644 --- a/llvm/utils/lit/tests/lit.site.cfg.in +++ b/llvm/utils/lit/tests/lit.site.cfg.in @@ -5,16 +5,7 @@ import sys config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.llvm_src_root = "@LLVM_SOURCE_DIR@" config.llvm_obj_root = "@LLVM_BINARY_DIR@" -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" - -# Support substitution of the tools_dir with user parameters. -# This is used when we can't determine the tool dir at configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params -except KeyError: - e = sys.exc_info()[1] - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) +config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") import lit.llvm lit.llvm.initialize(lit_config, config) diff --git a/mlir/examples/standalone/test/lit.site.cfg.py.in b/mlir/examples/standalone/test/lit.site.cfg.py.in index 9a911f7ac8ed..840e61210cdb 100644 --- a/mlir/examples/standalone/test/lit.site.cfg.py.in +++ b/mlir/examples/standalone/test/lit.site.cfg.py.in @@ -6,9 +6,9 @@ config.host_triple = "@LLVM_HOST_TRIPLE@" config.target_triple = "@LLVM_TARGET_TRIPLE@" config.llvm_src_root = "@LLVM_SOURCE_DIR@" config.llvm_obj_root = "@LLVM_BINARY_DIR@" -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.llvm_lib_dir = "@LLVM_LIBS_DIR@" -config.llvm_shlib_dir = "@SHLIBDIR@" +config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") +config.llvm_lib_dir = lit_config.substitute("@LLVM_LIBS_DIR@") +config.llvm_shlib_dir = lit_config.substitute("@SHLIBDIR@") config.llvm_shlib_ext = "@SHLIBEXT@" config.llvm_exe_ext = "@EXEEXT@" config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" @@ -34,18 +34,6 @@ config.host_arch = "@HOST_ARCH@" config.standalone_src_root = "@CMAKE_SOURCE_DIR@" config.standalone_obj_root = "@CMAKE_BINARY_DIR@" -# Support substitution of the tools_dir with user parameters. This is -# used when we can't determine the tool dir at configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_lib_dir = config.llvm_lib_dir % lit_config.params - config.llvm_shlib_dir = config.llvm_shlib_dir % lit_config.params -except KeyError: - e = sys.exc_info()[1] - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) - - import lit.llvm lit.llvm.initialize(lit_config, config) diff --git a/mlir/test/Unit/lit.site.cfg.py.in b/mlir/test/Unit/lit.site.cfg.py.in index 5ad2f7dda8c2..42947a95187c 100644 --- a/mlir/test/Unit/lit.site.cfg.py.in +++ b/mlir/test/Unit/lit.site.cfg.py.in @@ -4,24 +4,13 @@ import sys config.llvm_src_root = "@LLVM_SOURCE_DIR@" config.llvm_obj_root = "@LLVM_BINARY_DIR@" -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.llvm_build_mode = "@LLVM_BUILD_MODE@" +config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") +config.llvm_build_mode = lit_config.substitute("@LLVM_BUILD_MODE@") config.enable_shared = @ENABLE_SHARED@ -config.shlibdir = "@SHLIBDIR@" +config.shlibdir = lit_config.substitute("@SHLIBDIR@") config.mlir_src_root = "@MLIR_SOURCE_DIR@" config.mlir_obj_root = "@MLIR_BINARY_DIR@" config.mlir_tools_dir = "@MLIR_TOOLS_DIR@" -# Support substitution of the tools_dir and build_mode with user parameters. -# This is used when we can't determine the tool dir at configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_build_mode = config.llvm_build_mode % lit_config.params - config.shlibdir = config.shlibdir % lit_config.params -except KeyError: - e = sys.exc_info()[1] - key, = e.args - 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, "@MLIR_SOURCE_DIR@/test/Unit/lit.cfg.py") diff --git a/mlir/test/lit.site.cfg.py.in b/mlir/test/lit.site.cfg.py.in index e6ad6ba69bfc..4ffa5b549f3e 100644 --- a/mlir/test/lit.site.cfg.py.in +++ b/mlir/test/lit.site.cfg.py.in @@ -6,9 +6,9 @@ config.host_triple = "@LLVM_HOST_TRIPLE@" config.target_triple = "@LLVM_TARGET_TRIPLE@" config.llvm_src_root = "@LLVM_SOURCE_DIR@" config.llvm_obj_root = "@LLVM_BINARY_DIR@" -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.llvm_lib_dir = "@LLVM_LIBS_DIR@" -config.llvm_shlib_dir = "@SHLIBDIR@" +config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") +config.llvm_lib_dir = lit_config.substitute("@LLVM_LIBS_DIR@") +config.llvm_shlib_dir = lit_config.substitute("@SHLIBDIR@") config.llvm_shlib_ext = "@SHLIBEXT@" config.llvm_exe_ext = "@EXEEXT@" config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" @@ -55,17 +55,6 @@ config.mlir_run_x86vector_tests = @MLIR_RUN_X86VECTOR_TESTS@ config.mlir_run_cuda_tensor_core_tests = @MLIR_RUN_CUDA_TENSOR_CORE_TESTS@ config.mlir_include_integration_tests = @MLIR_INCLUDE_INTEGRATION_TESTS@ -# Support substitution of the tools_dir with user parameters. This is -# used when we can't determine the tool dir at configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_lib_dir = config.llvm_lib_dir % lit_config.params - config.llvm_shlib_dir = config.llvm_shlib_dir % lit_config.params -except KeyError: - e = sys.exc_info()[1] - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) - import lit.llvm lit.llvm.initialize(lit_config, config) diff --git a/polly/test/Unit/lit.site.cfg.in b/polly/test/Unit/lit.site.cfg.in index 28bf5e70e68b..75420db8d30c 100644 --- a/polly/test/Unit/lit.site.cfg.in +++ b/polly/test/Unit/lit.site.cfg.in @@ -4,9 +4,9 @@ import sys config.llvm_src_root = "@LLVM_SOURCE_DIR@" config.llvm_obj_root = "@LLVM_BINARY_DIR@" -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.llvm_libs_dir = "@LLVM_LIBS_DIR@" -config.llvm_build_mode = "@LLVM_BUILD_MODE@" +config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") +config.llvm_libs_dir = lit_config.substitute("@LLVM_LIBS_DIR@") +config.llvm_build_mode = lit_config.substitute("@LLVM_BUILD_MODE@") config.polly_obj_root = "@POLLY_BINARY_DIR@" config.polly_lib_dir = "@POLLY_LIB_DIR@" config.enable_shared = @ENABLE_SHARED@ @@ -16,17 +16,5 @@ config.enable_gpgpu_codegen = "@GPU_CODEGEN@" config.llvm_polly_link_into_tools = "@LLVM_POLLY_LINK_INTO_TOOLS@" config.has_unittests = @POLLY_GTEST_AVAIL@ -# Support substitution of the tools_dir, libs_dirs, and build_mode with user -# parameters. This is used when we can't determine the tool dir at -# configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params - config.llvm_build_mode = config.llvm_build_mode % lit_config.params -except KeyError: - e = sys.exc_info()[1] - key, = e.args - 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, "@POLLY_SOURCE_DIR@/test/Unit/lit.cfg") diff --git a/polly/test/lit.site.cfg.in b/polly/test/lit.site.cfg.in index 4a97cf67356f..44e9213d9a1c 100644 --- a/polly/test/lit.site.cfg.in +++ b/polly/test/lit.site.cfg.in @@ -2,8 +2,8 @@ config.llvm_src_root = "@LLVM_SOURCE_DIR@" config.llvm_obj_root = "@LLVM_BINARY_DIR@" -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.llvm_libs_dir = "@LLVM_LIBS_DIR@" +config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") +config.llvm_libs_dir = lit_config.substitute("@LLVM_LIBS_DIR@") config.polly_obj_root = "@POLLY_BINARY_DIR@" config.polly_lib_dir = "@POLLY_LIB_DIR@" config.target_triple = "@LLVM_TARGET_TRIPLE@" @@ -21,16 +21,6 @@ if (re.match(r'^x86_64*', '@LLVM_TARGET_TRIPLE@') == None) : for arch in config.targets_to_build.split(): config.available_features.add(arch.lower() + '-registered-target') -# Support substitution of the tools and libs dirs with user parameters. This is -# used when we can't determine the tool dir at configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params -except KeyError: - e = sys.exc_info()[1] - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) - # excludes: A list of directories to exclude from the testsuite. The 'Inputs' # subdirectories contain auxiliary inputs for various tests in their parent # directories.