summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess2015-11-17 15:51:12 -0400
committerJoey Hess2015-11-17 15:51:12 -0400
commit9ad0f07358df3d87a5d05e9f44131da79cfe266e (patch)
treefbfdb5b4c5cd835184b04cddc0c728067dfbe6ed
parentd1054f0dce335cabe7f89c02d2e764dabe2b5024 (diff)
Removed the (unused) dependency on quickcheck.
-rw-r--r--debian/changelog1
-rw-r--r--debian/control2
-rw-r--r--propellor.cabal7
-rw-r--r--src/Propellor/Bootstrap.hs1
-rw-r--r--src/Utility/QuickCheck.hs53
-rw-r--r--src/Utility/Scheduled.hs37
6 files changed, 4 insertions, 97 deletions
diff --git a/debian/changelog b/debian/changelog
index 320aff96..a117e1d3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,7 @@ propellor (2.13.1) UNRELEASED; urgency=medium
set the git repository url normally implicitly set when using --spin.
* Added Chroot.noServices property.
* DiskImage creation automatically uses Chroot.noServices.
+ * Removed the (unused) dependency on quickcheck.
-- Joey Hess <id@joeyh.name> Wed, 11 Nov 2015 13:37:00 -0400
diff --git a/debian/control b/debian/control
index 1a7909a3..757462d1 100644
--- a/debian/control
+++ b/debian/control
@@ -13,7 +13,6 @@ Build-Depends:
libghc-ansi-terminal-dev,
libghc-ifelse-dev,
libghc-network-dev,
- libghc-quickcheck2-dev,
libghc-mtl-dev,
libghc-transformers-dev,
libghc-exceptions-dev (>= 0.6),
@@ -37,7 +36,6 @@ Depends: ${misc:Depends}, ${shlibs:Depends},
libghc-ansi-terminal-dev,
libghc-ifelse-dev,
libghc-network-dev,
- libghc-quickcheck2-dev,
libghc-mtl-dev,
libghc-transformers-dev,
libghc-exceptions-dev (>= 0.6),
diff --git a/propellor.cabal b/propellor.cabal
index ee3a4f70..0a27acb2 100644
--- a/propellor.cabal
+++ b/propellor.cabal
@@ -38,7 +38,7 @@ Executable propellor
Hs-Source-Dirs: src
Build-Depends: MissingH, directory, filepath, base >= 4.5, base < 5,
IfElse, process, bytestring, hslogger, unix-compat, ansi-terminal,
- containers (>= 0.5), network, async, time, QuickCheck, mtl, transformers,
+ containers (>= 0.5), network, async, time, mtl, transformers,
exceptions (>= 0.6), stm, text, unix
Executable propellor-config
@@ -47,7 +47,7 @@ Executable propellor-config
Hs-Source-Dirs: src
Build-Depends: MissingH, directory, filepath, base >= 4.5, base < 5,
IfElse, process, bytestring, hslogger, unix-compat, ansi-terminal,
- containers (>= 0.5), network, async, time, QuickCheck, mtl, transformers,
+ containers (>= 0.5), network, async, time, mtl, transformers,
exceptions (>= 0.6), stm, text, unix
Library
@@ -55,7 +55,7 @@ Library
Hs-Source-Dirs: src
Build-Depends: MissingH, directory, filepath, base >= 4.5, base < 5,
IfElse, process, bytestring, hslogger, unix-compat, ansi-terminal,
- containers (>= 0.5), network, async, time, QuickCheck, mtl, transformers,
+ containers (>= 0.5), network, async, time, mtl, transformers,
exceptions (>= 0.6), stm, text, unix
Exposed-Modules:
@@ -175,7 +175,6 @@ Library
Utility.ThreadScheduler
Utility.Tmp
Utility.UserInfo
- Utility.QuickCheck
System.Console.Concurrent
System.Console.Concurrent.Internal
System.Process.Concurrent
diff --git a/src/Propellor/Bootstrap.hs b/src/Propellor/Bootstrap.hs
index 21772b34..f2f5af55 100644
--- a/src/Propellor/Bootstrap.hs
+++ b/src/Propellor/Bootstrap.hs
@@ -77,7 +77,6 @@ depsCommand = "( " ++ intercalate " ; " (concat [osinstall, cabalinstall]) ++ "
, "libghc-ansi-terminal-dev"
, "libghc-ifelse-dev"
, "libghc-network-dev"
- , "libghc-quickcheck2-dev"
, "libghc-mtl-dev"
, "libghc-transformers-dev"
, "libghc-exceptions-dev"
diff --git a/src/Utility/QuickCheck.hs b/src/Utility/QuickCheck.hs
deleted file mode 100644
index cd408ddc..00000000
--- a/src/Utility/QuickCheck.hs
+++ /dev/null
@@ -1,53 +0,0 @@
-{- QuickCheck with additional instances
- -
- - Copyright 2012-2014 Joey Hess <id@joeyh.name>
- -
- - License: BSD-2-clause
- -}
-
-{-# OPTIONS_GHC -fno-warn-orphans #-}
-{-# LANGUAGE TypeSynonymInstances #-}
-
-module Utility.QuickCheck
- ( module X
- , module Utility.QuickCheck
- ) where
-
-import Test.QuickCheck as X
-import Data.Time.Clock.POSIX
-import System.Posix.Types
-import qualified Data.Map as M
-import qualified Data.Set as S
-import Control.Applicative
-import Prelude
-
-instance (Arbitrary k, Arbitrary v, Eq k, Ord k) => Arbitrary (M.Map k v) where
- arbitrary = M.fromList <$> arbitrary
-
-instance (Arbitrary v, Eq v, Ord v) => Arbitrary (S.Set v) where
- arbitrary = S.fromList <$> arbitrary
-
-{- Times before the epoch are excluded. -}
-instance Arbitrary POSIXTime where
- arbitrary = fromInteger <$> nonNegative arbitrarySizedIntegral
-
-instance Arbitrary EpochTime where
- arbitrary = fromInteger <$> nonNegative arbitrarySizedIntegral
-
-{- Pids are never negative, or 0. -}
-instance Arbitrary ProcessID where
- arbitrary = arbitrarySizedBoundedIntegral `suchThat` (> 0)
-
-{- Inodes are never negative. -}
-instance Arbitrary FileID where
- arbitrary = nonNegative arbitrarySizedIntegral
-
-{- File sizes are never negative. -}
-instance Arbitrary FileOffset where
- arbitrary = nonNegative arbitrarySizedIntegral
-
-nonNegative :: (Num a, Ord a) => Gen a -> Gen a
-nonNegative g = g `suchThat` (>= 0)
-
-positive :: (Num a, Ord a) => Gen a -> Gen a
-positive g = g `suchThat` (> 0)
diff --git a/src/Utility/Scheduled.hs b/src/Utility/Scheduled.hs
index 5e813d4a..ead8f771 100644
--- a/src/Utility/Scheduled.hs
+++ b/src/Utility/Scheduled.hs
@@ -23,12 +23,10 @@ module Utility.Scheduled (
toRecurrance,
toSchedule,
parseSchedule,
- prop_schedule_roundtrips,
prop_past_sane,
) where
import Utility.Data
-import Utility.QuickCheck
import Utility.PartialPrelude
import Utility.Misc
@@ -337,41 +335,6 @@ parseSchedule s = do
recurrance = unwords rws
scheduledtime = unwords tws
-instance Arbitrary Schedule where
- arbitrary = Schedule <$> arbitrary <*> arbitrary
-
-instance Arbitrary ScheduledTime where
- arbitrary = oneof
- [ pure AnyTime
- , SpecificTime
- <$> choose (0, 23)
- <*> choose (1, 59)
- ]
-
-instance Arbitrary Recurrance where
- arbitrary = oneof
- [ pure Daily
- , Weekly <$> arbday
- , Monthly <$> arbday
- , Yearly <$> arbday
- , Divisible
- <$> positive arbitrary
- <*> oneof -- no nested Divisibles
- [ pure Daily
- , Weekly <$> arbday
- , Monthly <$> arbday
- , Yearly <$> arbday
- ]
- ]
- where
- arbday = oneof
- [ Just <$> nonNegative arbitrary
- , pure Nothing
- ]
-
-prop_schedule_roundtrips :: Schedule -> Bool
-prop_schedule_roundtrips s = toSchedule (fromSchedule s) == Just s
-
prop_past_sane :: Bool
prop_past_sane = and
[ all (checksout oneMonthPast) (mplus1 ++ yplus1)