diff --git a/.template_files/test_module/CMakeLists.txt b/.template_files/test_module/CMakeLists.txt new file mode 100644 index 0000000..bbac328 --- /dev/null +++ b/.template_files/test_module/CMakeLists.txt @@ -0,0 +1,23 @@ +# File: tests/module_name/CMakeLists.txt + +add_subdirectory(mocks) +add_subdirectory(fakes) +add_subdirectory(stubs) + +# TEST_RUNNER +add_library(test_module_name + test_module_name.cpp +) + +target_link_libraries(test_module_name + ${CPPUTEST_LIBRARIES} + module_name +) + +target_include_directories(test_module_name PUBLIC + ${CMAKE_CURRENT_LIST_DIR} + #Next comes the shared and non-module specific test depencencies. + ${CMAKE_SOURCE_DIR}/tests/shared/mocks/ + ${CMAKE_SOURCE_DIR}/tests/shared/fakes/ + ${CMAKE_SOURCE_DIR}/tests/shared/stubs/ +) diff --git a/.template_files/test_module/fakes/CMakeLists.txt b/.template_files/test_module/fakes/CMakeLists.txt new file mode 100644 index 0000000..e69de29 diff --git a/.template_files/test_module/mocks/CMakeLists.txt b/.template_files/test_module/mocks/CMakeLists.txt new file mode 100644 index 0000000..e69de29 diff --git a/.template_files/test_module/stubs/CMakeLists.txt b/.template_files/test_module/stubs/CMakeLists.txt new file mode 100644 index 0000000..e69de29 diff --git a/.template_files/test_module/test_module_name.cpp b/.template_files/test_module/test_module_name.cpp new file mode 100644 index 0000000..d06f275 --- /dev/null +++ b/.template_files/test_module/test_module_name.cpp @@ -0,0 +1,38 @@ +/* + * Author: username + * Date: todays_date + * filename: test_module_name.c + * description: module_purpose + */ + +#include "CppUTest/CommandLineTestRunner.h" + +extern "C" +{ +#include "module_name.h" +} + +TEST_GROUP(FirstTestGroup) +{ + void setup() + { + + } + void teardown() + { + + } +}; + +TEST(FirstTestGroup, FirstTest) +{ + FAIL("Fail me!"); +} + +TEST(FirstTestGroup, SecondTest) +{ + STRCMP_EQUAL("hello", "world"); + LONGS_EQUAL(1, 2); + CHECK(false); +} +