From a3cf21eace6d6aa3251ab0762a169c8e61c2b349 Mon Sep 17 00:00:00 2001 From: Charlie Kushelevsky Date: Wed, 29 May 2024 14:55:38 -0700 Subject: [PATCH] test: added googletest submodule and cmake files --- .gitmodules | 3 +++ gtests/CMakeLists.txt | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 gtests/CMakeLists.txt diff --git a/.gitmodules b/.gitmodules index f6fd5ee3..64666f60 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "lib/SparkFun_ICM-20948_ParticleLibrary"] path = lib/SparkFun_ICM-20948_ParticleLibrary url = https://github.com/UCSD-E4E/SparkFun_ICM-20948_ParticleLibrary.git +[submodule "external/googletest"] + path = external/googletest + url = https://github.com/google/googletest.git diff --git a/gtests/CMakeLists.txt b/gtests/CMakeLists.txt new file mode 100644 index 00000000..55934058 --- /dev/null +++ b/gtests/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.14) +project(TestScheduler) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +add_definitions(-DTEST_VERSION=1 -DGTESTING=1) +include_directories($ENV{HOME}/local/include) +link_directories($ENV{HOME}/local/lib) + +set(SOURCE_FILES + ../tests/scheduler_test_system.cpp + ../src/scheduler.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/scheduler_functions.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/gtest.cpp) + +add_executable(test_scheduler.o ${SOURCE_FILES}) +target_link_libraries(test_scheduler.o gtest gtest_main pthread) \ No newline at end of file