Commit 28c706da authored by Neil Mitchell's avatar Neil Mitchell
Browse files

#146, add a Test module with selftest

parent 754ed41f
......@@ -100,6 +100,7 @@ executable ghc-shake
, Settings.Ways
, Stage
, Target
, Test
, Way
default-extensions: BangPatterns
......@@ -111,6 +112,7 @@ executable ghc-shake
, FlexibleInstances
, OverloadedStrings
, RecordWildCards
, ScopedTypeVariables
build-depends: base
, ansi-terminal >= 0.6
, Cabal >= 1.22
......@@ -118,6 +120,7 @@ executable ghc-shake
, directory >= 1.2
, extra >= 1.4
, mtl >= 2.2
, QuickCheck >= 2.6
, shake >= 0.15
, transformers >= 0.4
, unordered-containers >= 0.2
......
......@@ -11,6 +11,7 @@ import qualified Rules.Gmp
import qualified Rules.Libffi
import qualified Rules.Oracles
import qualified Rules.Perl
import qualified Test
main :: IO ()
main = shakeArgs options rules
......@@ -25,7 +26,8 @@ main = shakeArgs options rules
, Rules.Gmp.gmpRules
, Rules.Libffi.libffiRules
, Rules.Oracles.oracleRules
, Rules.packageRules ]
, Rules.packageRules
, Test.testRules ]
options = shakeOptions
{ shakeFiles = Base.shakeFilesPath
, shakeProgress = progressSimple
......
{-# LANGUAGE ScopedTypeVariables #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Test (testRules) where
import Way
import Development.Shake
import Test.QuickCheck
instance Arbitrary Way where
arbitrary = wayFromUnits <$> arbitrary
instance Arbitrary WayUnit where
arbitrary = arbitraryBoundedEnum
testRules :: Rules ()
testRules =
phony "selftest" $ do
liftIO $ quickCheck $ \(x :: Way) -> read (show x) == x
module Way (
WayUnit (..), Way, wayUnit,
WayUnit (..), Way, wayUnit, wayFromUnits,
vanilla, profiling, logging, parallel, granSim,
threaded, threadedProfiling, threadedLogging,
......
Supports Markdown
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