[commit: testsuite] master: Always run cgrun068 (fa85978)
Johan Tibell
johan.tibell at gmail.com
Mon May 30 22:30:32 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/testsuite
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/fa85978a50435b596c10f2a5a79fb2d54ca105b3
>---------------------------------------------------------------
commit fa85978a50435b596c10f2a5a79fb2d54ca105b3
Author: Johan Tibell <johan.tibell at gmail.com>
Date: Thu May 19 17:33:49 2011 +0200
Always run cgrun068
>---------------------------------------------------------------
tests/ghc-regress/codeGen/should_run/all.T | 1 +
tests/ghc-regress/codeGen/should_run/cgrun068.hs | 27 +++++++++++++--------
2 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/tests/ghc-regress/codeGen/should_run/all.T b/tests/ghc-regress/codeGen/should_run/all.T
index 3c49510..84a196d 100644
--- a/tests/ghc-regress/codeGen/should_run/all.T
+++ b/tests/ghc-regress/codeGen/should_run/all.T
@@ -79,6 +79,7 @@ test('cgrun065', normal, compile_and_run, [''])
test('cgrun066', normal, compile_and_run, [''])
test('cgrun067', extra_clean(['Cgrun067A.hi', 'Cgrun067A.o']),
compile_and_run, [''])
+test('cgrun068', normal, compile_and_run, [''])
test('1861', extra_run_opts('0'), compile_and_run, [''])
diff --git a/tests/ghc-regress/codeGen/should_run/cgrun068.hs b/tests/ghc-regress/codeGen/should_run/cgrun068.hs
index c78edb3..f5096ad 100644
--- a/tests/ghc-regress/codeGen/should_run/cgrun068.hs
+++ b/tests/ghc-regress/codeGen/should_run/cgrun068.hs
@@ -3,6 +3,10 @@
-- !!! stress tests of copying/cloning primitive arrays
+-- Note: You can run this test manually with an argument
+-- (i.e. ./cgrun068 10000) if you want to run the stress test for
+-- longer.
+
{-
Test strategy
=============
@@ -32,12 +36,19 @@ import GHC.Exts
import GHC.ST hiding (liftST)
import Prelude hiding (length, read)
import qualified Prelude as P
+import qualified Prelude as P
+import System.Environment
import System.Random
main :: IO ()
main = do
- putStr (test_copyMutableArray ++ "\n" ++
- test_cloneMutableArray ++ "\n"
+ args <- getArgs
+ -- Number of copies to perform
+ let numMods = case args of
+ [] -> 100
+ [n] -> P.read n :: Int
+ putStr (test_copyMutableArray numMods ++ "\n" ++
+ test_cloneMutableArray numMods ++ "\n"
)
-- Number of arrays
@@ -48,10 +59,6 @@ numArrays = 100
maxLen :: Int
maxLen = 1024
--- Number of copies to perform
-numMods :: Int
-numMods = 10000
-
-- Create an array of arrays, with each sub-array having random length
-- and content.
setup :: Rng s (MArray s (MArray s Int))
@@ -120,8 +127,8 @@ clone marr f = do
-- Copy a slice of the source array into a destination array and check
-- that the copy succeeded.
-test_copyMutableArray :: String
-test_copyMutableArray = runST $ run $ do
+test_copyMutableArray :: Int -> String
+test_copyMutableArray numMods = runST $ run $ do
marr <- local setup
marrRef <- setup
let go i
@@ -165,8 +172,8 @@ unlinesShow = concatMap (\ x -> show x ++ "\n")
-- Copy a slice of the source array into a destination array and check
-- that the copy succeeded.
-test_cloneMutableArray :: String
-test_cloneMutableArray = runST $ run $ do
+test_cloneMutableArray :: Int -> String
+test_cloneMutableArray numMods = runST $ run $ do
marr <- local setup
marrRef <- setup
let go i
More information about the Cvs-ghc
mailing list