Module Name:src
Committed By: christos
Date: Sat Jan 14 20:43:52 UTC 2017
Modified Files:
src/tests/usr.bin/grep: d_binary.out t_grep.sh
Log Message:
PR/51875: Ngie Cooper: portability fixes
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/grep/d_binary.out
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/grep/t_grep.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/usr.bin/grep/d_binary.out
diff -u src/tests/usr.bin/grep/d_binary.out:1.1 src/tests/usr.bin/grep/d_binary.out:1.2
--- src/tests/usr.bin/grep/d_binary.out:1.1 Sat Mar 17 12:33:13 2012
+++ src/tests/usr.bin/grep/d_binary.out Sat Jan 14 15:43:52 2017
@@ -1 +1 @@
-Binary file /bin/sh matches
+Binary file test.file matches
Index: src/tests/usr.bin/grep/t_grep.sh
diff -u src/tests/usr.bin/grep/t_grep.sh:1.2 src/tests/usr.bin/grep/t_grep.sh:1.3
--- src/tests/usr.bin/grep/t_grep.sh:1.2 Fri May 17 11:39:17 2013
+++ src/tests/usr.bin/grep/t_grep.sh Sat Jan 14 15:43:52 2017
@@ -1,4 +1,4 @@
-# $NetBSD: t_grep.sh,v 1.2 2013/05/17 15:39:17 christos Exp $
+# $NetBSD: t_grep.sh,v 1.3 2017/01/14 20:43:52 christos Exp $
#
# Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -43,7 +43,9 @@ binary_head()
}
binary_body()
{
- atf_check -o file:"$(atf_get_srcdir)/d_binary.out" grep $(uname) /bin/sh
+ dd if=/dev/zero count=1 of=test.file
+ echo -n "foobar" >> test.file
+ atf_check -o file:"$(atf_get_srcdir)/d_binary.out" grep foobar test.file
}
atf_test_case recurse
@@ -57,7 +59,7 @@ recurse_body()
echo -e "cod\ndover sole\nhaddock\nhalibut\npilchard" > recurse/d/fish
echo -e "cod\nhaddock\nplaice" > recurse/a/f/favourite-fish
- atf_check -o file:"$(atf_get_srcdir)/d_recurse.out" grep -r haddock recurse
+ atf_check -o file:"$(atf_get_srcdir)/d_recurse.out" -x "grep -r haddock recurse | sort"
}
atf_test_case recurse_symlink