Migrate most of tools/regression/usr.bin/ to the new tests layout.

I'm starting with the easy cases.  The leftovers need to be looked at a
bit more closely.

Note that this change _does_ modify the code of the old tests.  This is
required in order to allow the code to locate the data files in the
source directory instead of the current directory, because Kyua
automatically changes the latter to a temporary directory.

Also note that at least one test is known to be broken here.  Actually,
the test is not really broken: it's marked as a TODO but unfortunately
Kyua's TAP parser currently does not understand that.  Will have to be
fixed separately.
This commit is contained in:
Julio Merino 2014-03-16 08:04:06 +00:00
parent d14afb2adc
commit 3a92d97ff0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=263227
587 changed files with 1048 additions and 350 deletions

View file

@ -91,12 +91,44 @@
..
..
usr.bin
apply
..
atf
atf-sh
..
..
calendar
..
comm
..
file2c
..
join
..
jot
..
lastcomm
..
m4
..
ncal
..
printf
..
sed
regress.multitest.out
..
..
tr
..
uudecode
..
uuencode
..
xargs
..
yacc
..
..
usr.sbin
etcupdate

View file

@ -1,6 +0,0 @@
# $FreeBSD$
SUBDIR= apply calendar comm file2c join jot m4 ncal printf sed tr \
uudecode uuencode xargs
.include <bsd.subdir.mk>

View file

@ -1,4 +0,0 @@
# $FreeBSD$
all:
@m4 ${.CURDIR}/../regress.m4 ${.CURDIR}/regress.sh | sh /dev/stdin ${.CURDIR}

View file

@ -1,10 +0,0 @@
# $FreeBSD$
echo 1..2
REGRESSION_START($1)
REGRESSION_TEST(`00', `apply "echo %1 %1 %1 %1" $(cat regress.00.in)')
REGRESSION_TEST(`01', `sh regress.01.sh')
REGRESSION_END()

View file

@ -1,6 +0,0 @@
#!/bin/sh
# $FreeBSD$
cd `dirname $0`
m4 ../regress.m4 regress.sh | sh

View file

@ -1,4 +0,0 @@
# $FreeBSD$
all:
@m4 ${.CURDIR}/../regress.m4 ${.CURDIR}/regress.sh | sh /dev/stdin ${.CURDIR}

View file

@ -1,6 +0,0 @@
#!/bin/sh
# $FreeBSD$
cd `dirname $0`
m4 ../regress.m4 regress.sh | sh

View file

@ -1,4 +0,0 @@
# $FreeBSD$
all:
@m4 ${.CURDIR}/../regress.m4 ${.CURDIR}/regress.sh | sh /dev/stdin ${.CURDIR}

View file

@ -1,13 +0,0 @@
# $FreeBSD$
LC_ALL=C; export LC_ALL
echo 1..3
REGRESSION_START($1)
REGRESSION_TEST(`00', `comm -12 regress.00a.in regress.00b.in')
REGRESSION_TEST(`01', `comm -12 regress.01a.in regress.01b.in')
REGRESSION_TEST(`02', `comm regress.02a.in regress.02b.in')
REGRESSION_END()

View file

@ -1,6 +0,0 @@
#!/bin/sh
# $FreeBSD$
cd `dirname $0`
m4 ../regress.m4 regress.sh | sh

View file

@ -1,4 +0,0 @@
# $FreeBSD$
all:
@m4 ${.CURDIR}/../regress.m4 ${.CURDIR}/regress.sh | sh /dev/stdin ${.CURDIR}

View file

@ -1,19 +0,0 @@
# $FreeBSD$
echo 1..9
REGRESSION_START($1)
REGRESSION_TEST(`1', `head -c 13 regress.in | file2c')
REGRESSION_TEST(`2', `head -c 26 regress.in | file2c PREFIX')
REGRESSION_TEST(`3', `head -c 39 regress.in | file2c PREFIX SUFFIX')
REGRESSION_TEST(`4', `head -c 52 regress.in | file2c -x')
REGRESSION_TEST(`5', `head -c 65 regress.in | file2c -n -1')
REGRESSION_TEST(`6', `head -c 7 regress.in | file2c -n 1 P S')
REGRESSION_TEST(`7', `head -c 14 regress.in | file2c -n 2 -x "P S"')
REGRESSION_TEST(`8', `head -c 21 regress.in | file2c -n 16 P -x S')
REGRESSION_TEST(`9', `file2c "const char data[] = {" ", 0};" < regress.in')
REGRESSION_END()

View file

@ -1,6 +0,0 @@
#!/bin/sh
# $FreeBSD$
cd `dirname $0`
m4 ../regress.m4 regress.sh | sh

View file

@ -1,4 +0,0 @@
# $FreeBSD$
all:
@m4 ${.CURDIR}/../regress.m4 ${.CURDIR}/regress.sh | sh /dev/stdin ${.CURDIR}

View file

@ -1,6 +0,0 @@
#!/bin/sh
# $FreeBSD$
cd `dirname $0`
m4 ../regress.m4 regress.sh | sh

View file

@ -1,4 +0,0 @@
# $FreeBSD$
all:
@m4 ${.CURDIR}/../regress.m4 ${.CURDIR}/regress.sh | sh /dev/stdin ${.CURDIR}

View file

@ -1,6 +0,0 @@
#!/bin/sh
# $FreeBSD$
cd `dirname $0`
m4 ../regress.m4 regress.sh | sh

View file

@ -1,4 +0,0 @@
# $FreeBSD$
all:
@m4 ${.CURDIR}/../regress.m4 ${.CURDIR}/regress.sh | sh /dev/stdin ${.CURDIR}

View file

@ -1,31 +0,0 @@
# $FreeBSD$
LC_ALL=C; export LC_ALL
echo 1..21
REGRESSION_START($1)
REGRESSION_TEST(`args', `m4 args.m4')
REGRESSION_TEST(`args2', `m4 args2.m4')
REGRESSION_TEST(`comments', `m4 comments.m4')
REGRESSION_TEST(`esyscmd', `m4 esyscmd.m4')
REGRESSION_TEST(`eval', `m4 eval.m4')
REGRESSION_TEST(`ff_after_dnl', `uudecode -o /dev/stdout ff_after_dnl.m4.uu | m4')
REGRESSION_TEST(`gnueval', `m4 -g gnueval.m4')
REGRESSION_TEST(`gnuformat', `m4 -g gnuformat.m4')
REGRESSION_TEST(`gnupatterns', `m4 -g gnupatterns.m4')
REGRESSION_TEST(`gnupatterns2', `m4 -g gnupatterns2.m4')
REGRESSION_TEST(`gnuprefix', `m4 -P gnuprefix.m4 2>&1')
REGRESSION_TEST(`gnusofterror', `m4 -g gnusofterror.m4 2>&1')
REGRESSION_TEST(`gnutranslit2', `m4 -g translit2.m4')
REGRESSION_TEST(`includes', `m4 -I. includes.m4')
REGRESSION_TEST(`m4wrap3', `m4 m4wrap3.m4')
REGRESSION_TEST(`patterns', `m4 patterns.m4')
REGRESSION_TEST(`quotes', `m4 quotes.m4 2>&1')
REGRESSION_TEST(`strangequotes', `uudecode -o /dev/stdout strangequotes.m4.uu | m4')
REGRESSION_TEST(`redef', `m4 redef.m4')
REGRESSION_TEST(`translit', `m4 translit.m4')
REGRESSION_TEST(`translit2', `m4 translit2.m4')
REGRESSION_END()

View file

@ -1,6 +0,0 @@
#!/bin/sh
# $FreeBSD$
cd `dirname $0`
m4 ../regress.m4 regress.sh | sh

View file

@ -1,4 +0,0 @@
# $FreeBSD$
all:
@m4 ${.CURDIR}/../regress.m4 ${.CURDIR}/regress.sh | sh /dev/stdin ${.CURDIR}

View file

@ -1,6 +0,0 @@
#!/bin/sh
# $FreeBSD$
cd `dirname $0`
m4 ../regress.m4 regress.sh | sh

View file

@ -1,4 +0,0 @@
# $FreeBSD$
all:
@m4 ${.CURDIR}/../regress.m4 ${.CURDIR}/regress.sh | sh /dev/stdin ${.CURDIR}

View file

@ -1,6 +0,0 @@
#!/bin/sh
# $FreeBSD$
cd `dirname $0`
m4 ../regress.m4 regress.sh | sh

View file

@ -1,6 +0,0 @@
# $FreeBSD$
all:
@m4 ${.CURDIR}/../regress.m4 ${.CURDIR}/regress.sh | sh /dev/stdin ${.CURDIR}
@sh multitest.t
@sh inplace_race.t

View file

@ -1,6 +0,0 @@
#!/bin/sh
# $FreeBSD$
cd `dirname $0`
m4 ../regress.m4 regress.sh | sh

View file

@ -1,4 +0,0 @@
# $FreeBSD$
all:
@m4 ${.CURDIR}/../regress.m4 ${.CURDIR}/regress.sh | sh /dev/stdin ${.CURDIR}

View file

@ -1,22 +0,0 @@
# $FreeBSD$
echo 1..14
REGRESSION_START($1)
REGRESSION_TEST(`00', `tr abcde 12345 < regress.in')
REGRESSION_TEST(`01', `tr 12345 abcde < regress.in')
REGRESSION_TEST(`02', `tr -d aceg < regress.in')
REGRESSION_TEST(`03', `tr "[[:lower:]]" "[[:upper:]]" < regress.in')
REGRESSION_TEST(`04', `tr "[[:alpha:]]" . < regress.in')
REGRESSION_TEST(`05', `tr "[[:lower:]]" "[[:upper:]]" < regress.in | tr "[[:upper:]]" "[[:lower:]]"')
REGRESSION_TEST(`06', `tr "[[:digit:]]" "?" < regress2.in')
REGRESSION_TEST(`07', `tr "[[:alnum:]]" "#" < regress2.in')
REGRESSION_TEST(`08', `tr "[[:upper:]]" "[[:lower:]]" < regress2.in | tr -d "[^[:alpha:]] "')
REGRESSION_TEST(`09', `printf "\\f\\r\\n" | tr "\\014\\r" "?#"')
REGRESSION_TEST(`0a', `printf "0xdeadbeef\\n" | tr "x[[:xdigit:]]" "?\$"')
REGRESSION_TEST(`0b', `(tr -cd "[[:xdigit:]]" < regress2.in ; echo)')
REGRESSION_TEST(`0c', `echo "[[[[]]]]" | tr -d "[=]=]"')
REGRESSION_TEST(`0d', `echo "]=[" | tr -d "[=]"')
REGRESSION_END()

View file

@ -1,6 +0,0 @@
#!/bin/sh
# $FreeBSD$
cd `dirname $0`
m4 ../regress.m4 regress.sh | sh

View file

@ -1,4 +0,0 @@
# $FreeBSD$
all:
@m4 ${.CURDIR}/../regress.m4 ${.CURDIR}/regress.sh | sh /dev/stdin ${.CURDIR}

View file

@ -1,10 +0,0 @@
# $FreeBSD$
echo 1..2
REGRESSION_START($1)
REGRESSION_TEST_ONE(`uudecode -p < regress.traditional.in', `traditional')
REGRESSION_TEST_ONE(`uudecode -p < regress.base64.in', `base64')
REGRESSION_END()

View file

@ -1,6 +0,0 @@
#!/bin/sh
# $FreeBSD$
cd `dirname $0`
m4 ../regress.m4 regress.sh | sh

View file

@ -1,4 +0,0 @@
# $FreeBSD$
all:
@m4 ${.CURDIR}/../regress.m4 ${.CURDIR}/regress.sh | sh /dev/stdin ${.CURDIR}

View file

@ -1,13 +0,0 @@
# $FreeBSD$
echo 1..2
REGRESSION_START($1)
# To make sure we end up with matching headers.
umask 022
REGRESSION_TEST(`traditional', `uuencode regress.in < regress.in')
REGRESSION_TEST(`base64', `uuencode -m regress.in < regress.in')
REGRESSION_END()

View file

@ -1,6 +0,0 @@
#!/bin/sh
# $FreeBSD$
cd `dirname $0`
m4 ../regress.m4 regress.sh | sh

View file

@ -1,4 +0,0 @@
# $FreeBSD$
all:
@m4 ${.CURDIR}/../regress.m4 ${.CURDIR}/regress.sh | sh /dev/stdin ${.CURDIR}

View file

@ -1,21 +0,0 @@
# $FreeBSD$
echo 1..13
REGRESSION_START($1)
REGRESSION_TEST(`normal', `xargs echo The < regress.in')
REGRESSION_TEST(`I', `xargs -I% echo The % % % %% % % < regress.in')
REGRESSION_TEST(`J', `xargs -J% echo The % again. < regress.in')
REGRESSION_TEST(`L', `xargs -L3 echo < regress.in')
REGRESSION_TEST(`R', `xargs -I% -R1 echo The % % % %% % % < regress.in')
REGRESSION_TEST(`n1', `xargs -n1 echo < regress.in')
REGRESSION_TEST(`n2', `xargs -n2 echo < regress.in')
REGRESSION_TEST(`n3', `xargs -n3 echo < regress.in')
REGRESSION_TEST(`0', `xargs -0 -n1 echo < regress.0.in')
REGRESSION_TEST(`0I', `xargs -0 -I% echo The % %% % < regress.0.in')
REGRESSION_TEST(`0J', `xargs -0 -J% echo The % again. < regress.0.in')
REGRESSION_TEST(`0L', `xargs -0 -L2 echo < regress.0.in')
REGRESSION_TEST(`quotes', `xargs -n1 echo < regress.quotes.in')
REGRESSION_END()

View file

@ -1,6 +0,0 @@
#!/bin/sh
# $FreeBSD$
cd `dirname $0`
m4 ../regress.m4 regress.sh | sh

View file

@ -1,4 +0,0 @@
# $FreeBSD$
all:
@m4 ${.CURDIR}/../regress.m4 ${.CURDIR}/regress.sh | sh /dev/stdin ${.CURDIR}

View file

@ -1,26 +0,0 @@
# $FreeBSD$
LC_ALL=C; export LC_ALL
echo 1..15
REGRESSION_START($1)
REGRESSION_TEST(`00', `yacc -b regress -o /dev/stdout undefined.y')
REGRESSION_TEST(`01', `yacc -b regress -o /dev/stdout calc.y')
REGRESSION_TEST(`02', `yacc -b regress -o /dev/stdout calc1.y')
REGRESSION_TEST(`03', `yacc -b regress -o /dev/stdout calc3.y')
REGRESSION_TEST(`04', `yacc -b regress -o /dev/stdout code_calc.y')
REGRESSION_TEST(`05', `yacc -b regress -o /dev/stdout code_error.y')
REGRESSION_TEST(`06', `yacc -b regress -o /dev/stdout error.y')
REGRESSION_TEST(`07', `yacc -b regress -o /dev/stdout ftp.y')
REGRESSION_TEST(`08', `yacc -b regress -o /dev/stdout grammar.y')
REGRESSION_TEST(`09', `yacc -b regress -o /dev/stdout pure_calc.y')
REGRESSION_TEST(`10', `yacc -b regress -o /dev/stdout pure_error.y')
REGRESSION_TEST(`11', `yacc -b regress -o /dev/stdout quote_calc.y')
REGRESSION_TEST(`12', `yacc -b regress -o /dev/stdout quote_calc2.y')
REGRESSION_TEST(`13', `yacc -b regress -o /dev/stdout quote_calc3.y')
REGRESSION_TEST(`14', `yacc -b regress -o /dev/stdout quote_calc4.y')
REGRESSION_END()

View file

@ -1,6 +0,0 @@
#!/bin/sh
# $FreeBSD$
cd `dirname $0`
m4 ../regress.m4 regress.sh | sh

View file

@ -1,8 +1,14 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
# $FreeBSD$
.include <bsd.own.mk>
PROG= apply
DPADD= ${LIBSBUF}
LDADD= -lsbuf
.if ${MK_TESTS} != "no"
SUBDIR+= tests
.endif
.include <bsd.prog.mk>

View file

@ -0,0 +1,14 @@
# $FreeBSD$
TESTSDIR= ${TESTSBASE}/usr.bin/apply
TAP_TESTS_SH= legacy_test
FILESDIR= ${TESTSDIR}
FILES= regress.00.in
FILES+= regress.00.out
FILES+= regress.01.out
FILES+= regress.01.sh
FILES+= regress.sh
.include <bsd.test.mk>

View file

@ -0,0 +1,6 @@
#!/bin/sh
# $FreeBSD$
SRCDIR="$(dirname "${0}")"; export SRCDIR
m4 "${SRCDIR}/../regress.m4" "${SRCDIR}/regress.sh" | sh

View file

@ -0,0 +1,10 @@
# $FreeBSD$
echo 1..2
REGRESSION_START($1)
REGRESSION_TEST(`00', `apply "echo %1 %1 %1 %1" $(cat ${SRCDIR}/regress.00.in)')
REGRESSION_TEST(`01', `sh ${SRCDIR}/regress.01.sh')
REGRESSION_END()

View file

@ -1,6 +1,8 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
# $FreeBSD$
.include <bsd.own.mk>
PROG= calendar
SRCS= calendar.c locale.c events.c dates.c parsedata.c io.c day.c \
ostern.c paskha.c pom.c sunpos.c calcpp.c
@ -31,4 +33,8 @@ beforeinstall:
ln -s fr_FR.ISO8859-1 ${DESTDIR}${SHAREDIR}/calendar/${link}
.endfor
.if ${MK_TESTS} != "no"
SUBDIR+= tests
.endif
.include <bsd.prog.mk>

View file

@ -0,0 +1,39 @@
# $FreeBSD$
TESTSDIR= ${TESTSBASE}/usr.bin/calendar
TAP_TESTS_SH= legacy_test
FILESDIR= ${TESTSDIR}
FILES= calendar.calibrate
FILES+= regress.a1.out
FILES+= regress.a2.out
FILES+= regress.a3.out
FILES+= regress.a4.out
FILES+= regress.a5.out
FILES+= regress.b1.out
FILES+= regress.b2.out
FILES+= regress.b3.out
FILES+= regress.b4.out
FILES+= regress.b5.out
FILES+= regress.s1.out
FILES+= regress.s2.out
FILES+= regress.s3.out
FILES+= regress.s4.out
FILES+= regress.sh
FILES+= regress.w0-1.out
FILES+= regress.w0-2.out
FILES+= regress.w0-3.out
FILES+= regress.w0-4.out
FILES+= regress.w0-5.out
FILES+= regress.w0-6.out
FILES+= regress.w0-7.out
FILES+= regress.wn-1.out
FILES+= regress.wn-2.out
FILES+= regress.wn-3.out
FILES+= regress.wn-4.out
FILES+= regress.wn-5.out
FILES+= regress.wn-6.out
FILES+= regress.wn-7.out
.include <bsd.test.mk>

View file

@ -0,0 +1,6 @@
#!/bin/sh
# $FreeBSD$
SRCDIR="$(dirname "${0}")"; export SRCDIR
m4 "${SRCDIR}/../regress.m4" "${SRCDIR}/regress.sh" | sh

View file

@ -1,6 +1,6 @@
# $FreeBSD$
CALENDAR_FILE="-f calendar.calibrate"
CALENDAR_FILE="-f ${SRCDIR}/calendar.calibrate"
CALENDAR_BIN="calendar"
CALENDAR="${CALENDAR_BIN} ${CALENDAR_FILE}"

View file

@ -1,6 +1,12 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
# $FreeBSD$
.include <bsd.own.mk>
PROG= comm
.if ${MK_TESTS} != "no"
SUBDIR+= tests
.endif
.include <bsd.prog.mk>

View file

@ -0,0 +1,19 @@
# $FreeBSD$
TESTSDIR= ${TESTSBASE}/usr.bin/comm
TAP_TESTS_SH= legacy_test
FILESDIR= ${TESTSDIR}
FILES= regress.00.out
FILES+= regress.00a.in
FILES+= regress.00b.in
FILES+= regress.01.out
FILES+= regress.01a.in
FILES+= regress.01b.in
FILES+= regress.02.out
FILES+= regress.02a.in
FILES+= regress.02b.in
FILES+= regress.sh
.include <bsd.test.mk>

View file

@ -0,0 +1,6 @@
#!/bin/sh
# $FreeBSD$
SRCDIR="$(dirname "${0}")"; export SRCDIR
m4 "${SRCDIR}/../regress.m4" "${SRCDIR}/regress.sh" | sh

View file

@ -0,0 +1,11 @@
# $FreeBSD$
echo 1..3
REGRESSION_START($1)
REGRESSION_TEST(`00', `comm -12 ${SRCDIR}/regress.00a.in ${SRCDIR}/regress.00b.in')
REGRESSION_TEST(`01', `comm -12 ${SRCDIR}/regress.01a.in ${SRCDIR}/regress.01b.in')
REGRESSION_TEST(`02', `comm ${SRCDIR}/regress.02a.in ${SRCDIR}/regress.02b.in')
REGRESSION_END()

View file

@ -1,4 +1,11 @@
# $FreeBSD$
.include <bsd.own.mk>
PROG= file2c
.if ${MK_TESTS} != "no"
SUBDIR+= tests
.endif
.include <bsd.prog.mk>

View file

@ -0,0 +1,20 @@
# $FreeBSD$
TESTSDIR= ${TESTSBASE}/usr.bin/file2c
TAP_TESTS_SH= legacy_test
FILESDIR= ${TESTSDIR}
FILES= regress.1.out
FILES+= regress.2.out
FILES+= regress.3.out
FILES+= regress.4.out
FILES+= regress.5.out
FILES+= regress.6.out
FILES+= regress.7.out
FILES+= regress.8.out
FILES+= regress.9.out
FILES+= regress.in
FILES+= regress.sh
.include <bsd.test.mk>

View file

@ -0,0 +1,6 @@
#!/bin/sh
# $FreeBSD$
SRCDIR="$(dirname "${0}")"; export SRCDIR
m4 "${SRCDIR}/../regress.m4" "${SRCDIR}/regress.sh" | sh

Some files were not shown because too many files have changed in this diff Show more