1
0
Fork 0

use Google Test framework for unit tests

This commit is contained in:
Kevin Matz 2021-08-18 11:45:51 -04:00
parent c552fba1ba
commit 507a2352ff
2 changed files with 19 additions and 0 deletions

View File

@ -20,6 +20,12 @@ set(CMAKE_AUTOUIC OFF)
set(CMAKE_AUTOMOC OFF)
set(CMAKE_AUTORCC OFF)
find_package(GTest REQUIRED)
file(GLOB SRCS test/*.cpp)
add_executable(Tests ${SRCS})
target_link_libraries(Tests GTest::GTest)
gtest_discover_tests(Tests)
set(SOURCE_FILES
acn/appliance.cpp
acn/appliance.h

13
test/test.cpp Normal file
View File

@ -0,0 +1,13 @@
#include <gtest/gtest.h>
#include <iostream>
TEST(gtest, helloworld) {
std::cout << "Hello world!" << std::endl;
// Google Test will also provide macros for assertions.
ASSERT_EQ(1+1, 2);
}
int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}