Commit b28546ca authored by rwbarton's avatar rwbarton

tests: automatically move extra_files

parent 5caceac7
......@@ -2,6 +2,7 @@ setTestOpts([omit_ways(['ghci','threaded2']), when(fast(), skip)])
hpc_prefix = "perl hpcrun.pl --clear --exeext={exeext} --hpc={hpc}"
test('hpc_fork', [ when(opsys('mingw32'), skip), # no forkProcess on Windows
test('hpc_fork', [extra_files(['../hpcrun.pl']),
when(opsys('mingw32'), skip), # no forkProcess on Windows
cmd_prefix(hpc_prefix) ], compile_and_run, ['-fhpc'])
......@@ -3,6 +3,7 @@ setTestOpts([omit_ways(['ghci']), when(fast(), skip)])
hpc_prefix = "perl hpcrun.pl --clear --exeext={exeext} --hpc={hpc}"
test('tough',
[cmd_prefix(hpc_prefix)],
[extra_files(['../hpcrun.pl']),
cmd_prefix(hpc_prefix)],
compile_and_run, ['-fhpc'])
......@@ -7,7 +7,8 @@ hpc_prefix = "perl hpcrun.pl --clear --exeext={exeext} --hpc={hpc}"
# area caused by the handling of line pragmas in the preprocessed
# source file.
test('tough2',
[ literate,
[extra_files(['../hpcrun.pl', 'subdir/']),
literate,
cmd_prefix(hpc_prefix),
omit_ways(['ghci'] + prof_ways) ], # profile goes in the wrong place
multimod_compile_and_run, ['subdir/tough2.lhs', '-fhpc'])
test('hpc_ghc_ghci',
[only_ways(['normal']), when(compiler_profiled(), skip), req_interp],
[extra_files(['A.hs', 'B.hs']),
only_ways(['normal']), when(compiler_profiled(), skip), req_interp],
run_command, ['$MAKE -s --no-print-directory hpc_ghc_ghci'])
......@@ -11,6 +11,7 @@ hpc_prefix = "perl hpcrun.pl --clear --exeext={exeext} --hpc={hpc}"
# Also note that testsuite/tests/programs/galois_raytrace has a similar (but
# not the same) copy of this program.
test('hpc_raytrace',
[cmd_prefix(hpc_prefix), reqlib('parsec'), ignore_stdout],
[extra_files(['../hpcrun.pl', 'CSG.hs', 'Construct.hs', 'Data.hs', 'Eval.hs', 'Geometry.hs', 'Illumination.hs', 'Intersections.hs', 'Interval.hs', 'Main.hs', 'Misc.hs', 'Parse.hs', 'Primitives.hs', 'Surface.hs', 'galois.gml', 'galois.sample']),
cmd_prefix(hpc_prefix), reqlib('parsec'), ignore_stdout],
multimod_compile_and_run, ['Main','-fhpc -package parsec'])
setTestOpts([omit_ways(['ghci']), when(fast(), skip)])
test('hpc_report_multi_001', normal, run_command,
test('hpc_report_multi_001', extra_files(['.hpc/', 'hpc_sample.tix']), run_command,
["{hpc} report hpc_sample --include=Geometry --per-module"])
test('hpc_report_multi_002', normal, run_command,
test('hpc_report_multi_002', extra_files(['.hpc/', 'hpc_sample.tix']), run_command,
["{hpc} report hpc_sample --exclude=Geometry --per-module"])
test('hpc_report_multi_003', normal, run_command,
test('hpc_report_multi_003', extra_files(['.hpc/', 'hpc_sample.tix']), run_command,
["{hpc} report hpc_sample --include=Geometry --per-module --decl-list"])
test('hpc_markup_multi_001', normal, run_command,
test('hpc_markup_multi_001', extra_files(['../Geometry.hs', '.hpc/', 'hpc_sample.tix']), run_command,
["{hpc} markup --hpcdir=tixs/.hpc --hpcdir=hpc_markup_multi_001/.hpc --destdir=markup_multi_001"
" hpc_sample --include=Geometry"])
test('hpc_markup_multi_002', normal, run_command,
test('hpc_markup_multi_002', extra_files(['../CSG.hs', '../Construct.hs', '../Data.hs', '../Eval.hs', '../Geometry.hs', '../Illumination.hs', '../Intersections.hs', '../Interval.hs', '../Main.hs', '../Misc.hs', '../Parse.hs', '../Pixmap.hs', '../Primitives.hs', '../RayTrace.hs', '../Surface.hs', '.hpc/', 'hpc_sample.tix']), run_command,
["{hpc} markup --hpcdir=tixs/.hpc --hpcdir=hpc_markup_multi_002/.hpc --destdir=markup_multi_002"
" hpc_sample --exclude=Geometry"])
test('hpc_markup_multi_003', normal, run_command,
test('hpc_markup_multi_003', extra_files(['../CSG.hs', '../Construct.hs', '../Data.hs', '../Eval.hs', '../Geometry.hs', '../Illumination.hs', '../Intersections.hs', '../Interval.hs', '../Main.hs', '../Misc.hs', '../Parse.hs', '../Pixmap.hs', '../Primitives.hs', '../RayTrace.hs', '../Surface.hs', '.hpc/', 'hpc_sample.tix']), run_command,
["{hpc} markup --hpcdir=tixs/.hpc --hpcdir=hpc_markup_multi_003/.hpc --destdir=markup_multi_003"
" hpc_sample --fun-entry-count"])
test('hpc_show_multi_001', normal, run_command,
test('hpc_show_multi_001', extra_files(['.hpc/', 'hpc_sample.tix']), run_command,
["{hpc} show hpc_sample"])
test('hpc_show_multi_002', normal, run_command,
test('hpc_show_multi_002', extra_files(['.hpc/', 'hpc_sample.tix']), run_command,
["{hpc} show hpc_sample --include=Geometry"])
......@@ -4,11 +4,11 @@ test('hpc_help', normal, run_command, ["{hpc} help"])
test('hpc_help_help', normal, run_command, ["{hpc} help help"])
test('hpc_help_report', normal, run_command, ["{hpc} help report"])
test('hpc_report_001', normal, run_command,
test('hpc_report_001', extra_files(['.hpc/', 'hpc_sample.tix']), run_command,
["{hpc} report hpc_sample.tix --xml-output"])
test('hpc_report_002', normal, run_command,
test('hpc_report_002', extra_files(['.hpc/', 'hpc_sample.tix']), run_command,
["{hpc} report hpc_sample.tix --xml-output --per-module"])
test('hpc_report_003', normal, run_command,
test('hpc_report_003', extra_files(['.hpc/', 'hpc_sample.tix']), run_command,
["{hpc} report hpc_sample.tix --per-module --decl-list"])
test('hpc_report_error_001', exit_code(1), run_command,
["{hpc} report"]) # no .tix file
......@@ -20,15 +20,15 @@ test('hpc_markup_error_001', exit_code(1), run_command,
["{hpc} markup"]) # no .tix file
test('hpc_markup_error_002', exit_code(1), run_command,
["{hpc} markup hpc001.hs"]) # bad .tix file
test('hpc_markup_001', normal, run_command,
test('hpc_markup_001', extra_files(['.hpc/', 'hpc001.hs', 'hpc_sample.tix']), run_command,
["{hpc} markup --verbosity=0 --destdir=markup_001"
" hpc_sample.tix --highlight-covered; cat markup_001/Main.hs.html"])
test('hpc_markup_002', normal, run_command,
test('hpc_markup_002', extra_files(['.hpc/', 'hpc001.hs', 'hpc_sample.tix']), run_command,
["{hpc} markup --verbosity=0 --destdir=markup_002"
" hpc_sample.tix --fun-entry-count; cat markup_002/Main.hs.html"])
test('hpc_help_show', normal, run_command, ["{hpc} help show"])
test('hpc_show', normal, run_command, ["{hpc} show hpc_sample.tix"])
test('hpc_show', extra_files(['.hpc', 'hpc_sample.tix']), run_command, ["{hpc} show hpc_sample.tix"])
test('hpc_show_error_001', exit_code(1), run_command,
["{hpc} show"]) # no .tix file
test('hpc_show_error_002', exit_code(1), run_command,
......@@ -38,12 +38,12 @@ test('hpc_help_version', normal, run_command, ["{hpc} help version"])
test('hpc_version', normal, run_command, ["{hpc} version"])
test('hpc_help_draft', normal, run_command, ["{hpc} help draft"])
test('hpc_draft', normal, run_command, ["{hpc} draft hpc_sample.tix"])
test('hpc_draft', extra_files(['.hpc/', 'hpc001.hs', 'hpc_sample.tix']), run_command, ["{hpc} draft hpc_sample.tix"])
test('hpc_help_overlay', normal, run_command, ["{hpc} help overlay"])
test('hpc_overlay',
normal,
extra_files(['.hpc/', 'hpc001.hs', 'hpc_sample.tix', 'sample_overlay.ovr']),
run_command,
["({hpc} overlay sample_overlay.ovr > sample_overlay1.tix; "
"cat sample_overlay1.tix; echo; "
......@@ -51,7 +51,7 @@ test('hpc_overlay',
"{hpc} report total1.tix)"])
test('hpc_overlay2',
normal,
extra_files(['.hpc/', 'hpc001.hs', 'hpc_sample.tix', 'sample_overlay.ovr']),
run_command,
["({hpc} overlay sample_overlay.ovr --output=sample_overlay2.tix; "
"cat sample_overlay2.tix; echo; "
......@@ -59,7 +59,7 @@ test('hpc_overlay2',
"{hpc} report total2.tix)"])
test('hpc_hand_overlay',
normal,
extra_files(['.hpc/', 'hand_overlay.ovr', 'hpc001.hs', 'hpc_sample.tix']),
run_command,
["({hpc} overlay hand_overlay.ovr --output=sample_overlay3.tix; "
"cat sample_overlay3.tix; echo; "
......@@ -68,7 +68,8 @@ test('hpc_hand_overlay',
test('hpc_bad_001', exit_code(1), run_command, ["{hpc} bad arguments"])
test('T9619', ignore_stdout, run_command,
test('T9619', [extra_files(['.hpc', '.hpc.copy', 'hpc_sample.tix']),
ignore_stdout], run_command,
# Having the same mix file in two different hpcdirs should work.
["{hpc} report hpc_sample.tix --hpcdir=.hpc --hpcdir=.hpc.copy"])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment