diff --git a/Makefile b/Makefile index 6434586eda934a0a9069c58aa866232724f93062..5d68ca5421e14356734710743f7001387b542789 100644 --- a/Makefile +++ b/Makefile @@ -34,4 +34,5 @@ test: clean: make -C src clean - make -C tests clean \ No newline at end of file + make -C tests clean + rm -rf $(PROGRAM_NAME)-$(VERSION).tar.gz \ No newline at end of file diff --git a/spikes/ieee_floating_point/makefile b/spikes/ieee_floating_point/Makefile similarity index 100% rename from spikes/ieee_floating_point/makefile rename to spikes/ieee_floating_point/Makefile diff --git a/spikes/ieee_floating_point/sandbox/makefile b/spikes/ieee_floating_point/sandbox/Makefile similarity index 100% rename from spikes/ieee_floating_point/sandbox/makefile rename to spikes/ieee_floating_point/sandbox/Makefile diff --git a/spikes/input_handling/makefile b/spikes/input_handling/Makefile similarity index 100% rename from spikes/input_handling/makefile rename to spikes/input_handling/Makefile diff --git a/spikes/logging/makefile b/spikes/logging/Makefile similarity index 100% rename from spikes/logging/makefile rename to spikes/logging/Makefile diff --git a/spikes/square_root/makefile b/spikes/square_root/Makefile similarity index 100% rename from spikes/square_root/makefile rename to spikes/square_root/Makefile diff --git a/spikes/unit_testing/makefile b/spikes/unit_testing/Makefile similarity index 100% rename from spikes/unit_testing/makefile rename to spikes/unit_testing/Makefile diff --git a/src/makefile b/src/Makefile similarity index 100% rename from src/makefile rename to src/Makefile diff --git a/tests/Makefile b/tests/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..cc3d6f1999f92bcc064101d603d8d8de70217993 --- /dev/null +++ b/tests/Makefile @@ -0,0 +1,14 @@ +# Makefile for Unit Tests + +.PHONY: default all clean test + +default: test +all: default + +test: + make -C unit_tests + make -C integration_tests + +clean: + make -C unit_tests clean + make -C integration_tests clean diff --git a/tests/integration_tests/Makefile b/tests/integration_tests/Makefile index a11b96b571f5531607003e8a3f2401400bb0a3f6..a9cbc78e791e341f32341fca0d251993ae482c6b 100644 --- a/tests/integration_tests/Makefile +++ b/tests/integration_tests/Makefile @@ -12,5 +12,6 @@ quad_solver: test_int_all: quad_solver ./test_ranges.sh $(SRC_DIR) +# Clean does nothing for now clean: - rm *.temp + @: diff --git a/tests/makefile b/tests/makefile deleted file mode 100644 index 4a78031b19cfb757063b069d4e576c88ebc6f089..0000000000000000000000000000000000000000 --- a/tests/makefile +++ /dev/null @@ -1,23 +0,0 @@ -# Makefile for Unit Tests - -LIBS = -lm -lcunit -CC = gcc -CFLAGS = -Wall -pedantic -std=c99 -g -SRC_DIR = ../src -WRAPPED = -Wl,--wrap=sqrt - -.PHONY: default all clean run_tests - -default: test -all: default - -test: unit_tests.out - ./unit_tests.out - -unit_tests.out : unit_tests.o $(SRC_DIR)/argparse.o $(SRC_DIR)/compute.o $(SRC_DIR)/my_sqrt.o $(SRC_DIR)/helper.o $(SRC_DIR)/prompt.o - ${CC} -o unit_tests.out $^ $(LIBS) - -unit_tests.o: unit_tests.c - -clean: - -rm -f *.o *.out diff --git a/tests/unit_tests/Makefile b/tests/unit_tests/Makefile index 2a78f1460d3466fc84ff2a3001bdfe9f1d8d553b..50fb9cbd447a2eb2b521f7d6a82d6bd1cf5a9a04 100644 --- a/tests/unit_tests/Makefile +++ b/tests/unit_tests/Makefile @@ -1,6 +1,6 @@ # Makefile for Unit Tests -LIBS = -lm +LIBS = -lm -lcunit CC = gcc CFLAGS = -Wall -pedantic -std=c99 -g SRC_DIR = ../../src @@ -11,8 +11,11 @@ CUNIT_DIR = ../cunit default: test_unit_all all: default -test_unit_all: test_my_sqrt.out +test_unit_all: test_my_sqrt.out unit_tests.out ./test_my_sqrt.out + ./unit_tests.out + +# Mini Cunit Library tests test_my_sqrt.out: my_sqrt.o test_my_sqrt.o mock_sqrt.o cunit.o ${CC} -o $@ $^ $(LIBS) -Wl,--wrap=sqrt @@ -27,5 +30,12 @@ mock_sqrt.o: mock_sqrt.c cunit.o: $(CUNIT_DIR)/cunit.c $(CUNIT_DIR)/cunit.h ${CC} -c -o $@ $< ${CFLAGS} +# Cunit Library tests + +unit_tests.out : unit_tests.o $(SRC_DIR)/argparse.o $(SRC_DIR)/compute.o $(SRC_DIR)/my_sqrt.o $(SRC_DIR)/helper.o $(SRC_DIR)/prompt.o + ${CC} -o unit_tests.out $^ $(LIBS) + +unit_tests.o: unit_tests.c + clean: -rm -f *.o *.out diff --git a/tests/unit_tests.c b/tests/unit_tests/unit_tests.c similarity index 98% rename from tests/unit_tests.c rename to tests/unit_tests/unit_tests.c index e5bbe03c85da768122c7af5081894701c5fbc479..8db3e8a7bd862fec896454526017fc0d5c1ec6cd 100644 --- a/tests/unit_tests.c +++ b/tests/unit_tests/unit_tests.c @@ -13,9 +13,9 @@ // Import headers. #include <fenv.h> #include <CUnit/Basic.h> -#include "../src/argparse.h" -#include "../src/compute.h" -#include "../src/helper.h" +#include "../../src/argparse.h" +#include "../../src/compute.h" +#include "../../src/helper.h" // Method Declaration.