summaryrefslogtreecommitdiff
path: root/testsuite/tests/driver
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-04-03 13:35:09 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-08-02 04:10:18 -0400
commit266a74528a2550a03d66f3d726d65b47df612446 (patch)
tree5029cd07164f21fdfcf10a84a51a8f3b7a281af8 /testsuite/tests/driver
parent54d6b20192fe6fc244248c7766533a768c591bae (diff)
downloadhaskell-266a74528a2550a03d66f3d726d65b47df612446.tar.gz
ghc: Introduce --run mode
As described in #18011, this mode provides similar functionality to the `runhaskell` command, but doesn't require that the user know the path of yet another executable, simplifying interactions with upstream tools.
Diffstat (limited to 'testsuite/tests/driver')
-rw-r--r--testsuite/tests/driver/RunMode.hs4
-rw-r--r--testsuite/tests/driver/RunMode.stdout1
-rw-r--r--testsuite/tests/driver/RunMode/Test.hs7
-rw-r--r--testsuite/tests/driver/all.T1
4 files changed, 13 insertions, 0 deletions
diff --git a/testsuite/tests/driver/RunMode.hs b/testsuite/tests/driver/RunMode.hs
new file mode 100644
index 0000000000..bad01fef39
--- /dev/null
+++ b/testsuite/tests/driver/RunMode.hs
@@ -0,0 +1,4 @@
+import Test
+
+main :: IO ()
+main = test
diff --git a/testsuite/tests/driver/RunMode.stdout b/testsuite/tests/driver/RunMode.stdout
new file mode 100644
index 0000000000..4b7e5d76b5
--- /dev/null
+++ b/testsuite/tests/driver/RunMode.stdout
@@ -0,0 +1 @@
+["hello"]
diff --git a/testsuite/tests/driver/RunMode/Test.hs b/testsuite/tests/driver/RunMode/Test.hs
new file mode 100644
index 0000000000..125535e437
--- /dev/null
+++ b/testsuite/tests/driver/RunMode/Test.hs
@@ -0,0 +1,7 @@
+module Test (test) where
+
+import System.Environment
+
+test :: IO ()
+test = do
+ print =<< getArgs
diff --git a/testsuite/tests/driver/all.T b/testsuite/tests/driver/all.T
index 6f45e1ec21..0e6eb594b1 100644
--- a/testsuite/tests/driver/all.T
+++ b/testsuite/tests/driver/all.T
@@ -293,3 +293,4 @@ test('FullGHCVersion', normal, compile_and_run, ['-package ghc-boot'])
test('OneShotTH', normal, makefile_test, [])
test('T17481', normal, makefile_test, [])
test('T20084', normal, makefile_test, [])
+test('RunMode', extra_files(['RunMode/Test.hs']), run_command, ['{compiler} --run -iRunMode/ -ignore-dot-ghci RunMode.hs -- hello'])