Makefile angepasst an unit tests. Unit tests geändert

This commit is contained in:
LukVal54
2025-12-18 22:32:14 +01:00
parent aa83f84a21
commit 6b66a6c31a
3 changed files with 180 additions and 5 deletions
+16 -5
View File
@@ -29,21 +29,32 @@ program_obj_files = stack.o bintree.o numbers.o timer.o highscore.o
doble : main.o $(program_obj_files)
$(CC) $(FLAGS) $^ -o doble
$(program_obj_filesobj_files): %.o: %.c
$(program_obj_files): %.o: %.c
$(CC) -c $(FLAGS) $^ -o $@
# --------------------------
# Unit Tests
# --------------------------
unitTests:
echo "needs to be implemented"
# Test Stack (JETZT MIT UNITY)
# Wir müssen unity/unity.c mitkompilieren und -Iunity nutzen
test_stack: test_stack.c stack.o $(unityfolder)/unity.c
$(CC) $(FLAGS) -Iunity test_stack.c stack.o $(unityfolder)/unity.c -o test_stack$(EXT)
# --------------------------
unitTests_stack: test_stack
./test_stack$(EXT)
test_numbers: test_numbers.c numbers.c bintree.c stack.c unity/unity.c
gcc -Wall -Wextra -std=c99 -Iunity \
-o test_numbers \
test_numbers.c numbers.c bintree.c stack.c unity/unity.c
unitTests_number: test_numbers
./test_numbers
#-------------------------
# Clean
# --------------------------
clean:
ifeq ($(OS),Windows_NT)
del /f *.o doble
del /f *.o doble.exe test_stack.exe test_numbers.exe
else
rm -f *.o doble
endif