From c58e20621a0edcb328b2c629a00dc87fa723c9e9 Mon Sep 17 00:00:00 2001 From: Ian Lynagh <ian@well-typed.com> Date: Tue, 22 Jan 2013 19:40:00 +0000 Subject: [PATCH] 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. --- tests/function/subdir/tough.lhs | 49 ------------------- tests/function/test.T | 11 ----- tests/function2/Makefile | 8 +++ .../{function => function2}/subdir/tough2.lhs | 0 .../subdir/tough2.stdout | 0 tests/function2/test.T | 17 +++++++ 6 files changed, 25 insertions(+), 60 deletions(-) delete mode 100644 tests/function/subdir/tough.lhs create mode 100644 tests/function2/Makefile rename tests/{function => function2}/subdir/tough2.lhs (100%) rename tests/{function => function2}/subdir/tough2.stdout (100%) create mode 100644 tests/function2/test.T diff --git a/tests/function/subdir/tough.lhs b/tests/function/subdir/tough.lhs deleted file mode 100644 index 248bfe9..0000000 --- a/tests/function/subdir/tough.lhs +++ /dev/null @@ -1,49 +0,0 @@ -\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} diff --git a/tests/function/test.T b/tests/function/test.T index cc1b785..d1e11cb 100644 --- a/tests/function/test.T +++ b/tests/function/test.T @@ -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']) diff --git a/tests/function2/Makefile b/tests/function2/Makefile new file mode 100644 index 0000000..12924c2 --- /dev/null +++ b/tests/function2/Makefile @@ -0,0 +1,8 @@ +# 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 + diff --git a/tests/function/subdir/tough2.lhs b/tests/function2/subdir/tough2.lhs similarity index 100% rename from tests/function/subdir/tough2.lhs rename to tests/function2/subdir/tough2.lhs diff --git a/tests/function/subdir/tough2.stdout b/tests/function2/subdir/tough2.stdout similarity index 100% rename from tests/function/subdir/tough2.stdout rename to tests/function2/subdir/tough2.stdout diff --git a/tests/function2/test.T b/tests/function2/test.T new file mode 100644 index 0000000..04f39b6 --- /dev/null +++ b/tests/function2/test.T @@ -0,0 +1,17 @@ +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']) -- GitLab