[PATCH] D44080: [XRay][compiler-rt] Make unit tests depend on implementation files

Dean Michael Berris via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 6 15:10:37 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rCRT326842: [XRay][compiler-rt] Make unit tests depend on implementation files (authored by dberris, committed by ).
Herald added a subscriber: Sanitizers.

Changed prior to commit:
  https://reviews.llvm.org/D44080?vs=136945&id=137280#toc

Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D44080

Files:
  lib/xray/tests/CMakeLists.txt


Index: lib/xray/tests/CMakeLists.txt
===================================================================
--- lib/xray/tests/CMakeLists.txt
+++ lib/xray/tests/CMakeLists.txt
@@ -3,6 +3,12 @@
 add_custom_target(XRayUnitTests)
 set_target_properties(XRayUnitTests PROPERTIES FOLDER "XRay unittests")
 
+# Create an XRAY_IMPL_FILES variable which will include all the implementation
+# files that are in the lib directory. Unfortunately, when new files are added
+# to the implementation, CMake must be run so that this variable is
+# re-generated.
+file(GLOB XRAY_IMPL_FILES "../*.cc" "../*.h")
+
 set(XRAY_UNITTEST_CFLAGS
   ${XRAY_CFLAGS}
   ${COMPILER_RT_UNITTEST_CFLAGS}
@@ -24,6 +30,11 @@
       generate_compiler_rt_tests(TEST_OBJECTS
         XRayUnitTests "${testname}-${arch}-Test" "${arch}"
         SOURCES ${TEST_SOURCES} ${COMPILER_RT_GTEST_SOURCE}
+        # Note that any change in the implementations will cause all the unit
+        # tests to be re-built. This is by design, but may be cumbersome during
+        # the build/test cycle.
+        COMPILE_DEPS ${TEST_SOURCES} ${COMPILER_RT_GTEST_SOURCE}
+        ${XRAY_HEADERS} ${XRAY_IMPL_FILES}
         DEPS gtest xray llvm-xray
         CFLAGS ${XRAY_UNITTEST_CFLAGS}
         LINK_FLAGS -fxray-instrument


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44080.137280.patch
Type: text/x-patch
Size: 1275 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180306/52e4c89a/attachment.bin>


More information about the llvm-commits mailing list