[Lldb-commits] [lldb] r326687 - [test] Add dotest wrapper

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Mon Mar 5 02:03:44 PST 2018


Author: jdevlieghere
Date: Mon Mar  5 02:03:44 2018
New Revision: 326687

URL: http://llvm.org/viewvc/llvm-project?rev=326687&view=rev
Log:
[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

Added:
    lldb/trunk/test/llvm-dotest.in   (with props)
Modified:
    lldb/trunk/test/CMakeLists.txt

Modified: lldb/trunk/test/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/CMakeLists.txt?rev=326687&r1=326686&r2=326687&view=diff
==============================================================================
--- lldb/trunk/test/CMakeLists.txt (original)
+++ lldb/trunk/test/CMakeLists.txt Mon Mar  5 02:03:44 2018
@@ -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)

Added: lldb/trunk/test/llvm-dotest.in
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/llvm-dotest.in?rev=326687&view=auto
==============================================================================
--- lldb/trunk/test/llvm-dotest.in (added)
+++ lldb/trunk/test/llvm-dotest.in Mon Mar  5 02:03:44 2018
@@ -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)

Propchange: lldb/trunk/test/llvm-dotest.in
------------------------------------------------------------------------------
    svn:executable = *




More information about the lldb-commits mailing list