Module Name:    src
Committed By:   pgoyette
Date:           Mon Dec 27 05:27:34 UTC 2010

Modified Files:
        src/tests/lib/libc/ssp: t_ssp.sh

Log Message:
Since atf_check doesn't deal with a pipeline, modify the tests to pipe
the output of the echo commands to atf_check itself.  This fixes the
three new ssp failures.

Note that the raw, strcpy, vsprintf, and vsnprintf tests still fail, but
they failed in the old 'regress' style, too.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/ssp/t_ssp.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/lib/libc/ssp/t_ssp.sh
diff -u src/tests/lib/libc/ssp/t_ssp.sh:1.1 src/tests/lib/libc/ssp/t_ssp.sh:1.2
--- src/tests/lib/libc/ssp/t_ssp.sh:1.1	Mon Dec 27 02:04:19 2010
+++ src/tests/lib/libc/ssp/t_ssp.sh	Mon Dec 27 05:27:34 2010
@@ -1,4 +1,4 @@
-# $NetBSD: t_ssp.sh,v 1.1 2010/12/27 02:04:19 pgoyette Exp $
+# $NetBSD: t_ssp.sh,v 1.2 2010/12/27 05:27:34 pgoyette Exp $
 #
 # Copyright (c) 2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -27,14 +27,14 @@
 
 h_pass()
 {
-	echo "Executing command [ $1 ]"
-	atf_check -s exit:0 -o ignore -e ignore $1
+	echo "Executing command [ $2$1 ]"
+	eval $2 atf_check -s exit:0 -o ignore -e ignore $1
 }
 
 h_fail()
 {
-	echo "Executing command [ $1 ]"
-	atf_check -s signal:6 -o ignore -e ignore $1
+	echo "Executing command [ $2$1 ]"
+	eval $2 atf_check -s signal:6 -o ignore -e ignore $1
 }
 
 atf_test_case raw
@@ -111,8 +111,8 @@
 {
 	prog="$(atf_get_srcdir)/h_gets"
 
-	h_pass "echo ok | $prog"
-	h_fail "echo 0123456789 | $prog"
+	h_pass "$prog" "echo ok |"
+	h_fail "$prog" "echo 0123456789 |"
 }
 
 atf_test_case fgets
@@ -124,8 +124,8 @@
 {
 	prog="$(atf_get_srcdir)/h_fgets"
 
-	h_pass "echo ok | $prog 10"
-	h_fail "echo busted | $prog 11"
+	h_pass "$prog 10" "echo ok |"
+	h_fail "$prog 11" "echo busted |"
 }
 
 atf_test_case memcpy
@@ -228,8 +228,8 @@
 {
 	prog="$(atf_get_srcdir)/h_read"
 
-	h_pass "echo foo | $prog 1024"
-	h_fail "echo bar | $prog 1025"
+	h_pass "$prog 1024" "echo foo |"
+	h_fail "$prog 1025" "echo bar |"
 }
 
 atf_test_case readlink

Reply via email to