Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/bin/sh Although this does not fail, add a case for the...



details:   https://anonhg.NetBSD.org/src/rev/69c38b32f678
branches:  trunk
changeset: 778770:69c38b32f678
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Fri Apr 13 06:12:32 2012 +0000

description:
Although this does not fail, add a case for the discussion in PR bin/46327.

diffstat:

 tests/bin/sh/t_exit.sh |  13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diffs (34 lines):

diff -r ae9d9d549a8c -r 69c38b32f678 tests/bin/sh/t_exit.sh
--- a/tests/bin/sh/t_exit.sh    Fri Apr 13 06:10:55 2012 +0000
+++ b/tests/bin/sh/t_exit.sh    Fri Apr 13 06:12:32 2012 +0000
@@ -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 @@
 }
 
 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



Home | Main Index | Thread Index | Old Index