Numbers Test erfolgreich ebstanden

This commit is contained in:
silvana884
2025-12-11 09:15:03 +01:00
parent dcc90edfa3
commit 37f38cbc7d
6 changed files with 108 additions and 41 deletions
+33 -33
View File
@@ -1,66 +1,66 @@
CC = gcc
FLAGS = -g -Wall -lm
FLAGS = -g -Wall -I$(unityfolder)
ifeq ($(OS),Windows_NT)
include makefile_windows.variables
include makefile_windows.variables
else
UNAME = $(shell uname)
ifeq ($(UNAME),Linux)
include makefile_linux.variables
else
include makefile_mac.variables
endif
UNAME = $(shell uname)
ifeq ($(UNAME),Linux)
include makefile_linux.variables
else
include makefile_mac.variables
endif
endif
raylibfolder = ./raylib
unityfolder = ./unity
# --------------------------
# Initiales Programm bauen (zum ausprobieren)
# Initiales Programm
# --------------------------
doble_initial:
$(CC) -o doble_initial $(BINARIES)/libdoble_complete.a
# --------------------------
# Selbst implementiertes Programm bauen
# Objektdateien
# --------------------------
program_obj_files = stack.o bintree.o numbers.o timer.o highscore.o
doble : main.o $(program_obj_files)
$(CC) $(FLAGS) $^ -o doble
# Generische Regel für alle .o-Dateien
%.o: %.c
$(CC) $(FLAGS) -c $< -o $@
$(program_obj_filesobj_files): %.o: %.c
$(CC) -c $(FLAGS) $^ -o $@
# --------------------------
# Hauptprogramm
# --------------------------
doble: main.o $(program_obj_files)
$(CC) $(FLAGS) $^ -o doble
# --------------------------
# Unit Tests
# --------------------------
unity_src = $(unityfolder)/unity.c
unitTests:
@echo "needs to be implemented"
unitTests: numbersTest stackTest bintreeTest
# ./runNumbersTest
# ./runStackTest
./runBintreeTest
# Bintree Tests
binTreeTests: stack.o bintree.o binTreeTests.c $(unityfolder)/unity.c
$(CC) $(FLAGS) -o runbintreeTests binTreeTests.c bintree.o stack.o $(unityfolder)/unity.c
numbersTest: numbers.o bintree.o stack.o numbersTest.c $(unity_src)
$(CC) $(CFLAGS) $(LDFLAGS) -I$(unityfolder) $^ -o runNumbersTest
stackTest: stack.o stackTest.c $(unity_src)
$(CC) $(CFLAGS) $(LDFLAGS) -I$(unityfolder) $^ -o runStackTests
binTreeTest: bintree.o binTreeTest.c $(unity_src) stack.o
$(CC) $(CFLAGS) $(LDFLAGS) -I$(unityfolder) $^ -o runBinTreeTest
%.o: %.c
$(CC) -c $(CFLAGS) $< -o $@
# Numbers Tests
test_numbers: numbers_no_tree.o bintree.o stack.o test_numbers.c $(unityfolder)/unity.c
$(CC) $(FLAGS) -o run_numbersTests test_numbers.c numbers_no_tree.o bintree.o stack.o $(unityfolder)/unity.c
# Stack Tests
test_stack: stack.o test_stack.c $(unityfolder)/unity.c
$(CC) $(FLAGS) -o runstackTests test_stack.c stack.o $(unityfolder)/unity.c
# --------------------------
# Clean
# --------------------------
clean:
ifeq ($(OS),Windows_NT)
del /f *.o doble
del /f *.o doble runstackTests run_numbersTests runbintreeTests
else
rm -f *.o doble
endif
rm -f *.o doble runstackTests run_numbersTests runbintreeTests
endif