beanz created this revision.
beanz added reviewers: tfiala, zturner.
beanz added a subscriber: lldb-commits.
Herald added a subscriber: mgorny.

This patch adds the following fixes to the check-lldb targets:

- Adds missing dependencies on lldb tools so they get built before tests execute
- Adds Ninja USES_TERMINAL to the target so that the output streams to stdout 
as it executes
- Uses a generator expression to find the lldb executable, this is more robust 
than constructing the path manually


https://reviews.llvm.org/D25490

Files:
  test/CMakeLists.txt


Index: test/CMakeLists.txt
===================================================================
--- test/CMakeLists.txt
+++ test/CMakeLists.txt
@@ -8,9 +8,25 @@
   add_custom_target(${name}
     COMMAND ${PYTHON_TEST_COMMAND} ${ARG_DEFAULT_ARGS}
     COMMENT "${comment}"
+    DEPENDS ${LLDB_TEST_DEPS}
+    USES_TERMINAL
     )
 endfunction()
 
+set(LLDB_TEST_DEPS lldb)
+
+if(TARGET lldb-server)
+  list(APPEND LLDB_TEST_DEPS lldb-server)
+endif()
+  
+if(TARGET debugserver)
+  list(APPEND LLDB_TEST_DEPS debugserver)
+endif()
+
+if(TARGET lldb-mi)
+  list(APPEND LLDB_TEST_DEPS lldb-mi)
+endif()
+
 if ("${LLDB_TEST_COMPILER}" STREQUAL "")
     string(REGEX REPLACE ".*ccache\ +" "" LLDB_TEST_COMPILER 
${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1})
 endif()
@@ -34,8 +50,7 @@
 
 set(LLDB_TEST_COMMON_ARGS
   --arch=${LLDB_TEST_ARCH}
-  --executable
-  ${CMAKE_BINARY_DIR}/bin/lldb${CMAKE_EXECUTABLE_SUFFIX}
+  --executable $<TARGET_FILE:lldb>
   -s
   ${CMAKE_BINARY_DIR}/lldb-test-traces
   -S nm


Index: test/CMakeLists.txt
===================================================================
--- test/CMakeLists.txt
+++ test/CMakeLists.txt
@@ -8,9 +8,25 @@
   add_custom_target(${name}
     COMMAND ${PYTHON_TEST_COMMAND} ${ARG_DEFAULT_ARGS}
     COMMENT "${comment}"
+    DEPENDS ${LLDB_TEST_DEPS}
+    USES_TERMINAL
     )
 endfunction()
 
+set(LLDB_TEST_DEPS lldb)
+
+if(TARGET lldb-server)
+  list(APPEND LLDB_TEST_DEPS lldb-server)
+endif()
+  
+if(TARGET debugserver)
+  list(APPEND LLDB_TEST_DEPS debugserver)
+endif()
+
+if(TARGET lldb-mi)
+  list(APPEND LLDB_TEST_DEPS lldb-mi)
+endif()
+
 if ("${LLDB_TEST_COMPILER}" STREQUAL "")
     string(REGEX REPLACE ".*ccache\ +" "" LLDB_TEST_COMPILER ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1})
 endif()
@@ -34,8 +50,7 @@
 
 set(LLDB_TEST_COMMON_ARGS
   --arch=${LLDB_TEST_ARCH}
-  --executable
-  ${CMAKE_BINARY_DIR}/bin/lldb${CMAKE_EXECUTABLE_SUFFIX}
+  --executable $<TARGET_FILE:lldb>
   -s
   ${CMAKE_BINARY_DIR}/lldb-test-traces
   -S nm
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to