dlj created this revision.
dlj added projects: lld, clang.
Herald added subscribers: mehdi_amini, sanjoy.

The GoogleTest lit format accepts two parameters to its constructor: a 
subdirectory to find test binaries, and a required suffix for the test 
filenames. Typically, the config should look like this:

  config.test_format = lit.formats.GoogleTest('.', 'Tests')

This will search the current directory for filenames ending with 'Tests', and 
run the matching binaries it finds as GoogleTests. It appears that several lit 
configs pass a different value for the subdirectory, however. They use 
"config.llvm_build_mode", which would be set by @LLVM_BUILD_MODE@, but never 
is. Fortunately, this means that the Python lookup passes and finds an empty 
string, which means that lit searches the current directory.

I can imagine cases where looking for a build-specific subdirectory might have 
worked in the paste, but I suspect it is no longer the right behaviour to check 
with cmake. So, I'm removing the (somewhat confusing) LLVM_BUILD_MODE logic 
altogether.


Repository:
  rL LLVM

https://reviews.llvm.org/D34853

Files:
  cfe/trunk/test/Unit/lit.cfg
  cfe/trunk/test/Unit/lit.site.cfg.in
  compiler-rt/trunk/test/lit.common.configured.in
  compiler-rt/trunk/unittests/lit.common.unit.cfg
  compiler-rt/trunk/unittests/lit.common.unit.configured.in
  lld/trunk/test/Unit/lit.cfg
  lld/trunk/test/Unit/lit.site.cfg.in
  lldb/trunk/lit/Unit/lit.site.cfg.in
  llvm/trunk/test/Unit/lit.site.cfg.in

Index: llvm/trunk/test/Unit/lit.site.cfg.in
===================================================================
--- llvm/trunk/test/Unit/lit.site.cfg.in
+++ llvm/trunk/test/Unit/lit.site.cfg.in
@@ -5,15 +5,13 @@
 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.enable_shared = @ENABLE_SHARED@
 config.shlibdir = "@SHLIBDIR@"
 
-# Support substitution of the tools_dir and build_mode with user parameters.
+# 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_build_mode = config.llvm_build_mode % lit_config.params
 except KeyError:
     e = sys.exc_info()[1]
     key, = e.args
Index: lldb/trunk/lit/Unit/lit.site.cfg.in
===================================================================
--- lldb/trunk/lit/Unit/lit.site.cfg.in
+++ lldb/trunk/lit/Unit/lit.site.cfg.in
@@ -5,7 +5,6 @@
 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.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
 config.lldb_obj_root = "@LLDB_BINARY_DIR@"
 config.lldb_src_root = "@LLDB_SOURCE_DIR@"
@@ -17,7 +16,6 @@
 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))
Index: lld/trunk/test/Unit/lit.site.cfg.in
===================================================================
--- lld/trunk/test/Unit/lit.site.cfg.in
+++ lld/trunk/test/Unit/lit.site.cfg.in
@@ -4,7 +4,6 @@
 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.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
 config.lld_obj_root = "@LLD_BINARY_DIR@"
 config.lld_src_root = "@LLD_SOURCE_DIR@"
@@ -16,7 +15,6 @@
 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))
Index: lld/trunk/test/Unit/lit.cfg
===================================================================
--- lld/trunk/test/Unit/lit.cfg
+++ lld/trunk/test/Unit/lit.cfg
@@ -18,6 +18,4 @@
 config.test_exec_root = config.test_source_root
 
 # testFormat: The test format to use to interpret tests.
-if not hasattr(config, 'llvm_build_mode'):
-    lit_config.fatal("unable to find llvm_build_mode value on config")
-config.test_format = lit.formats.GoogleTest(config.llvm_build_mode, 'Tests')
+config.test_format = lit.formats.GoogleTest('.', 'Tests')
Index: compiler-rt/trunk/unittests/lit.common.unit.configured.in
===================================================================
--- compiler-rt/trunk/unittests/lit.common.unit.configured.in
+++ compiler-rt/trunk/unittests/lit.common.unit.configured.in
@@ -7,15 +7,13 @@
 config.llvm_tools_dir = "@LLVM_TOOLS_BINARY_DIR@"
 config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@"
 config.compiler_rt_libdir = "@COMPILER_RT_LIBRARY_OUTPUT_DIR@"
-config.llvm_build_mode = "@LLVM_BUILD_MODE@"
 config.host_arch = "@HOST_ARCH@"
 config.host_os = "@HOST_OS@"
 
 # 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.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))
Index: compiler-rt/trunk/unittests/lit.common.unit.cfg
===================================================================
--- compiler-rt/trunk/unittests/lit.common.unit.cfg
+++ compiler-rt/trunk/unittests/lit.common.unit.cfg
@@ -9,8 +9,7 @@
 import lit.formats
 
 # Setup test format
-llvm_build_mode = getattr(config, "llvm_build_mode", "Debug")
-config.test_format = lit.formats.GoogleTest(llvm_build_mode, "Test")
+config.test_format = lit.formats.GoogleTest('.', "Test")
 
 # Setup test suffixes.
 config.suffixes = []
Index: compiler-rt/trunk/test/lit.common.configured.in
===================================================================
--- compiler-rt/trunk/test/lit.common.configured.in
+++ compiler-rt/trunk/test/lit.common.configured.in
@@ -11,7 +11,6 @@
 set_default("host_arch", "@HOST_ARCH@")
 set_default("target_arch", "@COMPILER_RT_DEFAULT_TARGET_ARCH@")
 set_default("host_os", "@HOST_OS@")
-set_default("llvm_build_mode", "@LLVM_BUILD_MODE@")
 set_default("llvm_src_root", "@LLVM_MAIN_SRC_DIR@")
 set_default("llvm_obj_root", "@LLVM_BINARY_DIR@")
 set_default("compiler_rt_src_root", "@COMPILER_RT_SOURCE_DIR@")
Index: cfe/trunk/test/Unit/lit.site.cfg.in
===================================================================
--- cfe/trunk/test/Unit/lit.site.cfg.in
+++ cfe/trunk/test/Unit/lit.site.cfg.in
@@ -6,19 +6,17 @@
 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.clang_obj_root = "@CLANG_BINARY_DIR@"
 config.enable_shared = @ENABLE_SHARED@
 config.shlibdir = "@SHLIBDIR@"
 config.target_triple = "@TARGET_TRIPLE@"
 
-# Support substitution of the tools_dir, libs_dirs, and build_mode with user
+# Support substitution of the tools_dir, 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:
     e = sys.exc_info()[1]
     key, = e.args
Index: cfe/trunk/test/Unit/lit.cfg
===================================================================
--- cfe/trunk/test/Unit/lit.cfg
+++ cfe/trunk/test/Unit/lit.cfg
@@ -22,8 +22,7 @@
     config.test_source_root = config.test_exec_root
 
 # testFormat: The test format to use to interpret tests.
-llvm_build_mode = getattr(config, 'llvm_build_mode', "Debug")
-config.test_format = lit.formats.GoogleTest(llvm_build_mode, 'Tests')
+config.test_format = lit.formats.GoogleTest('.', 'Tests')
 
 # Propagate the temp directory. Windows requires this because it uses \Windows\
 # if none of these are present.
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to