diff options
author | hsdk123 <[email protected]> | 2023-06-11 23:31:03 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2023-06-12 03:31:03 +0000 |
commit | 2d86d8b84fa54df4f6ce5e4942e617164cb5cc6d (patch) | |
tree | 9e53fc6ed81cd4b4043423eeeacf10f4aad860bf /tests/CMakeLists.txt | |
parent | 3d9900476ec49b2994b7163a451a69560d498306 (diff) |
Add gtest integration (#860)
* Add gtest integration
* Update gtest fetch
* Add ctest
* Update CI
* Update CI
* enable testing
* Make tests off by default
* Update gitignore
Diffstat (limited to 'tests/CMakeLists.txt')
-rw-r--r-- | tests/CMakeLists.txt | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 00000000..492587e8 --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,24 @@ +add_executable(OpenAL_Tests)
+
+include(FetchContent)
+FetchContent_Declare(
+ googletest
+ GIT_REPOSITORY https://github.com/google/googletest.git
+ GIT_TAG main
+)
+# For Windows: Prevent overriding the parent project's compiler/linker settings
+set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
+FetchContent_MakeAvailable(googletest)
+
+target_link_libraries(OpenAL_Tests PRIVATE
+ OpenAL
+ GTest::gtest_main
+)
+
+target_sources(OpenAL_Tests PRIVATE
+example.t.cpp
+)
+
+# This needs to come last
+include(GoogleTest)
+gtest_discover_tests(OpenAL_Tests)
|