summaryrefslogtreecommitdiffstats
path: root/tools/regression
diff options
context:
space:
mode:
authorstefanf <stefanf@FreeBSD.org>2005-04-13 20:08:17 +0000
committerstefanf <stefanf@FreeBSD.org>2005-04-13 20:08:17 +0000
commitc7fefa410d541d7c97359e2acd21eb5dc9d95c01 (patch)
tree5f30a7baab6d1a1276ea4e966e18d3e5af396930 /tools/regression
parentfd79e6a683f5cdeccf9f8e28fa75f6ee8ed529ed (diff)
downloadFreeBSD-src-c7fefa410d541d7c97359e2acd21eb5dc9d95c01.zip
FreeBSD-src-c7fefa410d541d7c97359e2acd21eb5dc9d95c01.tar.gz
Add a few regression tests for printf(1).
Diffstat (limited to 'tools/regression')
-rw-r--r--tools/regression/usr.bin/Makefile2
-rw-r--r--tools/regression/usr.bin/printf/Makefile4
-rw-r--r--tools/regression/usr.bin/printf/regress.b.out1
-rw-r--r--tools/regression/usr.bin/printf/regress.d.out1
-rw-r--r--tools/regression/usr.bin/printf/regress.f.out1
-rw-r--r--tools/regression/usr.bin/printf/regress.m1.out1
-rw-r--r--tools/regression/usr.bin/printf/regress.m2.out1
-rw-r--r--tools/regression/usr.bin/printf/regress.m3.out4
-rw-r--r--tools/regression/usr.bin/printf/regress.m4.out1
-rw-r--r--tools/regression/usr.bin/printf/regress.s.out1
-rw-r--r--tools/regression/usr.bin/printf/regress.sh16
-rw-r--r--tools/regression/usr.bin/printf/regress.t6
12 files changed, 38 insertions, 1 deletions
diff --git a/tools/regression/usr.bin/Makefile b/tools/regression/usr.bin/Makefile
index 3137e3d..25c90e9 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 <bsd.subdir.mk>
diff --git a/tools/regression/usr.bin/printf/Makefile b/tools/regression/usr.bin/printf/Makefile
new file mode 100644
index 0000000..b937d41
--- /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 0000000..0373d93
--- /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 0000000..da83c08
--- /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 0000000..127cb8a
--- /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 0000000..05311de
--- /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 0000000..8baef1b
--- /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 0000000..bbe4e70
--- /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 0000000..5e0b5d4
--- /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 0000000..3d572b9
--- /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 0000000..f29564b7
--- /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 0000000..a82aacd
--- /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
OpenPOWER on IntegriCloud