Skip to content
Snippets Groups Projects
Commit 1ccf547d authored by ian@well-typed.com's avatar ian@well-typed.com
Browse files

Move the tough2 test into a different directory

This stops its .hpc directory overlapping with that of the tough test,
which was causing test failures when running the testsuite in parallel.
parent ddcf0e9e
No related branches found
No related tags found
No related merge requests found
\begin{code}
import Control.Exception as E
-- This test shows what hpc can really do.
main = do
print ("Hello")
foo "Hello"
E.catch (print (badCase 22 44))
(\ e -> print (e :: E.ErrorCall))
E.catch (print (badCase 22 (error "Foo")))
(\ e -> print (e :: E.ErrorCall))
E.catch (print "Bark")
(\ e -> print (e :: E.ErrorCall))
(_,_) <- return $ ("Hello","World")
return ()
() <- return ()
t <- case () of
_ | otherwoz -> return "Hello"
_ -> error "Bad Thing Happened"
t <- case () of
_ | otherwise -> return "Hello"
_ -> error "Bad Thing Happened"
t <- case () of
_ | otherwise
, False -> error "Bad Thing Happened"
_ -> return "Hello"
print t
print foo2
foo x = do
print x
return ()
unused_ a = a
badCase :: Int -> Int -> Int
badCase a b =
if a > 100
then error "badCase"
else if a > 1000
then 1
else badCase (a + 1) (b - 1)
foo2 = (1,2, if True then 3 else 4)
otherwoz = True
\end{code}
......@@ -10,14 +10,3 @@ test('tough',
'hpc_index_exp.html', 'hpc_index_fun.html', 'tough.tix'])],
compile_and_run, ['-fhpc'])
# Test that -fhpc still works when (a) the source file is in a
# subdirectory and (b) it is a literate file. We had a bug in this
# area caused by the handling of line pragmas in the preprocessed
# source file.
test('subdir/tough2',
[ literate,
extra_clean(['Main.hs.html', 'hpc_index.html', 'hpc_index_alt.html',
'hpc_index_exp.html', 'hpc_index_fun.html', 'tough2.tix']),
cmd_prefix(hpc_prefix),
omit_ways(['ghci'] + prof_ways) ], # profile goes in the wrong place
compile_and_run, ['-fhpc'])
# 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
setTestOpts(compose(only_compiler_types(['ghc']),
compose(omit_ways(['ghci']),
skip_if_fast)))
hpc_prefix = "perl ../hpcrun.pl --clear --exeext=" + config.exeext + " --hpc='" + config.hpc + "'";
# Test that -fhpc still works when (a) the source file is in a
# subdirectory and (b) it is a literate file. We had a bug in this
# area caused by the handling of line pragmas in the preprocessed
# source file.
test('subdir/tough2',
[ literate,
extra_clean(['Main.hs.html', 'hpc_index.html', 'hpc_index_alt.html',
'hpc_index_exp.html', 'hpc_index_fun.html', 'tough2.tix']),
cmd_prefix(hpc_prefix),
omit_ways(['ghci'] + prof_ways) ], # profile goes in the wrong place
compile_and_run, ['-fhpc'])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment