fix one test (bash vs. ksh), skip another (lack of script(1) options)

This commit is contained in:
kn
2023-10-22 16:36:30 +00:00
parent 5bc0e1c6cf
commit 0c8989a377
3 changed files with 22 additions and 15 deletions
+2
View File
@@ -30,4 +30,6 @@ CONFIGURE_ARGS += --disable-docs
# makes all tests fail with SIGILL
CONFIGURE_ARGS += --disable-valgrind
TEST_DEPENDS = shells/bash
.include <bsd.port.mk>
-15
View File
@@ -1,15 +0,0 @@
Index: src/main.c
--- src/main.c.orig
+++ src/main.c
@@ -334,6 +334,11 @@ int main(int argc, char* argv[]) {
_setmode(fileno(stderr), _O_TEXT | _O_U8TEXT);
#endif
+ if (pledge("stdio getpw rpath", NULL) == -1) {
+ fprintf(stderr, "pledge\n");
+ die();
+ }
+
if (argc) progname = argv[0];
jq = jq_init();
+20
View File
@@ -0,0 +1,20 @@
- use bash(1) as ksh(1) `set -v' behaviour difference causes false positive
- skip one test expecting script(1) `-e' and `-q'
Index: tests/shtest
--- tests/shtest.orig
+++ tests/shtest
@@ -1,4 +1,4 @@
-#!/bin/sh -x
+#!/usr/local/bin/bash -x
. "${0%/*}/setup" "$@"
@@ -506,6 +506,7 @@ cmp $d/warning $d/expect_warning
test_no_color=true
$msys && test_no_color=false
$mingw && test_no_color=false
+[ "$(uname -s)" = OpenBSD ] && test_no_color=false
if $test_no_color && command -v script >/dev/null 2>&1; then
unset NO_COLOR
if script -qc echo /dev/null >/dev/null 2>&1; then