Module Name: src
Committed By: jruoho
Date: Fri Apr 13 06:12:32 UTC 2012
Modified Files:
src/tests/bin/sh: t_exit.sh
Log Message:
Although this does not fail, add a case for the discussion in PR bin/46327.
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/bin/sh/t_exit.sh
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/bin/sh/t_exit.sh
diff -u src/tests/bin/sh/t_exit.sh:1.2 src/tests/bin/sh/t_exit.sh:1.3
--- src/tests/bin/sh/t_exit.sh:1.2 Sun Mar 25 17:30:59 2012
+++ src/tests/bin/sh/t_exit.sh Fri Apr 13 06:12:32 2012
@@ -1,4 +1,4 @@
-# $NetBSD: t_exit.sh,v 1.2 2012/03/25 17:30:59 christos Exp $
+# $NetBSD: t_exit.sh,v 1.3 2012/04/13 06:12:32 jruoho Exp $
#
# Copyright (c) 2007 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -33,6 +33,16 @@ $?
EOF
}
+atf_test_case background
+background_head() {
+ atf_set "descr" "Tests that sh(1) sets '$?' properly when running " \
+ "a command in the background (PR bin/46327)"
+}
+background_body() {
+ atf_check -s exit:0 -o ignore -e ignore -x "true; true & echo $?"
+ atf_check -s exit:0 -o ignore -e ignore -x "false; true & echo $?"
+}
+
atf_test_case function
function_head() {
atf_set "descr" "Tests that \$? is correctly updated inside" \
@@ -85,6 +95,7 @@ trap_zero__explicit_return_body() {
}
atf_init_test_cases() {
+ atf_add_test_case background
atf_add_test_case function
atf_add_test_case readout
atf_add_test_case trap_subshell