From 0c9339f1bdafed39d7c631bb40d2c96eb52aaf54 Mon Sep 17 00:00:00 2001 From: anton Date: Thu, 16 Sep 2021 10:54:35 +0000 Subject: [PATCH] various improvements: * use SUDO when needed * favor paths relative to the btrace regress directory in the expected output files, prevents one from being forced to checkout the src tree at /usr/src in order to make the tests pass --- regress/usr.sbin/btrace/Makefile | 7 +++---- regress/usr.sbin/btrace/mapsyntax.ok | 4 ++-- regress/usr.sbin/btrace/syntaxerror.ok | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/regress/usr.sbin/btrace/Makefile b/regress/usr.sbin/btrace/Makefile index 30b63b411e4..a2382250585 100644 --- a/regress/usr.sbin/btrace/Makefile +++ b/regress/usr.sbin/btrace/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.21 2021/09/09 20:08:15 jasper Exp $ +# $OpenBSD: Makefile,v 1.22 2021/09/16 10:54:35 anton Exp $ BTRACE?= /usr/sbin/btrace ALLOWDT!= sysctl -n kern.allowdt @@ -19,8 +19,7 @@ REGRESS_EXPECTED_FAILURES= run-maxoperand .for b in ${BT_LANG_SCRIPTS} REGRESS_TARGETS+= run-$b run-$b: - ${BTRACE} ${.CURDIR}/$b.bt 2>&1 | \ - diff -u ${.CURDIR}/$b.ok /dev/stdin + cd ${.CURDIR} && ${BTRACE} $b.bt 2>&1 | diff -u $b.ok /dev/stdin .endfor b=staticv @@ -34,7 +33,7 @@ REGRESS_TARGETS+= run-$b REGRESS_ROOT_TARGETS+= run-$b run-$b: .if ${ALLOWDT} - ${BTRACE} ${.CURDIR}/$b.bt 2>&1 | \ + ${SUDO} ${BTRACE} ${.CURDIR}/$b.bt 2>&1 | \ diff -u ${.CURDIR}/$b.ok /dev/stdin .else @echo SKIPPED diff --git a/regress/usr.sbin/btrace/mapsyntax.ok b/regress/usr.sbin/btrace/mapsyntax.ok index 09ce285cc32..bebe2a9b8b0 100644 --- a/regress/usr.sbin/btrace/mapsyntax.ok +++ b/regress/usr.sbin/btrace/mapsyntax.ok @@ -1,6 +1,6 @@ -/usr/src/regress/usr.sbin/btrace/mapsyntax.bt:2:8: syntax error: +mapsyntax.bt:2:8: syntax error: zero(42); ^ -/usr/src/regress/usr.sbin/btrace/mapsyntax.bt:6:8: syntax error: +mapsyntax.bt:6:8: syntax error: clear(0); ^ diff --git a/regress/usr.sbin/btrace/syntaxerror.ok b/regress/usr.sbin/btrace/syntaxerror.ok index 6e335c69456..4f03a52941b 100644 --- a/regress/usr.sbin/btrace/syntaxerror.ok +++ b/regress/usr.sbin/btrace/syntaxerror.ok @@ -1,3 +1,3 @@ -/usr/src/regress/usr.sbin/btrace/syntaxerror.bt:3:4: syntax error: +syntaxerror.bt:3:4: syntax error: foo; ^ -- 2.20.1