diff --git a/Makefile b/Makefile index fbdc87f..37398f5 100644 --- a/Makefile +++ b/Makefile @@ -86,6 +86,7 @@ dist: $(PACKAGE)-$(VERSION)/src/python/libSystem.c \ $(PACKAGE)-$(VERSION)/src/python/libSystem.py \ $(PACKAGE)-$(VERSION)/src/project.conf \ + $(PACKAGE)-$(VERSION)/tests/includes.c \ $(PACKAGE)-$(VERSION)/tests/string.c \ $(PACKAGE)-$(VERSION)/tests/variable.c \ $(PACKAGE)-$(VERSION)/tests/COPYING \ diff --git a/tests/Makefile b/tests/Makefile index 7dc355f..ed6c3ea 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,4 +1,4 @@ -TARGETS = string variable tests.log +TARGETS = includes string variable tests.log PREFIX = /usr/local DESTDIR = BINDIR = $(PREFIX)/bin @@ -18,6 +18,13 @@ INSTALL = install all: $(TARGETS) +includes_OBJS = includes.o +includes_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS) +includes_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) + +includes: $(includes_OBJS) + $(CC) -o includes $(includes_OBJS) $(includes_LDFLAGS) + string_OBJS = string.o string_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS) string_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) @@ -32,9 +39,12 @@ variable_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) variable: $(variable_OBJS) $(CC) -o variable $(variable_OBJS) $(variable_LDFLAGS) -tests.log: string tests.sh variable +tests.log: includes string tests.sh variable ./tests.sh -P "$(PREFIX)" -- "tests.log" +includes.o: includes.c + $(CC) $(includes_CFLAGS) -c includes.c + string.o: string.c ../src/string.c $(CC) $(string_CFLAGS) -c string.c @@ -42,7 +52,7 @@ variable.o: variable.c ../src/variable.c $(CC) $(variable_CFLAGS) -c variable.c clean: - $(RM) -- $(string_OBJS) $(variable_OBJS) $(tests.log_OBJS) + $(RM) -- $(includes_OBJS) $(string_OBJS) $(variable_OBJS) $(tests.log_OBJS) ./tests.sh -c -P "$(PREFIX)" -- "tests.log" distclean: clean diff --git a/tests/includes.c b/tests/includes.c new file mode 100644 index 0000000..8c424a5 --- /dev/null +++ b/tests/includes.c @@ -0,0 +1,32 @@ +/* $Id$ */ +/* Copyright (c) 2014 Pierre Pronchery */ +/* This file is part of DeforaOS System libSystem */ +/* This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ + + + +#include "System.h" + + +/* includes */ +static int _includes(void) +{ + return 0; +} + + +/* main */ +int main(void) +{ + return _includes(); +} diff --git a/tests/project.conf b/tests/project.conf index c7016bf..4727179 100644 --- a/tests/project.conf +++ b/tests/project.conf @@ -1,4 +1,4 @@ -targets=string,variable,tests.log +targets=includes,string,variable,tests.log cppflags_force=-I ../include cflags_force=-W cflags=-Wall -g -O2 @@ -6,6 +6,10 @@ ldflags_force=-L ../src -lSystem ldflags=-L$(PREFIX)/lib -Wl,-rpath,"$(PWD)/../src" dist=COPYING,Makefile,tests.sh +[includes] +type=binary +sources=includes.c + [string] type=binary sources=string.c @@ -16,7 +20,7 @@ depends=../src/string.c [tests.log] type=script script=./tests.sh -depends=string,tests.sh,variable +depends=includes,string,tests.sh,variable [variable] type=binary diff --git a/tests/tests.sh b/tests/tests.sh index 50e2d4e..1829c7a 100755 --- a/tests/tests.sh +++ b/tests/tests.sh @@ -98,6 +98,7 @@ target="$1" $DATE > "$target" FAILED= echo "Performing tests:" 1>&2 +_test "includes" _test "string" _test "variable" if [ -n "$FAILED" ]; then