From 4277d58f268e5d2b7553f79214497ebdf7e3b10b Mon Sep 17 00:00:00 2001 From: Jake Hillion Date: Mon, 27 Dec 2021 20:34:40 +0000 Subject: [PATCH] testing with unity --- examples/.clang-format => .clang-format | 0 Makefile | 3 +++ assertions/.gitignore | 2 ++ assertions/Makefile | 27 +++++++++++++++++++++++++ assertions/namespaces/fs/TestUnshare.c | 6 ++++++ 5 files changed, 38 insertions(+) rename examples/.clang-format => .clang-format (100%) create mode 100644 Makefile create mode 100644 assertions/.gitignore create mode 100644 assertions/Makefile create mode 100644 assertions/namespaces/fs/TestUnshare.c diff --git a/examples/.clang-format b/.clang-format similarity index 100% rename from examples/.clang-format rename to .clang-format diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0751a15 --- /dev/null +++ b/Makefile @@ -0,0 +1,3 @@ +.PHONY: assertions +assertions: + $(MAKE) -C assertions/ diff --git a/assertions/.gitignore b/assertions/.gitignore new file mode 100644 index 0000000..c04c1f8 --- /dev/null +++ b/assertions/.gitignore @@ -0,0 +1,2 @@ +target/ +test_runners/ diff --git a/assertions/Makefile b/assertions/Makefile new file mode 100644 index 0000000..f19e21b --- /dev/null +++ b/assertions/Makefile @@ -0,0 +1,27 @@ +CLEANUP = rm -f + +C_COMPILER=clang + +UNITY_ROOT=../extern/Unity + +CFLAGS = -std=c17 + +INC_DIRS=-I$(UNITY_ROOT)/src + +SRC_NAMESPACES_FS_1=$(UNITY_ROOT)/src/unity.c namespaces/fs/TestUnshare.c test_runners/namespaces_fs_TestUnshare_Runner.c +TARGET_NAMESPACES_FS_1=target/test_namespaces_fs + +all: clean default + +default: $(TARGET_NAMESPACES_FS_1) + - ./$(TARGET_NAMESPACES_FS_1) + +$(TARGET_NAMESPACES_FS_1): $(SRC_NAMESPACES_FS_1) + $(C_COMPILER) $(CFLAGS) $(INC_DIRS) $(SYMBOLS) $(SRC_NAMESPACES_FS_1) -o $(TARGET_NAMESPACES_FS_1) + +test_runners/namespaces_fs_TestUnshare_Runner.c: namespaces/fs/TestUnshare.c + ruby $(UNITY_ROOT)/auto/generate_test_runner.rb namespaces/fs/TestUnshare.c test_runners/namespaces_fs_TestUnshare_Runner.c + +clean: + $(CLEANUP) $(TARGET_NAMESPACES_FS_1) + mkdir -p test_runners/ target/ diff --git a/assertions/namespaces/fs/TestUnshare.c b/assertions/namespaces/fs/TestUnshare.c new file mode 100644 index 0000000..c1219b3 --- /dev/null +++ b/assertions/namespaces/fs/TestUnshare.c @@ -0,0 +1,6 @@ +#include "unity.h" + +void setUp(void) {} +void tearDown(void) {} + +void test_alwaysSucceeds_succeeds(void) { TEST_ASSERT_EQUAL(1, 1); }