[Git][ghc/ghc][master] Testsuite: don't use obsolescent egrep (#22351)

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Thu Apr 20 00:06:07 UTC 2023



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
ab6c1d29 by Sylvain Henry at 2023-04-19T20:05:50-04:00
Testsuite: don't use obsolescent egrep (#22351)

Recent egrep displays the following message, breaking golden tests:

  egrep: warning: egrep is obsolescent; using grep -E

Switch to using "grep -E" instead

- - - - -


4 changed files:

- docs/users_guide/hints.rst
- testsuite/tests/cabal/cabal01/Makefile
- testsuite/tests/haddock/perf/Makefile
- testsuite/tests/simplCore/should_compile/Makefile


Changes:

=====================================
docs/users_guide/hints.rst
=====================================
@@ -153,7 +153,7 @@ Use ``SPECIALIZE`` pragmas:
 
     .. code-block:: sh
 
-        $ ghc --show-iface Foo.hi | egrep '^[a-z].*::.*=>'
+        $ ghc --show-iface Foo.hi | grep -E '^[a-z].*::.*=>'
 
 Strict functions are your dear friends:
     And, among other things, lazy pattern-matching is your enemy.


=====================================
testsuite/tests/cabal/cabal01/Makefile
=====================================
@@ -5,7 +5,7 @@ include $(TOP)/mk/test.mk
 # Find all the env variables starting with CI_ to unset them.
 # Otherwise, we might run into environment length limitations on Windows.
 # (See `xargs --show-limits`.)
-VARS_TO_UNSET := $(shell env | grep ^CI_ | egrep -o '^[^=]+')
+VARS_TO_UNSET := $(shell env | grep ^CI_ | grep -E -o '^[^=]+')
 unexport $(VARS_TO_UNSET)
 
 clean:


=====================================
testsuite/tests/haddock/perf/Makefile
=====================================
@@ -4,12 +4,12 @@ include $(TOP)/mk/test.mk
 
 # We accept a 5% increase in parser allocations due to -haddock
 haddock_parser_perf :
-	WithHaddock=$(shell '$(TEST_HC)' $(TEST_HC_OPTS) -fno-code -fforce-recomp -Wno-all -ddump-timings -haddock -O0 Fold.hs 2>/dev/null | grep Parser | egrep -o 'alloc=[0-9]+' | cut -c7-  ) ; \
-	WithoutHaddock=$(shell '$(TEST_HC)' $(TEST_HC_OPTS) -fno-code -fforce-recomp -Wno-all -ddump-timings -O0 Fold.hs 2>/dev/null | grep Parser | egrep -o 'alloc=[0-9]+' | cut -c7-  ) ;  \
+	WithHaddock=$(shell '$(TEST_HC)' $(TEST_HC_OPTS) -fno-code -fforce-recomp -Wno-all -ddump-timings -haddock -O0 Fold.hs 2>/dev/null | grep Parser | grep -E -o 'alloc=[0-9]+' | cut -c7-  ) ; \
+	WithoutHaddock=$(shell '$(TEST_HC)' $(TEST_HC_OPTS) -fno-code -fforce-recomp -Wno-all -ddump-timings -O0 Fold.hs 2>/dev/null | grep Parser | grep -E -o 'alloc=[0-9]+' | cut -c7-  ) ;  \
 	  awk "BEGIN { ratio = ($$WithHaddock / $$WithoutHaddock); if (ratio > 1.05) {print \"-haddock allocation ratio too high:\", ratio; exit 1} else {exit 0} }"
 
 # Similarly for the renamer
 haddock_renamer_perf :
-	WithoutHaddock=$(shell '$(TEST_HC)' $(TEST_HC_OPTS) -fno-code -fforce-recomp -Wno-all -ddump-timings -O0 Fold.hs 2>/dev/null | grep Renamer | egrep -o 'alloc=[0-9]+' | cut -c7-  ) ; \
-	WithHaddock=$(shell '$(TEST_HC)' $(TEST_HC_OPTS) -fno-code -fforce-recomp -Wno-all -ddump-timings -haddock -O0 Fold.hs 2>/dev/null | grep Renamer | egrep -o 'alloc=[0-9]+' | cut -c7-  ) ;  \
+	WithoutHaddock=$(shell '$(TEST_HC)' $(TEST_HC_OPTS) -fno-code -fforce-recomp -Wno-all -ddump-timings -O0 Fold.hs 2>/dev/null | grep Renamer | grep -E -o 'alloc=[0-9]+' | cut -c7-  ) ; \
+	WithHaddock=$(shell '$(TEST_HC)' $(TEST_HC_OPTS) -fno-code -fforce-recomp -Wno-all -ddump-timings -haddock -O0 Fold.hs 2>/dev/null | grep Renamer | grep -E -o 'alloc=[0-9]+' | cut -c7-  ) ;  \
 	  awk "BEGIN { ratio = ($$WithHaddock / $$WithoutHaddock); if (ratio > 1.20) {print \"-haddock allocation ratio too high:\", ratio; exit 1} else {exit 0} }"


=====================================
testsuite/tests/simplCore/should_compile/Makefile
=====================================
@@ -61,7 +61,7 @@ T13367:
 
 T8832:
 	$(RM) -f T8832.o T8832.hi
-	'$(TEST_HC)' $(TEST_HC_OPTS) -O -c -ddump-simpl -dsuppress-ticks T8832.hs | egrep '^[a-zA-Z0-9]+ ='
+	'$(TEST_HC)' $(TEST_HC_OPTS) -O -c -ddump-simpl -dsuppress-ticks T8832.hs | grep -E '^[a-zA-Z0-9]+ ='
 
 T12603:
 	$(RM) -f T12603.o T12603.hi



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ab6c1d295cd9f492838dbd481ecc2a66bbd17393

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ab6c1d295cd9f492838dbd481ecc2a66bbd17393
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230419/73906c87/attachment-0001.html>


More information about the ghc-commits mailing list