From 61df3e7cdc621fc5c6f309427fdcaadcdd562bdc Mon Sep 17 00:00:00 2001 From: Alfred Klomp Date: Thu, 1 Jan 2015 18:48:06 +0100 Subject: [PATCH] Testing: add `make test` target, use in Travis CI build --- .gitignore | 2 +- .travis.yml | 3 +-- test/Makefile | 11 +++++++---- test/{test.c => test_base64.c} | 0 4 files changed, 9 insertions(+), 7 deletions(-) rename test/{test.c => test_base64.c} (100%) diff --git a/.gitignore b/.gitignore index d6b0489b..2c81a18c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ base64 -test/test +test/test_base64 diff --git a/.travis.yml b/.travis.yml index bcac1a7b..ab1c3fcd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,5 +5,4 @@ compiler: - gcc script: - - make - - ( cd test && make && ./test ) + - make -C test test diff --git a/test/Makefile b/test/Makefile index a4dda2a0..e70f55a6 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,9 +1,12 @@ -CFLAGS += -std=c89 -O3 -march=native -Wall -Wextra -pedantic +CFLAGS += -std=c89 -O3 -Wall -Wextra -pedantic -test: test.c ../base64.c +.PHONY: clean test + +test_base64: test_base64.c ../base64.c $(CC) $(CFLAGS) -o $@ $^ -.PHONY: clean +test: clean test_base64 + ./test_base64 clean: - rm -f test + rm -f test_base64 diff --git a/test/test.c b/test/test_base64.c similarity index 100% rename from test/test.c rename to test/test_base64.c