updated with missing template files

This commit is contained in:
jakeg00dwin 2024-07-27 12:33:58 -07:00
parent e966625043
commit 2e8273e81d
14 changed files with 176 additions and 0 deletions

View File

@ -0,0 +1,7 @@
add_library(module_name STATIC
module_name.c
)
target_include_directories(module_name PUBLIC
${CMAKE_CURRENT_LIST_DIR}
)

View File

@ -0,0 +1,10 @@
# TEST_RUNNER
add_library(test_module_name
test_module_name.cpp
)
target_link_libraries(test_module_name
${CPPUTEST_LIBRARIES}/libCppUTest.a
${CPPUTEST_LIBRARIES}/libCppUTestExt.a
module_name
)

View File

@ -0,0 +1,16 @@
/*
* Author: username
* Date: todays_date
* filename: module_name.c
* description: module_purpose
*/
#include "module_name.h"
// dumb test function
int add_two(int a)
{
int b = a;
b += 2;
return b;
}

View File

@ -0,0 +1,14 @@
/*
* Author: username
* Date: todays_date
* filename: module_name.h
* description: module_purpose
*/
#ifndef module_name
#define module_name
int add_two(int a);
#endif //module_name

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

View File

View File

@ -0,0 +1,7 @@
add_library(module_name STATIC
module_name.c
)
target_include_directories(module_name PUBLIC
${CMAKE_CURRENT_LIST_DIR}
)

View File

@ -0,0 +1,10 @@
# TEST_RUNNER
add_library(test_module_name
test_module_name.cpp
)
target_link_libraries(test_module_name
${CPPUTEST_LIBRARIES}/libCppUTest.a
${CPPUTEST_LIBRARIES}/libCppUTestExt.a
module_name
)

View File

@ -0,0 +1,16 @@
/*
* Author: username
* Date: todays_date
* filename: module_name.c
* description: module_purpose
*/
#include "module_name.h"
// dumb test function
int add_two(int a)
{
int b = a;
b += 2;
return b;
}

View File

@ -0,0 +1,20 @@
/**
* @brief PUT_TEXT_HERE
* @details This file is...
* @author username
* @date todays_date
* @copyright None
* @file module_name.h
*/
#ifndef module_name
#define module_name
/**
* A function that adds two to a number
* @param a The first argument
*/
int add_two(int a);
#endif //module_name

View File

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(test_module_name)
{
void setup()
{
}
void teardown()
{
}
};
TEST(test_module_name, FirstTest)
{
FAIL("Fail me!");
}
TEST(test_module_name, SecondTest)
{
STRCMP_EQUAL("hello", "world");
LONGS_EQUAL(1, 2);
CHECK(false);
}