summaryrefslogtreecommitdiffstats
path: root/usr.bin/file2c/tests/regress.sh
diff options
context:
space:
mode:
authorjmmv <jmmv@FreeBSD.org>2014-03-16 08:04:06 +0000
committerjmmv <jmmv@FreeBSD.org>2014-03-16 08:04:06 +0000
commit41a8d8c29552ddd9098cfb09a71927f503a28371 (patch)
treea434fba265da51ef79b1cfc4461e1080dbe53e90 /usr.bin/file2c/tests/regress.sh
parentb2e51e38a88412c17ce1160c247a6d673c0b2147 (diff)
downloadFreeBSD-src-41a8d8c29552ddd9098cfb09a71927f503a28371.zip
FreeBSD-src-41a8d8c29552ddd9098cfb09a71927f503a28371.tar.gz
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.
Diffstat (limited to 'usr.bin/file2c/tests/regress.sh')
-rw-r--r--usr.bin/file2c/tests/regress.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/usr.bin/file2c/tests/regress.sh b/usr.bin/file2c/tests/regress.sh
new file mode 100644
index 0000000..c8146e7
--- /dev/null
+++ b/usr.bin/file2c/tests/regress.sh
@@ -0,0 +1,19 @@
+# $FreeBSD$
+
+echo 1..9
+
+REGRESSION_START($1)
+
+REGRESSION_TEST(`1', `head -c 13 ${SRCDIR}/regress.in | file2c')
+REGRESSION_TEST(`2', `head -c 26 ${SRCDIR}/regress.in | file2c PREFIX')
+REGRESSION_TEST(`3', `head -c 39 ${SRCDIR}/regress.in | file2c PREFIX SUFFIX')
+REGRESSION_TEST(`4', `head -c 52 ${SRCDIR}/regress.in | file2c -x')
+REGRESSION_TEST(`5', `head -c 65 ${SRCDIR}/regress.in | file2c -n -1')
+
+REGRESSION_TEST(`6', `head -c 7 ${SRCDIR}/regress.in | file2c -n 1 P S')
+REGRESSION_TEST(`7', `head -c 14 ${SRCDIR}/regress.in | file2c -n 2 -x "P S"')
+REGRESSION_TEST(`8', `head -c 21 ${SRCDIR}/regress.in | file2c -n 16 P -x S')
+
+REGRESSION_TEST(`9', `file2c "const char data[] = {" ", 0};" <${SRCDIR}/regress.in')
+
+REGRESSION_END()
OpenPOWER on IntegriCloud