[commit: ghc] master: fix T4201 to avoid GNU grep specific -B option by usage of pure POSIX tools (02be4ff)

git at git.haskell.org git at git.haskell.org
Sun Aug 10 20:20:07 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/02be4ff783f192268904d85131c5a748097fbbc9/ghc

>---------------------------------------------------------------

commit 02be4ff783f192268904d85131c5a748097fbbc9
Author: Karel Gardas <karel.gardas at centrum.cz>
Date:   Sun Aug 10 22:19:31 2014 +0200

    fix T4201 to avoid GNU grep specific -B option by usage of pure POSIX tools
    
    Test Plan: validated on Linux and tested on Solaris
    
    Reviewers: austin
    
    Reviewed By: austin
    
    Subscribers: phaskell, simonmar, relrod, ezyang, carter
    
    Differential Revision: https://phabricator.haskell.org/D135


>---------------------------------------------------------------

02be4ff783f192268904d85131c5a748097fbbc9
 testsuite/tests/simplCore/should_compile/Makefile | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/testsuite/tests/simplCore/should_compile/Makefile b/testsuite/tests/simplCore/should_compile/Makefile
index 605d3a5..d615a5e 100644
--- a/testsuite/tests/simplCore/should_compile/Makefile
+++ b/testsuite/tests/simplCore/should_compile/Makefile
@@ -35,9 +35,12 @@ T4306:
 	'$(TEST_HC)' $(TEST_HC_OPTS) --show-iface T4306.hi | grep 'wupd ::'
 
 T4201:
-	$(RM) -f T4201.hi T4201.o
+	$(RM) -f T4201.hi T4201.o T4201.list
 	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4201.hs
-	'$(TEST_HC)' $(TEST_HC_OPTS) --show-iface T4201.hi | grep -B2 'Sym'
+	'$(TEST_HC)' $(TEST_HC_OPTS) --show-iface T4201.hi > T4201.list
+	# poor man idea about how to replace GNU grep -B2 "Sym" invocation with pure POSIX tools
+	for i in `grep -n "Sym" T4201.list |cut -d ':' -f -1`; do head -$$i T4201.list | tail -3 ; done
+	$(RM) -f T4201.list
 
 # This one looped as a result of bogus specialisation
 T4903:



More information about the ghc-commits mailing list