Author: ngie
Date: Sat May 27 22:40:20 2017
New Revision: 319002
URL: https://svnweb.freebsd.org/changeset/base/319002

Log:
  :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

Modified:
  head/usr.bin/grep/tests/grep_freebsd_test.sh

Modified: head/usr.bin/grep/tests/grep_freebsd_test.sh
==============================================================================
--- head/usr.bin/grep/tests/grep_freebsd_test.sh        Sat May 27 21:46:00 
2017        (r319001)
+++ head/usr.bin/grep/tests/grep_freebsd_test.sh        Sat May 27 22:40:20 
2017        (r319002)
@@ -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)"
 }
 
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to