summaryrefslogtreecommitdiff
path: root/packages/tests/src/Numeric
diff options
context:
space:
mode:
Diffstat (limited to 'packages/tests/src/Numeric')
-rw-r--r--packages/tests/src/Numeric/LinearAlgebra/Tests.hs13
1 files changed, 10 insertions, 3 deletions
diff --git a/packages/tests/src/Numeric/LinearAlgebra/Tests.hs b/packages/tests/src/Numeric/LinearAlgebra/Tests.hs
index 69ef1b3..8d402d0 100644
--- a/packages/tests/src/Numeric/LinearAlgebra/Tests.hs
+++ b/packages/tests/src/Numeric/LinearAlgebra/Tests.hs
@@ -36,16 +36,22 @@ import Numeric.GSL
36import Prelude hiding ((^)) 36import Prelude hiding ((^))
37import qualified Prelude 37import qualified Prelude
38import System.CPUTime 38import System.CPUTime
39import System.Exit
39import Text.Printf 40import Text.Printf
40import Data.Packed.Development(unsafeFromForeignPtr,unsafeToForeignPtr) 41import Data.Packed.Development(unsafeFromForeignPtr,unsafeToForeignPtr)
41import Control.Arrow((***)) 42import Control.Arrow((***))
42import Debug.Trace 43import Debug.Trace
44import Control.Monad(when)
43 45
44import Test.QuickCheck(Arbitrary,arbitrary,coarbitrary,choose,vector 46import Test.QuickCheck(Arbitrary,arbitrary,coarbitrary,choose,vector
45 ,sized,classify,Testable,Property 47 ,sized,classify,Testable,Property
46 ,quickCheckWith,maxSize,stdArgs,shrink) 48 ,quickCheckWithResult,maxSize,stdArgs,shrink)
47 49
48qCheck n = quickCheckWith stdArgs {maxSize = n} 50import Test.QuickCheck.Test(isSuccess)
51
52qCheck n x = do
53 r <- quickCheckWithResult stdArgs {maxSize = n} x
54 when (not $ isSuccess r) (exitFailure)
49 55
50a ^ b = a Prelude.^ (b :: Int) 56a ^ b = a Prelude.^ (b :: Int)
51 57
@@ -546,7 +552,7 @@ runTests n = do
546 test (\m -> toRows (m::FM) == read (show (toRows m))) 552 test (\m -> toRows (m::FM) == read (show (toRows m)))
547 test (\m -> toRows (m::ZM) == read (show (toRows m))) 553 test (\m -> toRows (m::ZM) == read (show (toRows m)))
548 putStrLn "------ some unit tests" 554 putStrLn "------ some unit tests"
549 _ <- runTestTT $ TestList 555 c <- runTestTT $ TestList
550 [ utest "1E5 rots" rotTest 556 [ utest "1E5 rots" rotTest
551 , utest "det1" detTest1 557 , utest "det1" detTest1
552 , utest "invlndet" detTest2 558 , utest "invlndet" detTest2
@@ -586,6 +592,7 @@ runTests n = do
586 , conformTest 592 , conformTest
587 , accumTest 593 , accumTest
588 ] 594 ]
595 when (errors c + failures c > 0) exitFailure
589 return () 596 return ()
590 597
591 598