[Openmp-commits] [openmp] [OpenMP] Add unit tests for nextgen plugins (PR #74398)

Johannes Doerfert via Openmp-commits openmp-commits at lists.llvm.org
Tue Dec 19 16:17:26 PST 2023


================
@@ -123,3 +123,9 @@ add_subdirectory(tools)
 
 # Add tests.
 add_subdirectory(test)
+
+# Add unit tests if GMock/GTest is present
+if (EXISTS ${LLVM_THIRD_PARTY_DIR}/unittest)
+  add_subdirectory(${LLVM_THIRD_PARTY_DIR}/unittest ${CMAKE_CURRENT_BINARY_DIR}/third-party/unittest)
+  add_subdirectory(unittests)
+endif()
----------------
jdoerfert wrote:

lld just does this:
` llvm_add_unittests(LLD_UNITTESTS_ADDED)`
See
https://github.com/llvm/llvm-project/blob/394274965a119973612c25e0eaf299c8954cce94/lld/CMakeLists.txt#L195
and

https://github.com/llvm/llvm-project/blob/394274965a119973612c25e0eaf299c8954cce94/llvm/cmake/modules/AddLLVM.cmake#L2497C2-L2497C2

We should check if we can do the same, reducing the logic we carry.


https://github.com/llvm/llvm-project/pull/74398


More information about the Openmp-commits mailing list