From 80c5ef109c8d1dab9c7500dcf1fd368e8fabb55e Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Sat, 27 May 2017 22:40:20 +0000 Subject: [PATCH] :rgrep : use atf-check to check the exit code/save the output of grep -r instead of calling grep -r without it, and saving the output to a file This ensures that any errors thrown via grep -r are caught, not lost, and uses existing atf-sh idioms for saving files. Tested with: bsdgrep, gnu grep (base, ports) Sponsored by: Dell EMC Isilon --- usr.bin/grep/tests/grep_freebsd_test.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/usr.bin/grep/tests/grep_freebsd_test.sh b/usr.bin/grep/tests/grep_freebsd_test.sh index fafa23f03b67..ab998ecee893 100755 --- a/usr.bin/grep/tests/grep_freebsd_test.sh +++ b/usr.bin/grep/tests/grep_freebsd_test.sh @@ -77,8 +77,7 @@ rgrep_head() } rgrep_body() { - grep -r --exclude="*.out" -e "test" "$(atf_get_srcdir)" > d_grep_r_implied.out - + atf_check -o save:d_grep_r_implied.out grep -r --exclude="*.out" -e "test" "$(atf_get_srcdir)" atf_check -o file:d_grep_r_implied.out rgrep --exclude="*.out" -e "test" "$(atf_get_srcdir)" }