Added template test module

This commit is contained in:
Jake Goodwin 2025-12-20 18:47:56 -08:00
parent 4e6be91ac3
commit 1ebd68346e
5 changed files with 61 additions and 0 deletions

View file

@ -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/
)

View file

@ -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);
}