summaryrefslogtreecommitdiffstats
path: root/tests/posix/exec_nonexistent.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/posix/exec_nonexistent.sh')
-rw-r--r--tests/posix/exec_nonexistent.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/posix/exec_nonexistent.sh b/tests/posix/exec_nonexistent.sh
new file mode 100644
index 0000000..b4e08e0
--- /dev/null
+++ b/tests/posix/exec_nonexistent.sh
@@ -0,0 +1,8 @@
+# Failure to execute the command should lead to an error message and
+# non-zero exit status. See https://unix.stackexchange.com/q/704522/56202
+
+stderr=$(invoke_bfs basic -exec "$TESTS/nonexistent" {} \; 2>&1 >/dev/null)
+[ -n "$stderr" ] || return 1
+
+bfs_diff basic -print -exec "$TESTS/nonexistent" {} \; -print
+(($? == EX_BFS))