Unverified Commit 99a81f51 authored by Mikhail Glushenkov's avatar Mikhail Glushenkov Committed by Mikhail Glushenkov
Browse files

Move the test case to cabal-testsuite.

parent 864984cd
......@@ -10,10 +10,10 @@ cabal-dev/
*.p_hi
*.prof
*.tix
cabal.config
dist
dist-*
register.sh
./cabal.config
/Cabal/dist/
/Cabal/tests/Setup
......
......@@ -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
......
......@@ -111,11 +111,6 @@ Extra-Source-Files:
tests/IntegrationTests/new-build/monitor_cabal_files/q/Setup.hs
tests/IntegrationTests/new-build/monitor_cabal_files/q/q-broken.cabal.in
tests/IntegrationTests/new-build/monitor_cabal_files/q/q-fixed.cabal.in
tests/IntegrationTests/outdated/cabal.project
tests/IntegrationTests/outdated/my.cabal
tests/IntegrationTests/outdated/outdated.sh
tests/IntegrationTests/outdated/outdated_freeze.sh
tests/IntegrationTests/outdated/outdated_new_freeze.sh
tests/IntegrationTests/regression/t2755.sh
tests/IntegrationTests/regression/t2755/A.hs
tests/IntegrationTests/regression/t2755/Setup.hs
......
. ./common.sh
OUTPUT=`cabal outdated`
echo $OUTPUT | grep base || die "should have listed 'base' as outdated"
echo $OUTPUT | grep template-haskell \
|| die "should have listed 'template-haskell' as outdated"
OUTPUT=`cabal outdated --ignore=base`
echo $OUTPUT | grep -v base || die "shouldn't have listed 'base' as outdated"
echo $OUTPUT | grep template-haskell \
|| die "should have listed 'template-haskell' as outdated"
OUTPUT=`cabal outdated --ignore=base,template-haskell`
echo $OUTPUT | grep -v base || die "shouldn't have listed 'base' as outdated"
echo $OUTPUT | grep -v template-haskell \
|| die "shouldn't have listed 'template-haskell' as outdated"
OUTPUT=`cabal outdated --minor=base`
echo $OUTPUT | grep -v base || die "shouldn't have listed 'base' as outdated"
echo $OUTPUT | grep template-haskell \
|| die "should have listed 'template-haskell' as outdated"
OUTPUT=`cabal outdated --minor=base,template-haskell`
echo $OUTPUT | grep -v base || die "shouldn't have listed 'base' as outdated"
echo $OUTPUT | grep -v template-haskell \
|| die "shouldn't have listed 'template-haskell' as outdated"
. ./common.sh
OUTPUT=`cabal outdated --freeze-file`
echo $OUTPUT | grep base || die "should have listed 'base' as outdated"
echo $OUTPUT | grep template-haskell \
|| die "should have listed 'base' as outdated"
cabal outdated --freeze-file --ignore=base | grep -v base \
|| die "shouldn't have listed 'base' as outdated"
cabal outdated --freeze-file --minor=base | grep -v base \
|| die "shouldn't have listed 'base' as outdated"
cabal outdated --freeze-file --ignore=template-haskell \
| grep -v template-haskell \
|| die "shouldn't have listed template-haskell as outdated"
cabal outdated --freeze-file --minor=template-haskell | grep template-haskell \
|| die "should have listed template-haskell as outdated"
. ./common.sh
OUTPUT=`cabal outdated --new-freeze-file`
echo $OUTPUT | grep base || die "should have listed 'base' as outdated"
echo $OUTPUT | grep template-haskell \
|| die "should have listed 'base' as outdated"
cabal outdated --new-freeze-file --ignore=base | grep -v base \
|| die "shouldn't have listed 'base' as outdated"
cabal outdated --new-freeze-file --minor=base | grep -v base \
|| die "shouldn't have listed 'base' as outdated"
cabal outdated --new-freeze-file --ignore=template-haskell \
| grep -v template-haskell \
|| die "shouldn't have listed template-haskell as outdated"
cabal outdated --new-freeze-file --minor=template-haskell \
| grep template-haskell \
|| die "should have listed template-haskell as outdated"
constraints: base == 3.0.3.2, template-haskell ==2.3.0.0
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)
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)
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
}
name: base
version: 3.0.3.2
license: BSD3
license-file: LICENSE
maintainer: libraries@haskell.org
bug-reports: http://hackage.haskell.org/trac/ghc/newticket?component=libraries/base
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.6
build-type: Simple
source-repository head
type: darcs
location: http://darcs.haskell.org/packages/base3-compat
Library {
build-depends: base >= 4.0 && < 4.3,
syb >= 0.1 && < 0.2
extensions: PackageImports,CPP
ghc-options: -fno-warn-deprecations
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
}
name: base
version: 4.0.0.0
license: BSD3
license-file: LICENSE
maintainer: libraries@haskell.org
synopsis: Basic libraries
description:
This package contains the Prelude and its support libraries,
and a large collection of useful libraries ranging from data
structures to parsing combinators and debugging utilities.
cabal-version: >= 1.2.3
build-type: Configure
extra-tmp-files:
config.log config.status autom4te.cache
include/HsBaseConfig.h
extra-source-files:
config.guess config.sub install-sh
aclocal.m4 configure.ac configure
include/CTypes.h
Library {
if impl(ghc) {
build-depends: rts, ghc-prim, integer
exposed-modules:
Foreign.Concurrent,
GHC.Arr,
GHC.Base,
GHC.Classes,
GHC.Conc,
GHC.ConsoleHandler,
GHC.Desugar,
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
extensions: MagicHash, ExistentialQuantification, Rank2Types,
ScopedTypeVariables, UnboxedTuples,
ForeignFunctionInterface, UnliftedFFITypes,
DeriveDataTypeable, GeneralizedNewtypeDeriving,
FlexibleInstances, PatternSignatures, StandaloneDeriving,
PatternGuards, EmptyDataDecls
}
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.Exception.Base
Control.OldException,
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.Data,
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