Added in new module for Relays
This commit is contained in:
parent
bdca898b62
commit
2e7a4ffa38
|
@ -55,3 +55,4 @@ add_subdirectory(usart)
|
|||
add_subdirectory(timer)
|
||||
|
||||
add_subdirectory(SuperLoop)
|
||||
add_subdirectory(Relays)
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
add_library(Relays STATIC
|
||||
Relays.c
|
||||
)
|
||||
|
||||
target_include_directories(Relays PUBLIC
|
||||
${CMAKE_CURRENT_LIST_DIR}
|
||||
)
|
|
@ -0,0 +1,16 @@
|
|||
/*
|
||||
* Author: username
|
||||
* Date: 2024
|
||||
* filename: Relays.c
|
||||
* description: module_purpose
|
||||
*/
|
||||
|
||||
#include "Relays.h"
|
||||
|
||||
// dumb test function
|
||||
int add_two(int a)
|
||||
{
|
||||
int b = a;
|
||||
b += 2;
|
||||
return b;
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
/**
|
||||
* @brief PUT_TEXT_HERE
|
||||
* @details This file is...
|
||||
* @author username
|
||||
* @date todays_date
|
||||
* @copyright None
|
||||
* @file RELAYS.h
|
||||
*/
|
||||
|
||||
#ifndef RELAYS
|
||||
#define RELAYS
|
||||
|
||||
|
||||
/**
|
||||
* A function that adds two to a number
|
||||
* @param a The first argument
|
||||
*/
|
||||
int add_two(int a);
|
||||
|
||||
#endif //RELAYS
|
|
@ -4,8 +4,8 @@
|
|||
//ImportTestGroups
|
||||
IMPORT_TEST_GROUP(simple_test);
|
||||
IMPORT_TEST_GROUP(test_SuperLoop);
|
||||
IMPORT_TEST_GROUP(test_Relays);
|
||||
IMPORT_TEST_GROUP(test_RegEdit);
|
||||
IMPORT_TEST_GROUP(test_LedController);
|
||||
|
||||
|
||||
//START: main
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
project(Tests)
|
||||
|
||||
# TEST_DIRS
|
||||
add_subdirectory(Relays)
|
||||
add_subdirectory(SuperLoop)
|
||||
#add_subdirectory(timer)
|
||||
#add_subdirectory(usart)
|
||||
|
@ -22,6 +23,7 @@ target_link_libraries(AllTests
|
|||
${CPPUTEST_LIBRARIES}/libCppUTest.a
|
||||
${CPPUTEST_LIBRARIES}/libCppUTestExt.a
|
||||
# TEST_LINKS
|
||||
test_Relays
|
||||
test_SuperLoop
|
||||
|
||||
#test_timer
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
# TEST_RUNNER
|
||||
add_library(test_Relays
|
||||
test_Relays.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(test_Relays
|
||||
${CPPUTEST_LIBRARIES}/libCppUTest.a
|
||||
${CPPUTEST_LIBRARIES}/libCppUTestExt.a
|
||||
Relays
|
||||
)
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Author: username
|
||||
* Date: todays_date
|
||||
* filename: test_Relays.c
|
||||
* description: module_purpose
|
||||
*/
|
||||
|
||||
#include "CppUTest/CommandLineTestRunner.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "Relays.h"
|
||||
}
|
||||
|
||||
TEST_GROUP(test_Relays)
|
||||
{
|
||||
void setup()
|
||||
{
|
||||
|
||||
}
|
||||
void teardown()
|
||||
{
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
TEST(test_Relays, FirstTest)
|
||||
{
|
||||
FAIL("Fail me!");
|
||||
}
|
||||
|
||||
TEST(test_Relays, SecondTest)
|
||||
{
|
||||
STRCMP_EQUAL("hello", "world");
|
||||
LONGS_EQUAL(1, 2);
|
||||
CHECK(false);
|
||||
}
|
||||
|
Loading…
Reference in New Issue