Added in new module for Relays

This commit is contained in:
jakeg00dwin 2024-09-01 12:28:26 -07:00
parent bdca898b62
commit 2e7a4ffa38
8 changed files with 95 additions and 1 deletions

View File

@ -55,3 +55,4 @@ add_subdirectory(usart)
add_subdirectory(timer)
add_subdirectory(SuperLoop)
add_subdirectory(Relays)

View File

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

16
src/Relays/Relays.c Normal file
View File

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

20
src/Relays/Relays.h Normal file
View File

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

View File

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

View File

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

View File

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

View File

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