summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2018-11-02 14:24:12 -0400
committerBen Gamari <ben@smart-cactus.org>2018-11-02 17:13:03 -0400
commit5f81952e230fef1f65ae473e09d44101c489c483 (patch)
tree67213bfee6bc8a8231745c835553187dae376de2 /testsuite
parent118fca7fe413c3cf986cd07b8694917fde190a3b (diff)
downloadhaskell-5f81952e230fef1f65ae473e09d44101c489c483.tar.gz
rts: Allow output filename of eventlog to be given by command-line
This introduces the `+RTS -ol` flag, which allows user to specify the destination file for eventlog output. Test Plan: Validate with included test Reviewers: simonmar, erikd Reviewed By: simonmar Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5293
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/rts/EventlogOutput.hs1
-rw-r--r--testsuite/tests/rts/Makefile12
-rw-r--r--testsuite/tests/rts/all.T12
3 files changed, 25 insertions, 0 deletions
diff --git a/testsuite/tests/rts/EventlogOutput.hs b/testsuite/tests/rts/EventlogOutput.hs
new file mode 100644
index 0000000000..b3549c2fe3
--- /dev/null
+++ b/testsuite/tests/rts/EventlogOutput.hs
@@ -0,0 +1 @@
+main = return ()
diff --git a/testsuite/tests/rts/Makefile b/testsuite/tests/rts/Makefile
index 496e04e825..08d2051891 100644
--- a/testsuite/tests/rts/Makefile
+++ b/testsuite/tests/rts/Makefile
@@ -200,3 +200,15 @@ KeepCafsFail:
.PHONY: KeepCafs
KeepCafs:
"${MAKE}" KeepCafsFail KEEPCAFS=-fkeep-cafs
+
+.PHONY: EventlogOutput1
+EventlogOutput1:
+ "$(TEST_HC)" -eventlog -v0 EventlogOutput.hs
+ ./EventlogOutput +RTS -l -olhello.eventlog
+ ls hello.eventlog >/dev/null
+
+.PHONY: EventlogOutput2
+EventlogOutput2:
+ "$(TEST_HC)" -eventlog -v0 EventlogOutput.hs
+ ./EventlogOutput +RTS -l
+ ls EventlogOutput.eventlog >/dev/null
diff --git a/testsuite/tests/rts/all.T b/testsuite/tests/rts/all.T
index 138e6f0ba2..8d2f37baa7 100644
--- a/testsuite/tests/rts/all.T
+++ b/testsuite/tests/rts/all.T
@@ -143,6 +143,18 @@ test('traceBinaryEvent', [ omit_ways(['dyn', 'ghci'] + prof_ways),
extra_run_opts('+RTS -ls -RTS') ],
compile_and_run, ['-eventlog'])
+# Test that -ol flag works as expected
+test('EventlogOutput1',
+ [ extra_files(["EventlogOutput.hs"]),
+ omit_ways(['dyn', 'ghci'] + prof_ways) ],
+ run_command, ['$MAKE -s --no-print-directory EventlogOutput1'])
+
+# Test that -ol flag defaults to <program>.eventlog
+test('EventlogOutput2',
+ [ extra_files(["EventlogOutput.hs"]),
+ omit_ways(['dyn', 'ghci'] + prof_ways) ],
+ run_command, ['$MAKE -s --no-print-directory EventlogOutput2'])
+
test('T4059', [], run_command, ['$MAKE -s --no-print-directory T4059'])
# Test for #4274