use Google Test framework for unit tests
This commit is contained in:
parent
c552fba1ba
commit
507a2352ff
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
}
|
Loading…
Reference in New Issue