testing with unity

This commit is contained in:
Jake Hillion 2021-12-27 20:34:40 +00:00
parent 6568720c6d
commit 4277d58f26
5 changed files with 38 additions and 0 deletions

3
Makefile Normal file
View File

@ -0,0 +1,3 @@
.PHONY: assertions
assertions:
$(MAKE) -C assertions/

2
assertions/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
target/
test_runners/

27
assertions/Makefile Normal file
View File

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

View File

@ -0,0 +1,6 @@
#include "unity.h"
void setUp(void) {}
void tearDown(void) {}
void test_alwaysSucceeds_succeeds(void) { TEST_ASSERT_EQUAL(1, 1); }