[Lldb-commits] [lldb] 8f9eb70 - [lldb/Test] Fix unit test suffixes and add a CMake error.

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Fri Jun 12 14:18:34 PDT 2020


Author: Jonas Devlieghere
Date: 2020-06-12T14:18:27-07:00
New Revision: 8f9eb7035344715194d73272b2f15205ea362f58

URL: https://github.com/llvm/llvm-project/commit/8f9eb7035344715194d73272b2f15205ea362f58
DIFF: https://github.com/llvm/llvm-project/commit/8f9eb7035344715194d73272b2f15205ea362f58.diff

LOG: [lldb/Test] Fix unit test suffixes and add a CMake error.

Lit will only look for unittest targets ending in `Tests`. Add an error
when the target doesn't have the `Tests` suffix.

Added: 
    

Modified: 
    lldb/unittests/CMakeLists.txt
    lldb/unittests/Platform/Android/CMakeLists.txt
    lldb/unittests/Process/Linux/CMakeLists.txt
    lldb/unittests/Process/POSIX/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/lldb/unittests/CMakeLists.txt b/lldb/unittests/CMakeLists.txt
index 52f5c964fcee..6422b726ca69 100644
--- a/lldb/unittests/CMakeLists.txt
+++ b/lldb/unittests/CMakeLists.txt
@@ -33,6 +33,10 @@ function(add_lldb_unittest test_name)
     "LINK_LIBS;LINK_COMPONENTS"
     ${ARGN})
 
+  if (NOT ${test_name} MATCHES "Tests$")
+    message(FATAL_ERROR "Unit test name must end with 'Tests' for lit to find it.")
+  endif()
+
   list(APPEND LLVM_LINK_COMPONENTS ${ARG_LINK_COMPONENTS})
 
   add_unittest(LLDBUnitTests

diff  --git a/lldb/unittests/Platform/Android/CMakeLists.txt b/lldb/unittests/Platform/Android/CMakeLists.txt
index 3de2a2d12016..489fdab7036c 100644
--- a/lldb/unittests/Platform/Android/CMakeLists.txt
+++ b/lldb/unittests/Platform/Android/CMakeLists.txt
@@ -1,6 +1,6 @@
 include_directories(${LLDB_SOURCE_DIR}/source/Plugins/Platform/Android)
 
-add_lldb_unittest(AdbClientTest
+add_lldb_unittest(AdbClientTests
   AdbClientTest.cpp
 
   LINK_LIBS

diff  --git a/lldb/unittests/Process/Linux/CMakeLists.txt b/lldb/unittests/Process/Linux/CMakeLists.txt
index 3b55b5c84305..31e9a57a4e46 100644
--- a/lldb/unittests/Process/Linux/CMakeLists.txt
+++ b/lldb/unittests/Process/Linux/CMakeLists.txt
@@ -1,6 +1,6 @@
 include_directories(${LLDB_SOURCE_DIR}/source/Plugins/Process/Linux)
 
-add_lldb_unittest(ProcessorTraceTest
+add_lldb_unittest(ProcessorTraceTests
   ProcessorTraceTest.cpp
 
   LINK_LIBS

diff  --git a/lldb/unittests/Process/POSIX/CMakeLists.txt b/lldb/unittests/Process/POSIX/CMakeLists.txt
index 53318d908da7..eabfb58d46fc 100644
--- a/lldb/unittests/Process/POSIX/CMakeLists.txt
+++ b/lldb/unittests/Process/POSIX/CMakeLists.txt
@@ -1,6 +1,6 @@
 include_directories(${LLDB_SOURCE_DIR}/source/Plugins/Process/POSIX)
 
-add_lldb_unittest(ProcessPOSIXTest
+add_lldb_unittest(ProcessPOSIXTests
   NativeProcessELFTest.cpp
 
   LINK_LIBS


        


More information about the lldb-commits mailing list