Added the "includes" test (including all headers)
This commit is contained in:
parent
eb5954bb1a
commit
e445a692c5
1
Makefile
1
Makefile
|
@ -86,6 +86,7 @@ dist:
|
||||||
$(PACKAGE)-$(VERSION)/src/python/libSystem.c \
|
$(PACKAGE)-$(VERSION)/src/python/libSystem.c \
|
||||||
$(PACKAGE)-$(VERSION)/src/python/libSystem.py \
|
$(PACKAGE)-$(VERSION)/src/python/libSystem.py \
|
||||||
$(PACKAGE)-$(VERSION)/src/project.conf \
|
$(PACKAGE)-$(VERSION)/src/project.conf \
|
||||||
|
$(PACKAGE)-$(VERSION)/tests/includes.c \
|
||||||
$(PACKAGE)-$(VERSION)/tests/string.c \
|
$(PACKAGE)-$(VERSION)/tests/string.c \
|
||||||
$(PACKAGE)-$(VERSION)/tests/variable.c \
|
$(PACKAGE)-$(VERSION)/tests/variable.c \
|
||||||
$(PACKAGE)-$(VERSION)/tests/COPYING \
|
$(PACKAGE)-$(VERSION)/tests/COPYING \
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
TARGETS = string variable tests.log
|
TARGETS = includes string variable tests.log
|
||||||
PREFIX = /usr/local
|
PREFIX = /usr/local
|
||||||
DESTDIR =
|
DESTDIR =
|
||||||
BINDIR = $(PREFIX)/bin
|
BINDIR = $(PREFIX)/bin
|
||||||
|
@ -18,6 +18,13 @@ INSTALL = install
|
||||||
|
|
||||||
all: $(TARGETS)
|
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_OBJS = string.o
|
||||||
string_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS)
|
string_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS)
|
||||||
string_LDFLAGS = $(LDFLAGSF) $(LDFLAGS)
|
string_LDFLAGS = $(LDFLAGSF) $(LDFLAGS)
|
||||||
|
@ -32,9 +39,12 @@ variable_LDFLAGS = $(LDFLAGSF) $(LDFLAGS)
|
||||||
variable: $(variable_OBJS)
|
variable: $(variable_OBJS)
|
||||||
$(CC) -o variable $(variable_OBJS) $(variable_LDFLAGS)
|
$(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"
|
./tests.sh -P "$(PREFIX)" -- "tests.log"
|
||||||
|
|
||||||
|
includes.o: includes.c
|
||||||
|
$(CC) $(includes_CFLAGS) -c includes.c
|
||||||
|
|
||||||
string.o: string.c ../src/string.c
|
string.o: string.c ../src/string.c
|
||||||
$(CC) $(string_CFLAGS) -c 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
|
$(CC) $(variable_CFLAGS) -c variable.c
|
||||||
|
|
||||||
clean:
|
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"
|
./tests.sh -c -P "$(PREFIX)" -- "tests.log"
|
||||||
|
|
||||||
distclean: clean
|
distclean: clean
|
||||||
|
|
32
tests/includes.c
Normal file
32
tests/includes.c
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
/* $Id$ */
|
||||||
|
/* Copyright (c) 2014 Pierre Pronchery <khorben@defora.org> */
|
||||||
|
/* 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 <http://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "System.h"
|
||||||
|
|
||||||
|
|
||||||
|
/* includes */
|
||||||
|
static int _includes(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* main */
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
return _includes();
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
targets=string,variable,tests.log
|
targets=includes,string,variable,tests.log
|
||||||
cppflags_force=-I ../include
|
cppflags_force=-I ../include
|
||||||
cflags_force=-W
|
cflags_force=-W
|
||||||
cflags=-Wall -g -O2
|
cflags=-Wall -g -O2
|
||||||
|
@ -6,6 +6,10 @@ ldflags_force=-L ../src -lSystem
|
||||||
ldflags=-L$(PREFIX)/lib -Wl,-rpath,"$(PWD)/../src"
|
ldflags=-L$(PREFIX)/lib -Wl,-rpath,"$(PWD)/../src"
|
||||||
dist=COPYING,Makefile,tests.sh
|
dist=COPYING,Makefile,tests.sh
|
||||||
|
|
||||||
|
[includes]
|
||||||
|
type=binary
|
||||||
|
sources=includes.c
|
||||||
|
|
||||||
[string]
|
[string]
|
||||||
type=binary
|
type=binary
|
||||||
sources=string.c
|
sources=string.c
|
||||||
|
@ -16,7 +20,7 @@ depends=../src/string.c
|
||||||
[tests.log]
|
[tests.log]
|
||||||
type=script
|
type=script
|
||||||
script=./tests.sh
|
script=./tests.sh
|
||||||
depends=string,tests.sh,variable
|
depends=includes,string,tests.sh,variable
|
||||||
|
|
||||||
[variable]
|
[variable]
|
||||||
type=binary
|
type=binary
|
||||||
|
|
|
@ -98,6 +98,7 @@ target="$1"
|
||||||
$DATE > "$target"
|
$DATE > "$target"
|
||||||
FAILED=
|
FAILED=
|
||||||
echo "Performing tests:" 1>&2
|
echo "Performing tests:" 1>&2
|
||||||
|
_test "includes"
|
||||||
_test "string"
|
_test "string"
|
||||||
_test "variable"
|
_test "variable"
|
||||||
if [ -n "$FAILED" ]; then
|
if [ -n "$FAILED" ]; then
|
||||||
|
|
Loading…
Reference in New Issue
Block a user