Fix some hpc tests
authorIan Lynagh <igloo@earth.li>
Sat, 19 Dec 2009 19:28:08 +0000 (19:28 +0000)
committerIan Lynagh <igloo@earth.li>
Sat, 19 Dec 2009 19:28:08 +0000 (19:28 +0000)
35 files changed:
tests/simple/test.T
tests/simple/tixs.tar [deleted file]
tests/simple/tixs/.hpc/Main.mix [new file with mode: 0644]
tests/simple/tixs/Makefile [new file with mode: 0644]
tests/simple/tixs/hand_overlay.ovr [moved from tests/simple/hand_overlay.ovr with 100% similarity]
tests/simple/tixs/hpc001.hs [new file with mode: 0644]
tests/simple/tixs/hpc_bad_001.stdout [moved from tests/simple/hpc_bad_001.stdout with 100% similarity]
tests/simple/tixs/hpc_draft.stdout [moved from tests/simple/hpc_draft.stdout with 100% similarity]
tests/simple/tixs/hpc_hand_overlay.stdout [moved from tests/simple/hpc_hand_overlay.stdout with 100% similarity]
tests/simple/tixs/hpc_help.stdout [moved from tests/simple/hpc_help.stdout with 100% similarity]
tests/simple/tixs/hpc_help_draft.stdout [moved from tests/simple/hpc_help_draft.stdout with 100% similarity]
tests/simple/tixs/hpc_help_help.stdout [moved from tests/simple/hpc_help_help.stdout with 100% similarity]
tests/simple/tixs/hpc_help_markup.stdout [moved from tests/simple/hpc_help_markup.stdout with 100% similarity]
tests/simple/tixs/hpc_help_overlay.stdout [moved from tests/simple/hpc_help_overlay.stdout with 100% similarity]
tests/simple/tixs/hpc_help_report.stdout [moved from tests/simple/hpc_help_report.stdout with 100% similarity]
tests/simple/tixs/hpc_help_show.stdout [moved from tests/simple/hpc_help_show.stdout with 100% similarity]
tests/simple/tixs/hpc_help_version.stdout [moved from tests/simple/hpc_help_version.stdout with 100% similarity]
tests/simple/tixs/hpc_markup_001.stdout [moved from tests/simple/hpc_markup_001.stdout with 100% similarity]
tests/simple/tixs/hpc_markup_002.stdout [moved from tests/simple/hpc_markup_002.stdout with 100% similarity]
tests/simple/tixs/hpc_markup_error_001.stdout [moved from tests/simple/hpc_markup_error_001.stdout with 100% similarity]
tests/simple/tixs/hpc_markup_error_002.stdout [moved from tests/simple/hpc_markup_error_002.stdout with 100% similarity]
tests/simple/tixs/hpc_overlay.stdout [moved from tests/simple/hpc_overlay.stdout with 100% similarity]
tests/simple/tixs/hpc_overlay2.stdout [moved from tests/simple/hpc_overlay2.stdout with 100% similarity]
tests/simple/tixs/hpc_report_001.stdout [moved from tests/simple/hpc_report_001.stdout with 100% similarity]
tests/simple/tixs/hpc_report_002.stdout [moved from tests/simple/hpc_report_002.stdout with 100% similarity]
tests/simple/tixs/hpc_report_003.stdout [moved from tests/simple/hpc_report_003.stdout with 100% similarity]
tests/simple/tixs/hpc_report_error_001.stdout [moved from tests/simple/hpc_report_error_001.stdout with 100% similarity]
tests/simple/tixs/hpc_report_error_002.stdout [moved from tests/simple/hpc_report_error_002.stdout with 100% similarity]
tests/simple/tixs/hpc_sample.tix [new file with mode: 0644]
tests/simple/tixs/hpc_show.stdout [moved from tests/simple/hpc_show.stdout with 100% similarity]
tests/simple/tixs/hpc_show_error_001.stdout [moved from tests/simple/hpc_show_error_001.stdout with 100% similarity]
tests/simple/tixs/hpc_show_error_002.stdout [moved from tests/simple/hpc_show_error_002.stdout with 100% similarity]
tests/simple/tixs/hpc_version.stdout [moved from tests/simple/hpc_version.stdout with 100% similarity]
tests/simple/tixs/sample_overlay.ovr [moved from tests/simple/sample_overlay.ovr with 100% similarity]
tests/simple/tixs/test.T [new file with mode: 0644]

index 48d2530..e15eb72 100644 (file)
@@ -6,63 +6,3 @@ hpc_prefix = 'perl ../hpcrun.pl --clear --exeext=' + config.exeext + ' --hpc=' +
 
 test('hpc001', cmd_prefix(hpc_prefix), compile_and_run, ['-fhpc'])
 
-# a prepackaged version of .hpc/*mix and hpc-sample.tix files.
-# This is created using 'make build-tix-tar', in this directory.
-
-runCmd("cd " + in_testdir('') + " && tar xf tixs.tar")
-
-hpcsample = 'hpc_sample'
-
-test('hpc_help', normal, run_command, [config.hpc + ' help'])
-test('hpc_help_help', normal, run_command, [config.hpc + ' help help'])
-
-test('hpc_help_report', normal, run_command, [config.hpc + ' help report'])
-test('hpc_report_001', normal, run_command, \
-       [config.hpc + ' report ' + hpcsample + '.tix --xml-output']) 
-test('hpc_report_002', normal, run_command, \
-       [config.hpc + ' report ' + hpcsample + '.tix --xml-output --per-module']) 
-test('hpc_report_003', normal, run_command, \
-       [config.hpc + ' report ' + hpcsample + '.tix --per-module --decl-list']) 
-test('hpc_report_error_001', exit_code(1), run_command, [config.hpc + ' report']) # no .tix file
-test('hpc_report_error_002', exit_code(1), run_command, [config.hpc + ' report hpc001.hs']) # bad .tix file
-
-test('hpc_help_markup', normal, run_command, [config.hpc + ' help markup'])
-test('hpc_markup_error_001', exit_code(1), run_command, [config.hpc + ' markup']) # no .tix file
-test('hpc_markup_error_002', exit_code(1), run_command, [config.hpc + ' markup hpc001.hs']) # bad .tix file
-test('hpc_markup_001', normal, run_command, \
-       ['(' + config.hpc + ' markup ' + hpcsample + '.tix --highlight-covered ; cat Main.hs.html )']) 
-test('hpc_markup_002', normal, run_command, \
-       ['(' + config.hpc + ' markup ' + hpcsample + '.tix --fun-entry-count ; cat Main.hs.html )']) 
-
-test('hpc_help_show', normal, run_command, [config.hpc + ' help show'])
-test('hpc_show', normal, run_command, [config.hpc + ' show ' + hpcsample + '.tix'])
-test('hpc_show_error_001', exit_code(1), run_command, [config.hpc + ' show']) # no .tix file
-test('hpc_show_error_002', exit_code(1), run_command, [config.hpc + ' show hpc001.hs']) # bad .tix file
-
-test('hpc_help_version', normal, run_command, [config.hpc + ' help version'])
-test('hpc_version', normal, run_command, [config.hpc + ' version'])
-
-test('hpc_help_draft', normal, run_command, [config.hpc + ' help draft'])
-test('hpc_draft', normal, run_command, [config.hpc + ' draft ' + hpcsample + '.tix'])
-
-test('hpc_help_overlay', normal, run_command, [config.hpc + ' help overlay'])
-test('hpc_overlay', normal, run_command, 
-                       [     config.hpc + ' overlay sample_overlay.ovr > sample_overlay.tix' +
-                       ';  cat sample_overlay.tix ' +
-                       ';' + config.hpc + ' combine ' + hpcsample + '.tix sample_overlay.tix > total.tix' + 
-                       ';' + config.hpc + ' report total.tix' +
-                       '']);
-test('hpc_overlay2', normal, run_command, 
-                       [     config.hpc + ' overlay sample_overlay.ovr --output=sample_overlay.tix' +
-                       ';  cat sample_overlay.tix ' +
-                       ';' + config.hpc + ' combine ' + hpcsample + '.tix sample_overlay.tix --output=total.tix' + 
-                       ';' + config.hpc + ' report total.tix' +
-                       '']);
-test('hpc_hand_overlay', normal, run_command, 
-                       [     config.hpc + ' overlay hand_overlay.ovr --output=sample_overlay.tix' +
-                       ';  cat sample_overlay.tix ' +
-                       ';' + config.hpc + ' combine ' + hpcsample + '.tix sample_overlay.tix --output=total.tix' + 
-                       ';' + config.hpc + ' report total.tix' +
-                       '']);
-
-test('hpc_bad_001', exit_code(1), run_command, [config.hpc + ' bad arguments'])
diff --git a/tests/simple/tixs.tar b/tests/simple/tixs.tar
deleted file mode 100644 (file)
index 557ed9c..0000000
Binary files a/tests/simple/tixs.tar and /dev/null differ
diff --git a/tests/simple/tixs/.hpc/Main.mix b/tests/simple/tixs/.hpc/Main.mix
new file mode 100644 (file)
index 0000000..dbbc0b8
--- /dev/null
@@ -0,0 +1 @@
+Mix "hpc001.hs" 1188355554 601114699 1 [(1:21-1:27,ExpBox False),(1:29-1:35,ExpBox False),(1:14-1:36,ExpBox False),(1:8-1:36,ExpBox False),(1:1-1:36,TopLevelBox ["main"])]
\ No newline at end of file
diff --git a/tests/simple/tixs/Makefile b/tests/simple/tixs/Makefile
new file mode 100644 (file)
index 0000000..60332c9
--- /dev/null
@@ -0,0 +1,14 @@
+# This Makefile runs the tests using GHC's testsuite framework.  It
+# assumes the package is part of a GHC build tree with the testsuite
+# installed in ../../../testsuite.
+
+TOP=../../../../../testsuite
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
+
+build-tix:
+       rm -Rf .hpc hpc001.o a.out
+       '$(TEST_HC)' -fhpc hpc001.hs
+       ./a.out
+       mv a.out.tix hpc_sample.tix
+
diff --git a/tests/simple/tixs/hpc001.hs b/tests/simple/tixs/hpc001.hs
new file mode 100644 (file)
index 0000000..53421b8
--- /dev/null
@@ -0,0 +1 @@
+main = print (const "Hello" "World")
diff --git a/tests/simple/tixs/hpc_sample.tix b/tests/simple/tixs/hpc_sample.tix
new file mode 100644 (file)
index 0000000..5bd535a
--- /dev/null
@@ -0,0 +1 @@
+Tix [ TixModule "Main" 601114699 5 [1,0,1,1,1]]
diff --git a/tests/simple/tixs/test.T b/tests/simple/tixs/test.T
new file mode 100644 (file)
index 0000000..84e8f7f
--- /dev/null
@@ -0,0 +1,59 @@
+setTestOpts(compose(only_compiler_types(['ghc']),
+                   compose(omit_ways(['ghci']),
+                           skip_if_fast)))
+
+hpcsample = 'hpc_sample'
+
+test('hpc_help', normal, run_command, [config.hpc + ' help'])
+test('hpc_help_help', normal, run_command, [config.hpc + ' help help'])
+
+test('hpc_help_report', normal, run_command, [config.hpc + ' help report'])
+test('hpc_report_001', normal, run_command, \
+       [config.hpc + ' report ' + hpcsample + '.tix --xml-output'])
+test('hpc_report_002', normal, run_command, \
+       [config.hpc + ' report ' + hpcsample + '.tix --xml-output --per-module'])
+test('hpc_report_003', normal, run_command, \
+       [config.hpc + ' report ' + hpcsample + '.tix --per-module --decl-list'])
+test('hpc_report_error_001', exit_code(1), run_command, [config.hpc + ' report']) # no .tix file
+test('hpc_report_error_002', exit_code(1), run_command, [config.hpc + ' report hpc001.hs']) # bad .tix file
+
+test('hpc_help_markup', normal, run_command, [config.hpc + ' help markup'])
+test('hpc_markup_error_001', exit_code(1), run_command, [config.hpc + ' markup']) # no .tix file
+test('hpc_markup_error_002', exit_code(1), run_command, [config.hpc + ' markup hpc001.hs']) # bad .tix file
+test('hpc_markup_001', normal, run_command, \
+       ['(' + config.hpc + ' markup ' + hpcsample + '.tix --highlight-covered ; cat Main.hs.html )'])
+test('hpc_markup_002', normal, run_command, \
+       ['(' + config.hpc + ' markup ' + hpcsample + '.tix --fun-entry-count ; cat Main.hs.html )'])
+
+test('hpc_help_show', normal, run_command, [config.hpc + ' help show'])
+test('hpc_show', normal, run_command, [config.hpc + ' show ' + hpcsample + '.tix'])
+test('hpc_show_error_001', exit_code(1), run_command, [config.hpc + ' show']) # no .tix file
+test('hpc_show_error_002', exit_code(1), run_command, [config.hpc + ' show hpc001.hs']) # bad .tix file
+
+test('hpc_help_version', normal, run_command, [config.hpc + ' help version'])
+test('hpc_version', normal, run_command, [config.hpc + ' version'])
+
+test('hpc_help_draft', normal, run_command, [config.hpc + ' help draft'])
+test('hpc_draft', normal, run_command, [config.hpc + ' draft ' + hpcsample + '.tix'])
+
+test('hpc_help_overlay', normal, run_command, [config.hpc + ' help overlay'])
+test('hpc_overlay', normal, run_command,
+                       [     config.hpc + ' overlay sample_overlay.ovr > sample_overlay.tix' +
+                       ';  cat sample_overlay.tix ' +
+                       ';' + config.hpc + ' combine ' + hpcsample + '.tix sample_overlay.tix > total.tix' +
+                       ';' + config.hpc + ' report total.tix' +
+                       '']);
+test('hpc_overlay2', normal, run_command,
+                       [     config.hpc + ' overlay sample_overlay.ovr --output=sample_overlay.tix' +
+                       ';  cat sample_overlay.tix ' +
+                       ';' + config.hpc + ' combine ' + hpcsample + '.tix sample_overlay.tix --output=total.tix' +
+                       ';' + config.hpc + ' report total.tix' +
+                       '']);
+test('hpc_hand_overlay', normal, run_command,
+                       [     config.hpc + ' overlay hand_overlay.ovr --output=sample_overlay.tix' +
+                       ';  cat sample_overlay.tix ' +
+                       ';' + config.hpc + ' combine ' + hpcsample + '.tix sample_overlay.tix --output=total.tix' +
+                       ';' + config.hpc + ' report total.tix' +
+                       '']);
+
+test('hpc_bad_001', exit_code(1), run_command, [config.hpc + ' bad arguments'])