Test that syntax errors do not trigger sanity checks.
authormpi <mpi@openbsd.org>
Tue, 7 Sep 2021 19:20:22 +0000 (19:20 +0000)
committermpi <mpi@openbsd.org>
Tue, 7 Sep 2021 19:20:22 +0000 (19:20 +0000)
regress/usr.sbin/btrace/Makefile
regress/usr.sbin/btrace/syntaxerror.bt [new file with mode: 0644]
regress/usr.sbin/btrace/syntaxerror.ok [new file with mode: 0644]

index 0e2aba1..8fd429e 100644 (file)
@@ -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 (file)
index 0000000..764c396
--- /dev/null
@@ -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 (file)
index 0000000..6e335c6
--- /dev/null
@@ -0,0 +1,3 @@
+/usr/src/regress/usr.sbin/btrace/syntaxerror.bt:3:4: syntax error:
+       foo;
+          ^