[Openmp-commits] [openmp] [OpenMP] Add libomp unit test infrastructure (PR #168063)
Michael Kruse via Openmp-commits
openmp-commits at lists.llvm.org
Tue Dec 2 14:29:52 PST 2025
================
@@ -0,0 +1,42 @@
+add_custom_target(OpenMPUnitTests)
+set_target_properties(OpenMPUnitTests PROPERTIES FOLDER "OpenMP/Tests")
+
+if(NOT TARGET llvm_gtest)
+ message(WARNING "OpenMP unittests disabled due to GTest being unavailable; "
+ "Try LLVM_INSTALL_GTEST=ON for the LLVM build")
+ return()
+endif()
+if(NOT TARGET omp_testing)
+ message(WARNING "OpenMP unittests disabled due to omp_testing library being unavailable")
+ return()
+endif()
+
+function(add_openmp_unittest test_filename)
----------------
Meinersbur wrote:
```suggestion
function(add_openmp_unittest test_name)
```
`test_name` is also used by LLVM's `add_unittest`. `test_filename` is not accurate because depending on the platform, a suffix might be added to get the filename, and/or the target filename is modified using the `OUTPUT_NAME` property.
https://github.com/llvm/llvm-project/pull/168063
More information about the Openmp-commits
mailing list