Skip to content

Commit

Permalink
Move the test case to cabal-testsuite.
Browse files Browse the repository at this point in the history
  • Loading branch information
23Skidoo committed Jan 16, 2017
1 parent d8ec641 commit bab355b
Show file tree
Hide file tree
Showing 16 changed files with 611 additions and 65 deletions.
2 changes: 2 additions & 0 deletions cabal-install/Distribution/Client/Outdated.hs
Expand Up @@ -68,6 +68,8 @@ outdated verbosity0 outdatedFlags repoContext comp platform = do
else if newFreezeFile
then depsFromNewFreezeFile verbosity
else depsFromPkgDesc verbosity comp platform
debug verbosity $ "Dependencies loaded: "
++ (intercalate ", " $ map display deps)
let outdatedDeps = listOutdated deps pkgIndex ignore minor
when (not quiet) $
showResult verbosity outdatedDeps simpleOutput
Expand Down
27 changes: 0 additions & 27 deletions cabal-install/tests/IntegrationTests/outdated/outdated.sh

This file was deleted.

18 changes: 0 additions & 18 deletions cabal-install/tests/IntegrationTests/outdated/outdated_freeze.sh

This file was deleted.

This file was deleted.

26 changes: 26 additions & 0 deletions cabal-testsuite/PackageTests/Outdated/outdated.test.hs
@@ -0,0 +1,26 @@
import Test.Cabal.Prelude
main = cabalTest $ withRepo "repo" $ do
cabal' "outdated" [] >>=
(\out -> do
assertOutputContains "base" out
assertOutputContains "template-haskell" out)

cabal' "outdated" ["--ignore=base"] >>=
(\out -> do
assertOutputDoesNotContain "base" out
assertOutputContains "template-haskell" out)

cabal' "outdated" ["--ignore=base,template-haskell"] >>=
(\out -> do
assertOutputDoesNotContain "base" out
assertOutputDoesNotContain "template-haskell" out)

cabal' "outdated" ["--minor=base"] >>=
(\out -> do
assertOutputDoesNotContain "base" out
assertOutputContains "template-haskell" out)

cabal' "outdated" ["--minor=base,template-haskell"] >>=
(\out -> do
assertOutputDoesNotContain "base" out
assertOutputDoesNotContain "template-haskell" out)
18 changes: 18 additions & 0 deletions cabal-testsuite/PackageTests/Outdated/outdated_freeze.test.hs
@@ -0,0 +1,18 @@
import Test.Cabal.Prelude
main = cabalTest $ withRepo "repo"
$ forM_ ["--new-freeze-file", "--freeze-file"] $ \arg -> do

cabal' "outdated" [arg] >>=
(\out -> do
assertOutputContains "base" out
assertOutputContains "template-haskell" out)

cabal' "outdated" [arg, "--ignore=base,template-haskell"] >>=
(\out -> do
assertOutputDoesNotContain "base" out
assertOutputDoesNotContain "template-haskell" out)

cabal' "outdated" [arg, "--minor=base,template-haskell"] >>=
(\out -> do
assertOutputDoesNotContain "base" out
assertOutputContains "template-haskell" out)
154 changes: 154 additions & 0 deletions cabal-testsuite/PackageTests/Outdated/repo/base-3.0.3.1/base.cabal
@@ -0,0 +1,154 @@
name: base
version: 3.0.3.1
license: BSD3
license-file: LICENSE
maintainer: libraries@haskell.org
synopsis: Basic libraries (backwards-compatibility version)
description:
This is a backwards-compatible version of the base package.
It depends on a later version of base, and was probably supplied
with your compiler when it was installed.

cabal-version: >=1.2
build-type: Simple

Library {
build-depends: base >= 4.0 && < 4.2,
syb >= 0.1 && < 0.2
extensions: PackageImports

if impl(ghc < 6.9) {
buildable: False
}

if impl(ghc) {
exposed-modules:
Data.Generics,
Data.Generics.Aliases,
Data.Generics.Basics,
Data.Generics.Instances,
Data.Generics.Schemes,
Data.Generics.Text,
Data.Generics.Twins,
Foreign.Concurrent,
GHC.Arr,
GHC.Base,
GHC.Conc,
GHC.ConsoleHandler,
GHC.Desugar,
GHC.Dotnet,
GHC.Enum,
GHC.Environment,
GHC.Err,
GHC.Exception,
GHC.Exts,
GHC.Float,
GHC.ForeignPtr,
GHC.Handle,
GHC.IO,
GHC.IOBase,
GHC.Int,
GHC.List,
GHC.Num,
GHC.PArr,
GHC.Pack,
GHC.Ptr,
GHC.Read,
GHC.Real,
GHC.ST,
GHC.STRef,
GHC.Show,
GHC.Stable,
GHC.Storable,
GHC.TopHandler,
GHC.Unicode,
GHC.Weak,
GHC.Word,
System.Timeout
}
exposed-modules:
Control.Applicative,
Control.Arrow,
Control.Category,
Control.Concurrent,
Control.Concurrent.Chan,
Control.Concurrent.MVar,
Control.Concurrent.QSem,
Control.Concurrent.QSemN,
Control.Concurrent.SampleVar,
Control.Exception,
Control.Monad,
Control.Monad.Fix,
Control.Monad.Instances,
Control.Monad.ST,
Control.Monad.ST.Lazy,
Control.Monad.ST.Strict,
Data.Bits,
Data.Bool,
Data.Char,
Data.Complex,
Data.Dynamic,
Data.Either,
Data.Eq,
Data.Fixed,
Data.Foldable
Data.Function,
Data.HashTable,
Data.IORef,
Data.Int,
Data.Ix,
Data.List,
Data.Maybe,
Data.Monoid,
Data.Ord,
Data.Ratio,
Data.STRef,
Data.STRef.Lazy,
Data.STRef.Strict,
Data.String,
Data.Traversable
Data.Tuple,
Data.Typeable,
Data.Unique,
Data.Version,
Data.Word,
Debug.Trace,
Foreign,
Foreign.C,
Foreign.C.Error,
Foreign.C.String,
Foreign.C.Types,
Foreign.ForeignPtr,
Foreign.Marshal,
Foreign.Marshal.Alloc,
Foreign.Marshal.Array,
Foreign.Marshal.Error,
Foreign.Marshal.Pool,
Foreign.Marshal.Utils,
Foreign.Ptr,
Foreign.StablePtr,
Foreign.Storable,
Numeric,
Prelude,
System.Console.GetOpt,
System.CPUTime,
System.Environment,
System.Exit,
System.IO,
System.IO.Error,
System.IO.Unsafe,
System.Info,
System.Mem,
System.Mem.StableName,
System.Mem.Weak,
System.Posix.Internals,
System.Posix.Types,
Text.ParserCombinators.ReadP,
Text.ParserCombinators.ReadPrec,
Text.Printf,
Text.Read,
Text.Read.Lex,
Text.Show,
Text.Show.Functions
Unsafe.Coerce
}

0 comments on commit bab355b

Please sign in to comment.