##===----------------------------------------------------------------------===##
#
# Add ompTest unit tests to check-openmp.
#
##===----------------------------------------------------------------------===##

# Target: ompTest library unit tests
set(UNITTEST_SOURCES
  unittests/asserter-seq-test.cpp
  unittests/internal-event-eq-test.cpp
  unittests/internal-event-tostring-test.cpp
  unittests/internal-util-test.cpp
  unittests/main-test.cpp
)
add_executable(omptest-unittests ${UNITTEST_SOURCES})

# Add local and LLVM-provided GoogleTest include directories.
target_include_directories(omptest-unittests PRIVATE
  ../include
  ${LLVM_THIRD_PARTY_DIR}/unittest/googletest/include)

target_link_libraries(omptest-unittests PRIVATE omptest)

set_target_properties(omptest-unittests PROPERTIES
  RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})

# Add ompTest unit tests to check-openmp
add_openmp_testsuite(check-ompt-omptest "Running OMPT ompTest unit tests"
  ${CMAKE_CURRENT_BINARY_DIR} DEPENDS omptest-unittests)

# Configure the lit.site.cfg.in file
set(AUTO_GEN_COMMENT "## Autogenerated by OPENMP_TOOLS_OMPTEST_TEST "
                     "configuration.\n# Do not edit!")
configure_file(lit.site.cfg.in lit.site.cfg @ONLY)
