[PATCH] D44002: [test] Add dotest wrapper

Jonas Devlieghere via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 2 03:51:35 PST 2018


JDevlieghere created this revision.
JDevlieghere added reviewers: labath, aprantl, davide, jingham.
Herald added a subscriber: mgorny.

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.

Please let me know what you think about this!


Repository:
  rL LLVM

https://reviews.llvm.org/D44002

Files:
  test/CMakeLists.txt
  test/dotest.in


Index: test/dotest.in
===================================================================
--- /dev/null
+++ test/dotest.in
@@ -0,0 +1,3 @@
+#!/usr/bin/env sh
+
+ at LLDB_SOURCE_DIR@/test/dotest.py -q @LLDB_DOTEST_ARGS_STR@ $@
Index: test/CMakeLists.txt
===================================================================
--- test/CMakeLists.txt
+++ test/CMakeLists.txt
@@ -129,6 +129,21 @@
   "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(
+  dotest.in
+  ${CMAKE_CURRENT_BINARY_DIR}/dotest.configured
+  )
+# We need this to expand the generator expressions.
+file(GENERATE
+  OUTPUT
+  $<TARGET_FILE_DIR:lldb>/dotest
+  INPUT
+  ${CMAKE_CURRENT_BINARY_DIR}/dotest.configured
+  )
+
 # If we're building with an in-tree clang, then list clang as a dependency
 # to run tests.
 if (TARGET clang)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44002.136713.patch
Type: text/x-patch
Size: 1012 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180302/edaed7e1/attachment.bin>


More information about the llvm-commits mailing list