From d53f6ecc29e2b3e74feb2e7bd91dbd7a98ada834 Mon Sep 17 00:00:00 2001 From: mpi Date: Tue, 7 Sep 2021 19:20:22 +0000 Subject: [PATCH] Test that syntax errors do not trigger sanity checks. --- regress/usr.sbin/btrace/Makefile | 6 +++--- regress/usr.sbin/btrace/syntaxerror.bt | 5 +++++ regress/usr.sbin/btrace/syntaxerror.ok | 3 +++ 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 regress/usr.sbin/btrace/syntaxerror.bt create mode 100644 regress/usr.sbin/btrace/syntaxerror.ok 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; + ^ -- 2.20.1