diff --git a/tools/regression/usr.bin/Makefile b/tools/regression/usr.bin/Makefile index 3137e3de7984..25c90e95aad7 100644 --- a/tools/regression/usr.bin/Makefile +++ b/tools/regression/usr.bin/Makefile @@ -1,5 +1,5 @@ # $FreeBSD$ -SUBDIR= file2c join jot m4 sed uudecode uuencode xargs +SUBDIR= file2c join jot m4 printf sed uudecode uuencode xargs .include diff --git a/tools/regression/usr.bin/printf/Makefile b/tools/regression/usr.bin/printf/Makefile new file mode 100644 index 000000000000..b937d41a4e4a --- /dev/null +++ b/tools/regression/usr.bin/printf/Makefile @@ -0,0 +1,4 @@ +# $FreeBSD$ + +all: + @m4 ${.CURDIR}/../regress.m4 ${.CURDIR}/regress.sh | sh /dev/stdin ${.CURDIR} diff --git a/tools/regression/usr.bin/printf/regress.b.out b/tools/regression/usr.bin/printf/regress.b.out new file mode 100644 index 000000000000..0373d9336f8c --- /dev/null +++ b/tools/regression/usr.bin/printf/regress.b.out @@ -0,0 +1 @@ +abcdef diff --git a/tools/regression/usr.bin/printf/regress.d.out b/tools/regression/usr.bin/printf/regress.d.out new file mode 100644 index 000000000000..da83c085263c --- /dev/null +++ b/tools/regression/usr.bin/printf/regress.d.out @@ -0,0 +1 @@ +123, 123,00123,00123,00123 diff --git a/tools/regression/usr.bin/printf/regress.f.out b/tools/regression/usr.bin/printf/regress.f.out new file mode 100644 index 000000000000..127cb8aebe25 --- /dev/null +++ b/tools/regression/usr.bin/printf/regress.f.out @@ -0,0 +1 @@ +42.250000,-42.250 ,inf,nan diff --git a/tools/regression/usr.bin/printf/regress.m1.out b/tools/regression/usr.bin/printf/regress.m1.out new file mode 100644 index 000000000000..05311de99865 --- /dev/null +++ b/tools/regression/usr.bin/printf/regress.m1.out @@ -0,0 +1 @@ +a%97% diff --git a/tools/regression/usr.bin/printf/regress.m2.out b/tools/regression/usr.bin/printf/regress.m2.out new file mode 100644 index 000000000000..8baef1b4abc4 --- /dev/null +++ b/tools/regression/usr.bin/printf/regress.m2.out @@ -0,0 +1 @@ +abc diff --git a/tools/regression/usr.bin/printf/regress.m3.out b/tools/regression/usr.bin/printf/regress.m3.out new file mode 100644 index 000000000000..bbe4e70c33f4 --- /dev/null +++ b/tools/regression/usr.bin/printf/regress.m3.out @@ -0,0 +1,4 @@ +%abc +%def +%ghi +%jkl diff --git a/tools/regression/usr.bin/printf/regress.m4.out b/tools/regression/usr.bin/printf/regress.m4.out new file mode 100644 index 000000000000..5e0b5d4072a4 --- /dev/null +++ b/tools/regression/usr.bin/printf/regress.m4.out @@ -0,0 +1 @@ +0,0.000000,, diff --git a/tools/regression/usr.bin/printf/regress.s.out b/tools/regression/usr.bin/printf/regress.s.out new file mode 100644 index 000000000000..3d572b93c8f7 --- /dev/null +++ b/tools/regression/usr.bin/printf/regress.s.out @@ -0,0 +1 @@ +abc,abc diff --git a/tools/regression/usr.bin/printf/regress.sh b/tools/regression/usr.bin/printf/regress.sh new file mode 100644 index 000000000000..f29564b78bb3 --- /dev/null +++ b/tools/regression/usr.bin/printf/regress.sh @@ -0,0 +1,16 @@ +# $FreeBSD$ + +REGRESSION_START($1) + +echo '1..8' + +REGRESSION_TEST(`b', `printf "abc%b%b" "def\n" "\cghi"') +REGRESSION_TEST(`d', `printf "%d,%5d,%.5d,%0*d,%.*d\n" 123 123 123 5 123 5 123') +REGRESSION_TEST(`f', `printf "%f,%-8.3f,%f,%f\n" +42.25 -42.25 inf nan') +REGRESSION_TEST(`m1', `printf "%c%%%d\045\n" abc \"abc') +REGRESSION_TEST(`m2', `printf "abc\n\cdef"') +REGRESSION_TEST(`m3', `printf "%%%s\n" abc def ghi jkl') +REGRESSION_TEST(`m4', `printf "%d,%f,%c,%s\n"') +REGRESSION_TEST(`s', `printf "%.3s,%-5s\n" abcd abc') + +REGRESSION_END() diff --git a/tools/regression/usr.bin/printf/regress.t b/tools/regression/usr.bin/printf/regress.t new file mode 100644 index 000000000000..a82aacd9886f --- /dev/null +++ b/tools/regression/usr.bin/printf/regress.t @@ -0,0 +1,6 @@ +#!/bin/sh +# $FreeBSD$ + +cd `dirname $0` + +m4 ../regress.m4 regress.sh | sh