From 363c9568a718b8f498f0e74f95f26d07d37d592d Mon Sep 17 00:00:00 2001 From: bartool Date: Sun, 27 Nov 2022 09:25:31 +0100 Subject: [PATCH] Configure workspace --- .vscode/c_cpp_properties.json | 25 +++++++++++++++++++++++++ CMakeLists.txt | 3 ++- cmd_parser/cmd_parser.c | 0 cmd_parser/cmd_parser.h | 2 ++ test/cmd_parser/CMakeLists.txt | 20 ++++++++++++++++++++ test/cmd_parser/cmd_parser_test.c | 28 ++++++++++++++++++++++++++++ 6 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 .vscode/c_cpp_properties.json create mode 100644 cmd_parser/cmd_parser.c create mode 100644 cmd_parser/cmd_parser.h create mode 100644 test/cmd_parser/CMakeLists.txt create mode 100644 test/cmd_parser/cmd_parser_test.c diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..dd61127 --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,25 @@ +{ + "configurations": [ + { + "name": "Win32", + "includePath": [ + "${workspaceFolder}/utility/unity/core", + "${workspaceFolder}/utility/unity/fixture", + // "${workspaceFolder}/test/oled/helpers/inc", + // "${workspaceFolder}/test/oled/", + "${workspaceFolder}/cmd_parser/", + "${workspaceFolder}/**" + ], + "defines": [ + "_DEBUG", + "UNICODE", + "_UNICODE" + ], + "compilerPath": "C:\\Apps\\mingw64\\bin\\gcc.exe", + "cStandard": "gnu17", + "cppStandard": "gnu++17", + "intelliSenseMode": "windows-gcc-x64" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 4fdfc88..b964099 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,4 +15,5 @@ add_definitions(${GLOBAL_DEFINITION}) add_subdirectory(utility/unity unity) link_libraries(unity) -add_subdirectory(test/oled oled) \ No newline at end of file +# add_subdirectory(test/oled oled) +add_subdirectory(test/cmd_parser cmd_parser) \ No newline at end of file diff --git a/cmd_parser/cmd_parser.c b/cmd_parser/cmd_parser.c new file mode 100644 index 0000000..e69de29 diff --git a/cmd_parser/cmd_parser.h b/cmd_parser/cmd_parser.h new file mode 100644 index 0000000..3f59c93 --- /dev/null +++ b/cmd_parser/cmd_parser.h @@ -0,0 +1,2 @@ +#pragma once + diff --git a/test/cmd_parser/CMakeLists.txt b/test/cmd_parser/CMakeLists.txt new file mode 100644 index 0000000..a479075 --- /dev/null +++ b/test/cmd_parser/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.10) + +set(TEST_NAME cmd_parser) + +set(INCLUDE_DIRS + ../../cmd_parser + helpers/inc +) + +set(SRCS + ../../cmd_parser/cmd_parser.c + + # helpers/src/ + cmd_parser_test.c +) + +add_definitions(-DTEST) +add_executable(${TEST_NAME} ${SRCS}) + +target_include_directories(${TEST_NAME} PUBLIC ${INCLUDE_DIRS}) \ No newline at end of file diff --git a/test/cmd_parser/cmd_parser_test.c b/test/cmd_parser/cmd_parser_test.c new file mode 100644 index 0000000..3ad6b68 --- /dev/null +++ b/test/cmd_parser/cmd_parser_test.c @@ -0,0 +1,28 @@ +#include "stdlib.h" +#include "string.h" +#include "unity.h" +#include "cmd_parser.h" + + +void setUp(void) +{ +} + +void tearDown(void) +{ +} + +void test_one(void) +{ + TEST_FAIL(); +} + + + +int main(void) +{ + UNITY_BEGIN(); + RUN_TEST(test_one); + + return UNITY_END(); +} \ No newline at end of file