tests: sort & fix includes, remove -include from CFLAGS of acct tests
- Sort the includes of pack.c, moving sys/*.h files near the top. - Add a couple of missing #include lines, and remove the need for custom -include options in the CFLAGS of the test Makefile. - Remove the ad-hoc 'all' target, but keep its 'regress' bits for testing. - Convert the ad-hoc 'clean' target to proper CLEANFILES stuff, so that the normal bsd.prog.mk machinery can clean up. - Use `make -V .OBJDIR' to detect the place where 'pack' lives, so that regress.t works both with and without 'make obj'. Reviewed by: uqs MFC after: 1 week
This commit is contained in:
parent
8974bc2f3a
commit
574fe75809
@ -1,26 +1,22 @@
|
|||||||
#
|
#
|
||||||
# $FreeBSD$
|
# $FreeBSD$
|
||||||
#
|
#
|
||||||
# "make" will compile what is needed and run the regression tests.
|
# "make" will compile the acct test programs
|
||||||
#
|
#
|
||||||
|
|
||||||
PROG= pack
|
PROG= pack
|
||||||
|
SRCS= pack.c
|
||||||
NO_MAN=
|
NO_MAN=
|
||||||
|
CFLAGS+= -I${.OBJDIR}
|
||||||
|
|
||||||
CFLAGS= -include /usr/include/sys/limits.h \
|
pack.o: convert.c
|
||||||
-include /usr/include/sys/syslog.h
|
|
||||||
|
|
||||||
all: regress
|
|
||||||
|
|
||||||
pack: pack.c convert.c
|
|
||||||
|
|
||||||
|
CLEANFILES+= convert.c
|
||||||
convert.c: ../../../sys/kern/kern_acct.c
|
convert.c: ../../../sys/kern/kern_acct.c
|
||||||
sed -n -e 's/log(/syslog(/g' \
|
sed -n -e 's/log(/syslog(/g' \
|
||||||
-e '/FLOAT_CONVERSION_START/,/FLOAT_CONVERSION_END/p' $? >$@
|
-e '/FLOAT_CONVERSION_START/,/FLOAT_CONVERSION_END/p' $? >$@
|
||||||
|
|
||||||
regress: pack regress.t
|
regress: pack regress.t
|
||||||
./regress.t
|
${.CURDIR}/regress.t
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f $(PROG) convert.c
|
|
||||||
|
|
||||||
.include <bsd.prog.mk>
|
.include <bsd.prog.mk>
|
||||||
|
@ -25,15 +25,18 @@
|
|||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__FBSDID("$FreeBSD$");
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <float.h>
|
#include <float.h>
|
||||||
|
#include <limits.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
|
#include <syslog.h>
|
||||||
#include <sys/time.h>
|
#include <time.h>
|
||||||
#include <sys/types.h>
|
|
||||||
|
|
||||||
#define KASSERT(val, msg) assert(val)
|
#define KASSERT(val, msg) assert(val)
|
||||||
|
|
||||||
|
@ -3,7 +3,12 @@
|
|||||||
# $FreeBSD$
|
# $FreeBSD$
|
||||||
#
|
#
|
||||||
|
|
||||||
DIR=`dirname $0`
|
if test -z "${DIR}" ; then
|
||||||
|
DIR=$( make -V .OBJDIR )
|
||||||
|
fi
|
||||||
|
if test -z "${DIR}" ; then
|
||||||
|
DIR=$( dirname $0 )
|
||||||
|
fi
|
||||||
|
|
||||||
check()
|
check()
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user