summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2021-09-07 19:20:23 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2021-09-07 19:20:23 +0000
commitbc61c3e00166bc11a7494c2e3bcadc0129059d15 (patch)
tree712d061825349f833a8e4313afcdf9045dccee85 /regress
parent1b00904f38d0996d7b812e86fa13865398e0959f (diff)
Test that syntax errors do not trigger sanity checks.
Diffstat (limited to 'regress')
-rw-r--r--regress/usr.sbin/btrace/Makefile6
-rw-r--r--regress/usr.sbin/btrace/syntaxerror.bt5
-rw-r--r--regress/usr.sbin/btrace/syntaxerror.ok3
3 files changed, 11 insertions, 3 deletions
diff --git a/regress/usr.sbin/btrace/Makefile b/regress/usr.sbin/btrace/Makefile
index 0e2aba1398b..8fd429e24a5 100644
--- a/regress/usr.sbin/btrace/Makefile
+++ b/regress/usr.sbin/btrace/Makefile
@@ -1,11 +1,11 @@
-# $OpenBSD: Makefile,v 1.12 2021/09/01 13:22:36 mpi Exp $
+# $OpenBSD: Makefile,v 1.13 2021/09/07 19:20:22 mpi Exp $
BTRACE?= /usr/sbin/btrace
# scripts that don't need /dev/dt
BT_LANG_SCRIPTS= arithm beginend boolean comments delete exit if map \
map-unnamed maxoperand min+max+sum multismts nsecs+var \
- precedence print read-map-after-clear
+ precedence print read-map-after-clear syntaxerror
BT_KERN_SCRIPTS=
@@ -14,7 +14,7 @@ REGRESS_EXPECTED_FAILURES= run-maxoperand
.for b in ${BT_LANG_SCRIPTS}
REGRESS_TARGETS+= run-$b
run-$b:
- ${BTRACE} ${.CURDIR}/$b.bt | \
+ ${BTRACE} ${.CURDIR}/$b.bt 2>&1 | \
diff -u ${.CURDIR}/$b.ok /dev/stdin
.endfor
diff --git a/regress/usr.sbin/btrace/syntaxerror.bt b/regress/usr.sbin/btrace/syntaxerror.bt
new file mode 100644
index 00000000000..764c3961aac
--- /dev/null
+++ b/regress/usr.sbin/btrace/syntaxerror.bt
@@ -0,0 +1,5 @@
+BEGIN {
+ $a = "b";
+ foo;
+}
+
diff --git a/regress/usr.sbin/btrace/syntaxerror.ok b/regress/usr.sbin/btrace/syntaxerror.ok
new file mode 100644
index 00000000000..6e335c69456
--- /dev/null
+++ b/regress/usr.sbin/btrace/syntaxerror.ok
@@ -0,0 +1,3 @@
+/usr/src/regress/usr.sbin/btrace/syntaxerror.bt:3:4: syntax error:
+ foo;
+ ^