summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2018-03-05 10:03:44 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2018-03-05 10:03:44 +0000
commita52cb80db6b6d7429e9364c2d852b51d051464bf (patch)
tree15b432b373719246ee366dbb161fbabc17427478
parent7b91e2133e01026b12e71c8e4aa1dfe43cd8d24a (diff)
downloadbcm5719-llvm-a52cb80db6b6d7429e9364c2d852b51d051464bf.tar.gz
bcm5719-llvm-a52cb80db6b6d7429e9364c2d852b51d051464bf.zip
[test] Add dotest wrapper
This adds a wrapper around dotest, similar to llvm-lit in llvm. The wrapper is created in the binary directory, next to LLDB and allows you to invoke dotest without having to pass any of the configuration arguments yourself. I think this could also be useful for re-running a particular test case when it fails, as an alternative to "Command Invoked". The motivation for this is that I'd like to replace the driver part of dotest with lit. As a first step, I'd like to have lit invoke dotest, which would just run the complete test suite, completely identical to what the CMake target does today. Once this is in place, we can have lit run dotest for the different test directories, and ultimately once per python file. Along the way we can strip out driver functionality from dotest where appropriate. https://reviews.llvm.org/D44002 llvm-svn: 326687
-rw-r--r--lldb/test/CMakeLists.txt19
-rwxr-xr-xlldb/test/llvm-dotest.in14
2 files changed, 31 insertions, 2 deletions
diff --git a/lldb/test/CMakeLists.txt b/lldb/test/CMakeLists.txt
index d41e75fbe78..38a50a9808c 100644
--- a/lldb/test/CMakeLists.txt
+++ b/lldb/test/CMakeLists.txt
@@ -25,7 +25,7 @@ endif()
if(TARGET lldb-server)
list(APPEND LLDB_TEST_DEPS lldb-server)
endif()
-
+
if(TARGET debugserver)
if(NOT CMAKE_HOST_APPLE OR LLDB_CODESIGN_IDENTITY)
list(APPEND LLDB_TEST_DEPS debugserver)
@@ -78,7 +78,7 @@ set(LLDB_TEST_COMMON_ARGS
if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
# All tests are currently flaky on Windows, so rerun them all once when they fail.
set(LLDB_TEST_COMMON_ARGS ${LLDB_TEST_COMMON_ARGS} --rerun-all-issues)
-
+
set(LLDB_TEST_DEBUG_TEST_CRASHES
0
CACHE BOOL "(Windows only) Enables debugging of tests in the test suite by showing the crash dialog when lldb crashes")
@@ -129,6 +129,21 @@ add_python_test_target(check-lldb
"Testing LLDB (parallel execution, with a separate subprocess per test)"
)
+# Generate a wrapper for dotest.py in the bin directory.
+string (REPLACE ";" " " LLDB_DOTEST_ARGS_STR "${LLDB_DOTEST_ARGS}")
+# We need this to substitute variables.
+configure_file(
+ llvm-dotest.in
+ ${CMAKE_CURRENT_BINARY_DIR}/llvm-dotest.configured
+ )
+# We need this to expand the generator expressions.
+file(GENERATE
+ OUTPUT
+ $<TARGET_FILE_DIR:lldb>/llvm-dotest
+ INPUT
+ ${CMAKE_CURRENT_BINARY_DIR}/llvm-dotest.configured
+ )
+
# If we're building with an in-tree clang, then list clang as a dependency
# to run tests.
if (TARGET clang)
diff --git a/lldb/test/llvm-dotest.in b/lldb/test/llvm-dotest.in
new file mode 100755
index 00000000000..b6a108025fb
--- /dev/null
+++ b/lldb/test/llvm-dotest.in
@@ -0,0 +1,14 @@
+#!/usr/bin/env python
+import sys
+import os
+
+dotest_path = '@LLDB_SOURCE_DIR@/test/dotest.py'
+dotest_args = '@LLDB_DOTEST_ARGS_STR@'
+
+if __name__ == '__main__':
+ # FIXME: It would be nice if we can mimic the approach taken by llvm-lit
+ # and pass a python configuration straight to dotest, rather than going
+ # through the operating system.
+ command = '{} -q {} {}'.format(dotest_path, dotest_args, ' '.join(
+ sys.argv[1:]))
+ os.system(command)
OpenPOWER on IntegriCloud