[TSAN][CMake] Add support to run lit on individual tests
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Mon, 24 May 2021 22:43:56 +0000 (15:43 -0700)
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Tue, 25 May 2021 19:33:02 +0000 (12:33 -0700)
Handy when testing specific files, already supported in other components.

Example:
cd build; ./bin/llvm-lit ../compiler-rt/test/tsan/ignore_free.cpp

Differential Revision: https://reviews.llvm.org/D103054

compiler-rt/test/tsan/CMakeLists.txt

index 67e20e5..c8f8eba 100644 (file)
@@ -44,7 +44,10 @@ foreach(arch ${TSAN_TEST_ARCH})
 
   configure_lit_site_cfg(
     ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
-    ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg.py)
+    ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg.py
+    MAIN_CONFIG
+    ${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py
+    )
   list(APPEND TSAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME})
 endforeach()