Commit 755a298b authored by Edward Z. Yang's avatar Edward Z. Yang
Browse files

Port freeze tests to cabal-testsuite


Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent d21c95e4
......@@ -35,17 +35,6 @@ Extra-Source-Files:
tests/IntegrationTests/exec/T4049/src/MyForeignLib/Hello.hs
tests/IntegrationTests/exec/T4049/src/MyForeignLib/SomeBindings.hsc
tests/IntegrationTests/exec/my.cabal
tests/IntegrationTests/freeze/disable_benchmarks_freezes_bench_deps.sh
tests/IntegrationTests/freeze/disable_tests_freezes_test_deps.sh
tests/IntegrationTests/freeze/does_not_freeze_nondeps.sh
tests/IntegrationTests/freeze/does_not_freeze_self.sh
tests/IntegrationTests/freeze/dry_run_does_not_create_config.sh
tests/IntegrationTests/freeze/enable_benchmarks_freezes_bench_deps.sh
tests/IntegrationTests/freeze/enable_tests_freezes_test_deps.sh
tests/IntegrationTests/freeze/freezes_direct_dependencies.sh
tests/IntegrationTests/freeze/freezes_transitive_dependencies.sh
tests/IntegrationTests/freeze/my.cabal
tests/IntegrationTests/freeze/runs_without_error.sh
tests/IntegrationTests2/build/keep-going/cabal.project
tests/IntegrationTests2/build/keep-going/p/P.hs
tests/IntegrationTests2/build/keep-going/p/p.cabal
......
. ./common.sh
cabal freeze --disable-benchmarks
grep -v " criterion ==" cabal.config || die "should NOT have frozen criterion"
. ./common.sh
cabal freeze --disable-tests
grep -v " test-framework ==" cabal.config || die "should NOT have frozen test-framework"
. ./common.sh
# TODO: Test this against a package installed in the sandbox but not
# depended upon.
cabal freeze
grep -v "exceptions ==" cabal.config || die "should not have frozen exceptions"
. ./common.sh
cabal freeze
grep -v " my ==" cabal.config || die "should not have frozen self"
. ./common.sh
cabal freeze --dry-run
[ ! -e cabal.config ] || die "cabal.config file should not have been created"
. ./common.sh
# TODO: solver should find solution without extra flags too
cabal freeze --enable-benchmarks --reorder-goals --max-backjumps=-1
grep " criterion ==" cabal.config || die "should have frozen criterion"
. ./common.sh
cabal freeze --enable-tests
grep " test-framework ==" cabal.config || die "should have frozen test-framework"
. ./common.sh
cabal freeze
grep " base ==" cabal.config || die "'base' should have been frozen"
. ./common.sh
cabal freeze
grep " ghc-prim ==" cabal.config || die "'ghc-prim' should have been frozen"
# cabal update
Downloading the latest package list from test-local-repo
# cabal freeze
Resolving dependencies...
import Test.Cabal.Prelude
main = cabalTest $ do
withRepo "repo" . withSourceCopy $ do
cabal "freeze" ["--disable-benchmarks"]
cwd <- fmap testCurrentDir getTestEnv
assertFileDoesNotContain (cwd </> "cabal.config") "criterion"
# cabal update
Downloading the latest package list from test-local-repo
# cabal freeze
Resolving dependencies...
import Test.Cabal.Prelude
main = cabalTest $ do
withRepo "repo" . withSourceCopy $ do
cabal "freeze" ["--disable-tests"]
cwd <- fmap testCurrentDir getTestEnv
assertFileDoesNotContain (cwd </> "cabal.config") "test-framework"
# cabal update
Downloading the latest package list from test-local-repo
import Test.Cabal.Prelude
main = cabalTest $ do
withRepo "repo" . withSourceCopy $ do
recordMode DoNotRecord $ cabal "freeze" ["--dry-run"]
cwd <- fmap testCurrentDir getTestEnv
shouldNotExist (cwd </> "cabal.config")
# cabal update
Downloading the latest package list from test-local-repo
# cabal freeze
Resolving dependencies...
import Test.Cabal.Prelude
main = cabalTest $ do
withRepo "repo" . withSourceCopy $ do
cabal "freeze" ["--enable-benchmarks"]
cwd <- fmap testCurrentDir getTestEnv
assertFileDoesContain (cwd </> "cabal.config") "criterion"
assertFileDoesContain (cwd </> "cabal.config") "ghc-prim"
# cabal update
Downloading the latest package list from test-local-repo
# cabal freeze
Resolving dependencies...
Markdown is supported
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