Skip to content

Migrate integration tests to shell based format, fixed travis #2868

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 15, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Cabal/Cabal.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,14 @@ extra-source-files:
tests/PackageTests/TestSuiteTests/ExeV10/Foo.hs
tests/PackageTests/TestSuiteTests/ExeV10/my.cabal
tests/PackageTests/TestSuiteTests/ExeV10/tests/test-Foo.hs
tests/PackageTests/TestSuiteTests/LibV09/LibV09.cabal
tests/PackageTests/TestSuiteTests/LibV09/Lib.hs
tests/PackageTests/TestSuiteTests/LibV09/LibV09.cabal
tests/PackageTests/TestSuiteTests/LibV09/tests/Deadlock.hs
tests/PackageTests/UniqueIPID/P1/M.hs
tests/PackageTests/UniqueIPID/P1/my.cabal
tests/PackageTests/UniqueIPID/P2/M.hs
tests/PackageTests/UniqueIPID/P2/my.cabal
tests/PackageTests/multInst/my.cabal
tests/Setup.hs
tests/Test/Distribution/Version.hs
tests/Test/Laws.hs
Expand Down Expand Up @@ -173,6 +174,7 @@ library
Distribution.Compat.CreatePipe
Distribution.Compat.Environment
Distribution.Compat.Exception
Distribution.Compat.Internal.TempFile
Distribution.Compat.ReadP
Distribution.Compiler
Distribution.InstalledPackageInfo
Expand Down Expand Up @@ -247,7 +249,6 @@ library
other-modules:
Distribution.Compat.Binary
Distribution.Compat.CopyFile
Distribution.Compat.TempFile
Distribution.GetOpt
Distribution.Lex
Distribution.Simple.GHC.Internal
Expand Down
2 changes: 1 addition & 1 deletion Cabal/Distribution/Compat/CopyFile.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import System.IO.Error
( ioeSetLocation )
import System.Directory
( doesFileExist, renameFile, removeFile )
import Distribution.Compat.TempFile
import Distribution.Compat.Internal.TempFile
( openBinaryTempFile )
import System.FilePath
( takeDirectory )
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{-# LANGUAGE CPP #-}
{-# OPTIONS_HADDOCK hide #-}
module Distribution.Compat.TempFile (
module Distribution.Compat.Internal.TempFile (
openTempFile,
openBinaryTempFile,
openNewBinaryFile,
Expand Down
2 changes: 1 addition & 1 deletion Cabal/Distribution/Simple/Test/LibV09.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module Distribution.Simple.Test.LibV09

import Distribution.Compat.CreatePipe ( createPipe )
import Distribution.Compat.Environment ( getEnvironment )
import Distribution.Compat.TempFile ( openTempFile )
import Distribution.Compat.Internal.TempFile ( openTempFile )
import Distribution.ModuleName ( ModuleName )
import qualified Distribution.PackageDescription as PD
import Distribution.Simple.Build.PathsModule ( pkgPathEnvVar )
Expand Down
2 changes: 1 addition & 1 deletion Cabal/Distribution/Simple/Utils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ import System.Process
import Distribution.Compat.CopyFile
( copyFile, copyOrdinaryFile, copyExecutableFile
, setFileOrdinary, setFileExecutable, setDirOrdinary )
import Distribution.Compat.TempFile
import Distribution.Compat.Internal.TempFile
( openTempFile, createTempDirectory )
import Distribution.Compat.Exception
( tryIO, catchIO, catchExit )
Expand Down
47 changes: 33 additions & 14 deletions cabal-install/cabal-install.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,35 @@ Extra-Source-Files:
README.md bash-completion/cabal bootstrap.sh changelog

-- Generated with '../Cabal/misc/gen-extra-source-files.sh | sort'
tests/PackageTests/Freeze/my.cabal
tests/IntegrationTests/exec/common.sh
tests/IntegrationTests/exec/should_run/Foo.hs
tests/IntegrationTests/exec/should_run/My.hs
tests/IntegrationTests/exec/should_run/adds_sandbox_bin_directory_to_path.sh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "prints error message if given no argument" test for exec is missing, is this due to the Windows .exe problem?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. This is also part of the reason for some of the > /dev/null bits. (I may have forgotten to remove some that weren't strictly necessary.).

The problem is the you get the "configuring blahblah..." message which contains the executable name and if you're trying to compare the contents of stdout with a file...

(There was a little back and forth on this on the original branch. I decided to keep the option of having .out and .err files, but in some cases I had to replace them with a "cabal ... | grep ..." to avoid the .exe problem.)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I should say: The test is still in here in one of the *.sh files, but just with a "cabal ... | grep ..." instead of direct-compare with an output file.

tests/IntegrationTests/exec/should_run/auto_configures_on_exec.sh
tests/IntegrationTests/exec/should_run/can_run_executables_installed_in_sandbox.sh
tests/IntegrationTests/exec/should_run/configures_cabal_to_use_sandbox.sh
tests/IntegrationTests/exec/should_run/configures_ghc_to_use_sandbox.sh
tests/IntegrationTests/exec/should_run/exit_with_failure_without_args.sh
tests/IntegrationTests/exec/should_run/my.cabal
tests/IntegrationTests/exec/should_run/runs_given_command.sh
tests/IntegrationTests/freeze/common.sh
tests/IntegrationTests/freeze/should_run/disable_benchmarks_freezes_bench_deps.sh
tests/IntegrationTests/freeze/should_run/disable_tests_freezes_test_deps.sh
tests/IntegrationTests/freeze/should_run/does_not_freeze_nondeps.sh
tests/IntegrationTests/freeze/should_run/does_not_freeze_self.sh
tests/IntegrationTests/freeze/should_run/dry_run_does_not_create_config.sh
tests/IntegrationTests/freeze/should_run/enable_benchmarks_freezes_bench_deps.sh
tests/IntegrationTests/freeze/should_run/enable_tests_freezes_test_deps.sh
tests/IntegrationTests/freeze/should_run/freezes_direct_dependencies.sh
tests/IntegrationTests/freeze/should_run/freezes_transitive_dependencies.sh
tests/IntegrationTests/freeze/should_run/my.cabal
tests/IntegrationTests/freeze/should_run/runs_without_error.sh
tests/IntegrationTests/multiple-source/common.sh
tests/IntegrationTests/multiple-source/should_run/finds_second_source_of_multiple_source.sh
tests/IntegrationTests/multiple-source/should_run/p/Setup.hs
tests/IntegrationTests/multiple-source/should_run/p/p.cabal
tests/IntegrationTests/multiple-source/should_run/q/Setup.hs
tests/IntegrationTests/multiple-source/should_run/q/q.cabal

source-repository head
type: git
Expand Down Expand Up @@ -229,29 +257,20 @@ Test-Suite unit-tests
ghc-options: -threaded
default-language: Haskell2010

-- Large, system tests that build packages.
test-suite package-tests
test-suite integration-tests
type: exitcode-stdio-1.0
hs-source-dirs: tests
main-is: PackageTests.hs
other-modules:
PackageTests.Exec.Check
PackageTests.Freeze.Check
PackageTests.MultipleSource.Check
PackageTests.PackageTester
main-is: IntegrationTests.hs
build-depends:
Cabal,
QuickCheck >= 2.1.0.1 && < 2.9,
async,
base,
bytestring,
directory,
extensible-exceptions,
filepath,
process,
regex-posix,
tasty,
tasty-hunit,
tasty-quickcheck
tasty-hunit

if os(windows)
build-depends: Win32 >= 2 && < 3
Expand Down
Loading