From 2e8273e81d7fc13a9a558b7d912821bed4f96161 Mon Sep 17 00:00:00 2001 From: jakeg00dwin Date: Sat, 27 Jul 2024 12:33:58 -0700 Subject: [PATCH] updated with missing template files --- .../.template_files/.template_files_git_dir | 0 .../.template_files/modules/CMakeLists.txt | 7 ++++ .../modules/TestCMakeLists.txt | 10 +++++ .../.template_files/modules/module_name.c | 16 ++++++++ .../.template_files/modules/module_name.h | 14 +++++++ .../.template_files/modules/modules_git_dir | 0 .../modules/test_module_name.cpp | 38 +++++++++++++++++++ .template_files/.template_files_git_dir | 0 .template_files/modules/CMakeLists.txt | 7 ++++ .template_files/modules/TestCMakeLists.txt | 10 +++++ .template_files/modules/module_name.c | 16 ++++++++ .template_files/modules/module_name.h | 20 ++++++++++ .template_files/modules/modules_git_dir | 0 .template_files/modules/test_module_name.cpp | 38 +++++++++++++++++++ 14 files changed, 176 insertions(+) create mode 100644 .template_files/.template_files/.template_files_git_dir create mode 100644 .template_files/.template_files/modules/CMakeLists.txt create mode 100644 .template_files/.template_files/modules/TestCMakeLists.txt create mode 100644 .template_files/.template_files/modules/module_name.c create mode 100644 .template_files/.template_files/modules/module_name.h create mode 100644 .template_files/.template_files/modules/modules_git_dir create mode 100644 .template_files/.template_files/modules/test_module_name.cpp create mode 100644 .template_files/.template_files_git_dir create mode 100644 .template_files/modules/CMakeLists.txt create mode 100644 .template_files/modules/TestCMakeLists.txt create mode 100644 .template_files/modules/module_name.c create mode 100644 .template_files/modules/module_name.h create mode 100644 .template_files/modules/modules_git_dir create mode 100644 .template_files/modules/test_module_name.cpp diff --git a/.template_files/.template_files/.template_files_git_dir b/.template_files/.template_files/.template_files_git_dir new file mode 100644 index 0000000..e69de29 diff --git a/.template_files/.template_files/modules/CMakeLists.txt b/.template_files/.template_files/modules/CMakeLists.txt new file mode 100644 index 0000000..b27bc02 --- /dev/null +++ b/.template_files/.template_files/modules/CMakeLists.txt @@ -0,0 +1,7 @@ +add_library(module_name STATIC + module_name.c +) + +target_include_directories(module_name PUBLIC + ${CMAKE_CURRENT_LIST_DIR} +) diff --git a/.template_files/.template_files/modules/TestCMakeLists.txt b/.template_files/.template_files/modules/TestCMakeLists.txt new file mode 100644 index 0000000..64f9179 --- /dev/null +++ b/.template_files/.template_files/modules/TestCMakeLists.txt @@ -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 +) diff --git a/.template_files/.template_files/modules/module_name.c b/.template_files/.template_files/modules/module_name.c new file mode 100644 index 0000000..119b0bc --- /dev/null +++ b/.template_files/.template_files/modules/module_name.c @@ -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; +} diff --git a/.template_files/.template_files/modules/module_name.h b/.template_files/.template_files/modules/module_name.h new file mode 100644 index 0000000..e3907fd --- /dev/null +++ b/.template_files/.template_files/modules/module_name.h @@ -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 diff --git a/.template_files/.template_files/modules/modules_git_dir b/.template_files/.template_files/modules/modules_git_dir new file mode 100644 index 0000000..e69de29 diff --git a/.template_files/.template_files/modules/test_module_name.cpp b/.template_files/.template_files/modules/test_module_name.cpp new file mode 100644 index 0000000..d06f275 --- /dev/null +++ b/.template_files/.template_files/modules/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); +} + diff --git a/.template_files/.template_files_git_dir b/.template_files/.template_files_git_dir new file mode 100644 index 0000000..e69de29 diff --git a/.template_files/modules/CMakeLists.txt b/.template_files/modules/CMakeLists.txt new file mode 100644 index 0000000..b27bc02 --- /dev/null +++ b/.template_files/modules/CMakeLists.txt @@ -0,0 +1,7 @@ +add_library(module_name STATIC + module_name.c +) + +target_include_directories(module_name PUBLIC + ${CMAKE_CURRENT_LIST_DIR} +) diff --git a/.template_files/modules/TestCMakeLists.txt b/.template_files/modules/TestCMakeLists.txt new file mode 100644 index 0000000..64f9179 --- /dev/null +++ b/.template_files/modules/TestCMakeLists.txt @@ -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 +) diff --git a/.template_files/modules/module_name.c b/.template_files/modules/module_name.c new file mode 100644 index 0000000..119b0bc --- /dev/null +++ b/.template_files/modules/module_name.c @@ -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; +} diff --git a/.template_files/modules/module_name.h b/.template_files/modules/module_name.h new file mode 100644 index 0000000..91acb63 --- /dev/null +++ b/.template_files/modules/module_name.h @@ -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 diff --git a/.template_files/modules/modules_git_dir b/.template_files/modules/modules_git_dir new file mode 100644 index 0000000..e69de29 diff --git a/.template_files/modules/test_module_name.cpp b/.template_files/modules/test_module_name.cpp new file mode 100644 index 0000000..82c2303 --- /dev/null +++ b/.template_files/modules/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(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); +} +