diff options
author | Zejun Wu <watashi@fb.com> | 2018-12-11 13:18:03 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-12-11 13:18:15 -0500 |
commit | 0136906c9e69b02cd1ffe2704fa5d737d8c4cfaf (patch) | |
tree | fadb44152e6ef39ec28a0a95169b417b982ae2d8 /testsuite/tests/hp2ps | |
parent | 0ff5ecfbc543d80d1668fec460df90b98d563898 (diff) | |
download | haskell-0136906c9e69b02cd1ffe2704fa5d737d8c4cfaf.tar.gz |
Fix uninformative hp2ps error when the cmdline contains double quotes
Reapply D5346 with fix incompatible shell quoting in tests. It seems
like `$'string'` is not recognized under all test environments, so let's
avoid it in tests.
Test Plan:
```
hp2ps: "T15904".hp, line 2: integer must follow identifier
```
use new ghc and hp2ps to profile a simple program.
Reviewers: simonmar, bgamari, erikd, tdammers
Reviewed By: bgamari
Subscribers: tdammers, carter, rwbarton
GHC Trac Issues: #15904
Differential Revision: https://phabricator.haskell.org/D5388
Diffstat (limited to 'testsuite/tests/hp2ps')
-rw-r--r-- | testsuite/tests/hp2ps/Makefile | 9 | ||||
-rw-r--r-- | testsuite/tests/hp2ps/T15904.hs | 8 | ||||
-rw-r--r-- | testsuite/tests/hp2ps/T15904.stdout | 6 | ||||
-rw-r--r-- | testsuite/tests/hp2ps/all.T | 1 |
4 files changed, 24 insertions, 0 deletions
diff --git a/testsuite/tests/hp2ps/Makefile b/testsuite/tests/hp2ps/Makefile new file mode 100644 index 0000000000..ec7deb53c3 --- /dev/null +++ b/testsuite/tests/hp2ps/Makefile @@ -0,0 +1,9 @@ +TOP=../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk + +.PHONY: T15904 +T15904: + "$(TEST_HC)" $(TEST_HC_OPTS) -rtsopts -main-is "$@" "$@.hs" -o "\"$@\"" + "./\"$@\"" '{"e": 2.72, "pi": 3.14}' "\\" "" '"' +RTS -h + "$(HP2PS_ABS)" "\"$@\".hp" diff --git a/testsuite/tests/hp2ps/T15904.hs b/testsuite/tests/hp2ps/T15904.hs new file mode 100644 index 0000000000..7c009ffbee --- /dev/null +++ b/testsuite/tests/hp2ps/T15904.hs @@ -0,0 +1,8 @@ +module T15904 (main) where + +import System.Environment + +main :: IO () +main = do + args <- getArgs + mapM_ putStrLn args diff --git a/testsuite/tests/hp2ps/T15904.stdout b/testsuite/tests/hp2ps/T15904.stdout new file mode 100644 index 0000000000..e77005b2eb --- /dev/null +++ b/testsuite/tests/hp2ps/T15904.stdout @@ -0,0 +1,6 @@ +[1 of 1] Compiling T15904 ( T15904.hs, T15904.o ) +Linking "T15904" ... +{"e": 2.72, "pi": 3.14} +\ + +" diff --git a/testsuite/tests/hp2ps/all.T b/testsuite/tests/hp2ps/all.T new file mode 100644 index 0000000000..bebeb568e3 --- /dev/null +++ b/testsuite/tests/hp2ps/all.T @@ -0,0 +1 @@ +test('T15904', [], run_command, ['$MAKE -s --no-print-directory T15904']) |