Commit a6d2ec3e authored by Edward Z. Yang's avatar Edward Z. Yang Committed by Edward Z. Yang
Browse files

Move PackageTests to new cabal-testsuite package.



The key idea is that once we put PackageTests in its own package, we can
ensure that its Setup.hs is compiled with the same version of Cabal
library as package-tests is compiled with.  This means that LBI reading
will *always succeed* which is quite nice.
Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent 408e8815
......@@ -32,285 +32,6 @@ extra-source-files:
-- Generated with 'misc/gen-extra-source-files.sh'
-- Do NOT edit this section manually; instead, run the script.
-- BEGIN gen-extra-source-files
tests/PackageTests/AllowNewer/AllowNewer.cabal
tests/PackageTests/AllowNewer/benchmarks/Bench.hs
tests/PackageTests/AllowNewer/src/Foo.hs
tests/PackageTests/AllowNewer/tests/Test.hs
tests/PackageTests/AllowOlder/AllowOlder.cabal
tests/PackageTests/AllowOlder/benchmarks/Bench.hs
tests/PackageTests/AllowOlder/src/Foo.hs
tests/PackageTests/AllowOlder/tests/Test.hs
tests/PackageTests/Ambiguity/p/Dupe.hs
tests/PackageTests/Ambiguity/p/p.cabal
tests/PackageTests/Ambiguity/package-import/A.hs
tests/PackageTests/Ambiguity/package-import/package-import.cabal
tests/PackageTests/Ambiguity/q/Dupe.hs
tests/PackageTests/Ambiguity/q/q.cabal
tests/PackageTests/Ambiguity/reexport-test/Main.hs
tests/PackageTests/Ambiguity/reexport-test/reexport-test.cabal
tests/PackageTests/Ambiguity/reexport/reexport.cabal
tests/PackageTests/AutogenModules/Package/Dummy.hs
tests/PackageTests/AutogenModules/Package/MyBenchModule.hs
tests/PackageTests/AutogenModules/Package/MyExeModule.hs
tests/PackageTests/AutogenModules/Package/MyLibModule.hs
tests/PackageTests/AutogenModules/Package/MyLibrary.hs
tests/PackageTests/AutogenModules/Package/MyTestModule.hs
tests/PackageTests/AutogenModules/Package/my.cabal
tests/PackageTests/AutogenModules/SrcDist/Dummy.hs
tests/PackageTests/AutogenModules/SrcDist/MyBenchModule.hs
tests/PackageTests/AutogenModules/SrcDist/MyExeModule.hs
tests/PackageTests/AutogenModules/SrcDist/MyLibModule.hs
tests/PackageTests/AutogenModules/SrcDist/MyLibrary.hs
tests/PackageTests/AutogenModules/SrcDist/MyTestModule.hs
tests/PackageTests/AutogenModules/SrcDist/my.cabal
tests/PackageTests/Backpack/Includes1/A.hs
tests/PackageTests/Backpack/Includes1/B.hs
tests/PackageTests/Backpack/Includes1/Includes1.cabal
tests/PackageTests/Backpack/Includes2/Includes2.cabal
tests/PackageTests/Backpack/Includes2/exe/Main.hs
tests/PackageTests/Backpack/Includes2/exe/exe.cabal
tests/PackageTests/Backpack/Includes2/fail.cabal
tests/PackageTests/Backpack/Includes2/mylib/Mine.hs
tests/PackageTests/Backpack/Includes2/mylib/mylib.cabal
tests/PackageTests/Backpack/Includes2/mysql/Database/MySQL.hs
tests/PackageTests/Backpack/Includes2/mysql/mysql.cabal
tests/PackageTests/Backpack/Includes2/postgresql/Database/PostgreSQL.hs
tests/PackageTests/Backpack/Includes2/postgresql/postgresql.cabal
tests/PackageTests/Backpack/Includes2/src/App.hs
tests/PackageTests/Backpack/Includes2/src/src.cabal
tests/PackageTests/Backpack/Includes3/Includes3.cabal
tests/PackageTests/Backpack/Includes3/exe/Main.hs
tests/PackageTests/Backpack/Includes3/exe/exe.cabal
tests/PackageTests/Backpack/Includes3/indef/Foo.hs
tests/PackageTests/Backpack/Includes3/indef/indef.cabal
tests/PackageTests/Backpack/Includes3/sigs/sigs.cabal
tests/PackageTests/Backpack/Includes4/Includes4.cabal
tests/PackageTests/Backpack/Includes4/Main.hs
tests/PackageTests/Backpack/Includes4/impl/A.hs
tests/PackageTests/Backpack/Includes4/impl/B.hs
tests/PackageTests/Backpack/Includes4/impl/Rec.hs
tests/PackageTests/Backpack/Includes4/indef/C.hs
tests/PackageTests/Backpack/Includes5/A.hs
tests/PackageTests/Backpack/Includes5/B.hs
tests/PackageTests/Backpack/Includes5/Includes5.cabal
tests/PackageTests/Backpack/Includes5/impl/Foobar.hs
tests/PackageTests/Backpack/Includes5/impl/Quxbaz.hs
tests/PackageTests/Backpack/Indef1/Indef1.cabal
tests/PackageTests/Backpack/Indef1/Provide.hs
tests/PackageTests/Backpack/Reexport1/p/P.hs
tests/PackageTests/Backpack/Reexport1/p/p.cabal
tests/PackageTests/Backpack/Reexport1/q/Q.hs
tests/PackageTests/Backpack/Reexport1/q/q.cabal
tests/PackageTests/BenchmarkExeV10/Foo.hs
tests/PackageTests/BenchmarkExeV10/benchmarks/bench-Foo.hs
tests/PackageTests/BenchmarkExeV10/my.cabal
tests/PackageTests/BenchmarkOptions/BenchmarkOptions.cabal
tests/PackageTests/BenchmarkOptions/test-BenchmarkOptions.hs
tests/PackageTests/BenchmarkStanza/my.cabal
tests/PackageTests/BuildDeps/GlobalBuildDepsNotAdditive1/GlobalBuildDepsNotAdditive1.cabal
tests/PackageTests/BuildDeps/GlobalBuildDepsNotAdditive1/MyLibrary.hs
tests/PackageTests/BuildDeps/GlobalBuildDepsNotAdditive2/GlobalBuildDepsNotAdditive2.cabal
tests/PackageTests/BuildDeps/GlobalBuildDepsNotAdditive2/lemon.hs
tests/PackageTests/BuildDeps/InternalLibrary0/MyLibrary.hs
tests/PackageTests/BuildDeps/InternalLibrary0/my.cabal
tests/PackageTests/BuildDeps/InternalLibrary0/programs/lemon.hs
tests/PackageTests/BuildDeps/InternalLibrary1/MyLibrary.hs
tests/PackageTests/BuildDeps/InternalLibrary1/my.cabal
tests/PackageTests/BuildDeps/InternalLibrary1/programs/lemon.hs
tests/PackageTests/BuildDeps/InternalLibrary2/MyLibrary.hs
tests/PackageTests/BuildDeps/InternalLibrary2/my.cabal
tests/PackageTests/BuildDeps/InternalLibrary2/programs/lemon.hs
tests/PackageTests/BuildDeps/InternalLibrary2/to-install/MyLibrary.hs
tests/PackageTests/BuildDeps/InternalLibrary2/to-install/my.cabal
tests/PackageTests/BuildDeps/InternalLibrary3/MyLibrary.hs
tests/PackageTests/BuildDeps/InternalLibrary3/my.cabal
tests/PackageTests/BuildDeps/InternalLibrary3/programs/lemon.hs
tests/PackageTests/BuildDeps/InternalLibrary3/to-install/MyLibrary.hs
tests/PackageTests/BuildDeps/InternalLibrary3/to-install/my.cabal
tests/PackageTests/BuildDeps/InternalLibrary4/MyLibrary.hs
tests/PackageTests/BuildDeps/InternalLibrary4/my.cabal
tests/PackageTests/BuildDeps/InternalLibrary4/programs/lemon.hs
tests/PackageTests/BuildDeps/InternalLibrary4/to-install/MyLibrary.hs
tests/PackageTests/BuildDeps/InternalLibrary4/to-install/my.cabal
tests/PackageTests/BuildDeps/SameDepsAllRound/MyLibrary.hs
tests/PackageTests/BuildDeps/SameDepsAllRound/SameDepsAllRound.cabal
tests/PackageTests/BuildDeps/SameDepsAllRound/lemon.hs
tests/PackageTests/BuildDeps/SameDepsAllRound/pineapple.hs
tests/PackageTests/BuildDeps/TargetSpecificDeps1/MyLibrary.hs
tests/PackageTests/BuildDeps/TargetSpecificDeps1/lemon.hs
tests/PackageTests/BuildDeps/TargetSpecificDeps1/my.cabal
tests/PackageTests/BuildDeps/TargetSpecificDeps2/MyLibrary.hs
tests/PackageTests/BuildDeps/TargetSpecificDeps2/lemon.hs
tests/PackageTests/BuildDeps/TargetSpecificDeps2/my.cabal
tests/PackageTests/BuildDeps/TargetSpecificDeps3/MyLibrary.hs
tests/PackageTests/BuildDeps/TargetSpecificDeps3/lemon.hs
tests/PackageTests/BuildDeps/TargetSpecificDeps3/my.cabal
tests/PackageTests/BuildTargetErrors/BuildTargetErrors.cabal
tests/PackageTests/BuildTargetErrors/Main.hs
tests/PackageTests/BuildTestSuiteDetailedV09/Dummy2.hs
tests/PackageTests/BuildToolsPath/A.hs
tests/PackageTests/BuildToolsPath/MyCustomPreprocessor.hs
tests/PackageTests/BuildToolsPath/build-tools-path.cabal
tests/PackageTests/BuildToolsPath/hello/Hello.hs
tests/PackageTests/BuildableField/BuildableField.cabal
tests/PackageTests/BuildableField/Main.hs
tests/PackageTests/CMain/Bar.hs
tests/PackageTests/CMain/foo.c
tests/PackageTests/CMain/my.cabal
tests/PackageTests/CaretOperator/my.cabal
tests/PackageTests/Configure/A.hs
tests/PackageTests/Configure/Setup.hs
tests/PackageTests/Configure/include/HsZlibConfig.h.in
tests/PackageTests/Configure/zlib.buildinfo.in
tests/PackageTests/Configure/zlib.cabal
tests/PackageTests/ConfigureComponent/Exe/Bad.hs
tests/PackageTests/ConfigureComponent/Exe/Exe.cabal
tests/PackageTests/ConfigureComponent/Exe/Good.hs
tests/PackageTests/ConfigureComponent/SubLib/Lib.cabal
tests/PackageTests/ConfigureComponent/SubLib/Lib.hs
tests/PackageTests/ConfigureComponent/SubLib/exe/Exe.hs
tests/PackageTests/ConfigureComponent/Test/Lib.hs
tests/PackageTests/ConfigureComponent/Test/Test.cabal
tests/PackageTests/ConfigureComponent/Test/testlib/TestLib.hs
tests/PackageTests/ConfigureComponent/Test/testlib/testlib.cabal
tests/PackageTests/ConfigureComponent/Test/tests/Test.hs
tests/PackageTests/CopyComponent/Exe/Main.hs
tests/PackageTests/CopyComponent/Exe/Main2.hs
tests/PackageTests/CopyComponent/Exe/myprog.cabal
tests/PackageTests/CopyComponent/Lib/Main.hs
tests/PackageTests/CopyComponent/Lib/p.cabal
tests/PackageTests/CopyComponent/Lib/src/P.hs
tests/PackageTests/CustomPreProcess/Hello.hs
tests/PackageTests/CustomPreProcess/MyCustomPreprocessor.hs
tests/PackageTests/CustomPreProcess/Setup.hs
tests/PackageTests/CustomPreProcess/internal-preprocessor-test.cabal
tests/PackageTests/DeterministicAr/Lib.hs
tests/PackageTests/DeterministicAr/my.cabal
tests/PackageTests/DuplicateModuleName/DuplicateModuleName.cabal
tests/PackageTests/DuplicateModuleName/src/Foo.hs
tests/PackageTests/DuplicateModuleName/tests/Foo.hs
tests/PackageTests/DuplicateModuleName/tests2/Foo.hs
tests/PackageTests/EmptyLib/empty/empty.cabal
tests/PackageTests/ForeignLibs/UseLib.c
tests/PackageTests/ForeignLibs/csrc/MyForeignLibWrapper.c
tests/PackageTests/ForeignLibs/my-foreign-lib.cabal
tests/PackageTests/ForeignLibs/src/MyForeignLib/Hello.hs
tests/PackageTests/ForeignLibs/src/MyForeignLib/SomeBindings.hsc
tests/PackageTests/GhcPkgGuess/SameDirectory/SameDirectory.cabal
tests/PackageTests/GhcPkgGuess/SameDirectory/ghc
tests/PackageTests/GhcPkgGuess/SameDirectory/ghc-pkg
tests/PackageTests/GhcPkgGuess/SameDirectoryGhcVersion/SameDirectory.cabal
tests/PackageTests/GhcPkgGuess/SameDirectoryGhcVersion/ghc-7.10
tests/PackageTests/GhcPkgGuess/SameDirectoryGhcVersion/ghc-pkg-ghc-7.10
tests/PackageTests/GhcPkgGuess/SameDirectoryVersion/SameDirectory.cabal
tests/PackageTests/GhcPkgGuess/SameDirectoryVersion/ghc-7.10
tests/PackageTests/GhcPkgGuess/SameDirectoryVersion/ghc-pkg-7.10
tests/PackageTests/GhcPkgGuess/Symlink/SameDirectory.cabal
tests/PackageTests/GhcPkgGuess/Symlink/bin/ghc
tests/PackageTests/GhcPkgGuess/Symlink/bin/ghc-pkg
tests/PackageTests/GhcPkgGuess/SymlinkGhcVersion/SameDirectory.cabal
tests/PackageTests/GhcPkgGuess/SymlinkGhcVersion/bin/ghc-7.10
tests/PackageTests/GhcPkgGuess/SymlinkGhcVersion/bin/ghc-pkg-7.10
tests/PackageTests/GhcPkgGuess/SymlinkVersion/SameDirectory.cabal
tests/PackageTests/GhcPkgGuess/SymlinkVersion/bin/ghc-7.10
tests/PackageTests/GhcPkgGuess/SymlinkVersion/bin/ghc-pkg-ghc-7.10
tests/PackageTests/Haddock/CPP.hs
tests/PackageTests/Haddock/Literate.lhs
tests/PackageTests/Haddock/NoCPP.hs
tests/PackageTests/Haddock/Simple.hs
tests/PackageTests/Haddock/my.cabal
tests/PackageTests/HaddockNewline/A.hs
tests/PackageTests/HaddockNewline/HaddockNewline.cabal
tests/PackageTests/HaddockNewline/Setup.hs
tests/PackageTests/InternalLibraries/Executable/exe/Main.hs
tests/PackageTests/InternalLibraries/Executable/foo.cabal
tests/PackageTests/InternalLibraries/Executable/src/Foo.hs
tests/PackageTests/InternalLibraries/Library/fooexe/Main.hs
tests/PackageTests/InternalLibraries/Library/fooexe/fooexe.cabal
tests/PackageTests/InternalLibraries/Library/foolib/Foo.hs
tests/PackageTests/InternalLibraries/Library/foolib/foolib.cabal
tests/PackageTests/InternalLibraries/Library/foolib/private/Internal.hs
tests/PackageTests/InternalLibraries/p/Foo.hs
tests/PackageTests/InternalLibraries/p/p.cabal
tests/PackageTests/InternalLibraries/p/p/P.hs
tests/PackageTests/InternalLibraries/p/q/Q.hs
tests/PackageTests/InternalLibraries/q/Q.hs
tests/PackageTests/InternalLibraries/q/q.cabal
tests/PackageTests/InternalLibraries/r/R.hs
tests/PackageTests/InternalLibraries/r/r.cabal
tests/PackageTests/Macros/A.hs
tests/PackageTests/Macros/B.hs
tests/PackageTests/Macros/Main.hs
tests/PackageTests/Macros/macros.cabal
tests/PackageTests/Macros/src/C.hs
tests/PackageTests/Options.hs
tests/PackageTests/OrderFlags/Foo.hs
tests/PackageTests/OrderFlags/my.cabal
tests/PackageTests/PathsModule/Executable/Main.hs
tests/PackageTests/PathsModule/Executable/my.cabal
tests/PackageTests/PathsModule/Library/my.cabal
tests/PackageTests/PreProcess/Foo.hsc
tests/PackageTests/PreProcess/Main.hs
tests/PackageTests/PreProcess/my.cabal
tests/PackageTests/PreProcessExtraSources/Foo.hsc
tests/PackageTests/PreProcessExtraSources/Main.hs
tests/PackageTests/PreProcessExtraSources/my.cabal
tests/PackageTests/ReexportedModules/containers-dupe/Data/Map.hs
tests/PackageTests/ReexportedModules/containers-dupe/containers-dupe.cabal
tests/PackageTests/ReexportedModules/p/Private.hs
tests/PackageTests/ReexportedModules/p/Public.hs
tests/PackageTests/ReexportedModules/p/fail-ambiguous.cabal
tests/PackageTests/ReexportedModules/p/fail-missing.cabal
tests/PackageTests/ReexportedModules/p/fail-other.cabal
tests/PackageTests/ReexportedModules/p/p.cabal
tests/PackageTests/ReexportedModules/q/A.hs
tests/PackageTests/ReexportedModules/q/q.cabal
tests/PackageTests/Regression/T2971/p/include/T2971test.h
tests/PackageTests/Regression/T2971/p/p.cabal
tests/PackageTests/Regression/T2971/q/Bar.hsc
tests/PackageTests/Regression/T2971/q/Foo.hs
tests/PackageTests/Regression/T2971/q/q.cabal
tests/PackageTests/Regression/T2971a/Main.hsc
tests/PackageTests/Regression/T2971a/T2971a.cabal
tests/PackageTests/Regression/T2971a/include/T2971a.h
tests/PackageTests/Regression/T3294/T3294.cabal
tests/PackageTests/Regression/T3847/Main.hs
tests/PackageTests/Regression/T3847/T3847.cabal
tests/PackageTests/Regression/T4025/A.hs
tests/PackageTests/Regression/T4025/T4025.cabal
tests/PackageTests/Regression/T4025/exe/Main.hs
tests/PackageTests/TemplateHaskell/dynamic/Exe.hs
tests/PackageTests/TemplateHaskell/dynamic/Lib.hs
tests/PackageTests/TemplateHaskell/dynamic/TH.hs
tests/PackageTests/TemplateHaskell/dynamic/my.cabal
tests/PackageTests/TemplateHaskell/profiling/Exe.hs
tests/PackageTests/TemplateHaskell/profiling/Lib.hs
tests/PackageTests/TemplateHaskell/profiling/TH.hs
tests/PackageTests/TemplateHaskell/profiling/my.cabal
tests/PackageTests/TemplateHaskell/vanilla/Exe.hs
tests/PackageTests/TemplateHaskell/vanilla/Lib.hs
tests/PackageTests/TemplateHaskell/vanilla/TH.hs
tests/PackageTests/TemplateHaskell/vanilla/my.cabal
tests/PackageTests/TestNameCollision/child/Child.hs
tests/PackageTests/TestNameCollision/child/child.cabal
tests/PackageTests/TestNameCollision/child/tests/Test.hs
tests/PackageTests/TestNameCollision/parent/Parent.hs
tests/PackageTests/TestNameCollision/parent/parent.cabal
tests/PackageTests/TestOptions/TestOptions.cabal
tests/PackageTests/TestOptions/test-TestOptions.hs
tests/PackageTests/TestStanza/my.cabal
tests/PackageTests/TestSuiteTests/ExeV10/Foo.hs
tests/PackageTests/TestSuiteTests/ExeV10/my.cabal
tests/PackageTests/TestSuiteTests/ExeV10/tests/test-Foo.hs
tests/PackageTests/TestSuiteTests/ExeV10/tests/test-Short.hs
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/ParserTests/warnings/bom.cabal
tests/ParserTests/warnings/bool.cabal
tests/ParserTests/warnings/deprecatedfield.cabal
......@@ -325,7 +46,6 @@ extra-source-files:
tests/ParserTests/warnings/unknownsection.cabal
tests/ParserTests/warnings/utf8.cabal
tests/ParserTests/warnings/versiontag.cabal
tests/Setup.hs
tests/hackage/check.sh
tests/hackage/download.sh
tests/hackage/unpack.sh
......@@ -633,45 +353,6 @@ test-suite unit-tests
ghc-options: -Wall
default-language: Haskell2010
-- Large, system tests that build packages.
test-suite package-tests
type: exitcode-stdio-1.0
main-is: PackageTests.hs
other-modules:
PackageTests.AutogenModules.Package.Check
PackageTests.AutogenModules.SrcDist.Check
PackageTests.BenchmarkStanza.Check
PackageTests.BuildDeps.GlobalBuildDepsNotAdditive1.Check
PackageTests.BuildDeps.GlobalBuildDepsNotAdditive2.Check
PackageTests.CaretOperator.Check
PackageTests.DeterministicAr.Check
PackageTests.ForeignLibs.Check
PackageTests.TestStanza.Check
PackageTests.TestSuiteTests.ExeV10.Check
PackageTests.PackageTester
PackageTests.Tests
hs-source-dirs: tests
build-depends:
base,
containers,
tagged,
tasty,
tasty-hunit,
transformers,
time,
Cabal,
process,
directory,
filepath,
bytestring,
regex-posix,
old-time
if !os(windows)
build-depends: unix, exceptions
ghc-options: -Wall -rtsopts
default-extensions: CPP
default-language: Haskell2010
test-suite parser-tests
if !flag(parsec)
buildable: False
......
......@@ -28,8 +28,8 @@ main' fp = do
let testModuleFiles = getOtherModulesFiles cabal
let skipPredicates' = skipPredicates ++ map (==) testModuleFiles
-- Read all files git knows about under tests/
files0 <- lines <$> readProcess "git" ["ls-files", "tests"] ""
-- Read all files git knows about under "tests" and "PackageTests" (cabal-testsuite)
files0 <- lines <$> readProcess "git" ["ls-files", "tests", "PackageTests"] ""
-- Filter
let files1 = filter (\f -> takeExtension f `elem` whitelistedExtensionss ||
......@@ -98,7 +98,7 @@ main = do
progName <- getProgName
putStrLn "Error too few arguments!"
putStrLn $ "Usage: " ++ progName ++ " FILE"
putStrLn " where FILE is Cabal.cabal or cabal-install.cabal"
putStrLn " where FILE is Cabal.cabal, cabal-testsuite.cabal or cabal-install.cabal"
strictReadFile :: FilePath -> IO String
strictReadFile fp = do
......
Writing package tests
=====================
Unit tests
==========
The tests under the [PackageTests] directory define and build packages
that exercise various components of Cabal. Each test case is an [HUnit]
test. The entry point for the test suite, where all the test cases are
listed, is [PackageTests.hs]. There are utilities for calling the stages
of Cabal's build process in [PackageTests/PackageTester.hs]; have a look
at an existing test case to see how they are used.
In order to run the tests, `PackageTests` needs to know where the inplace
copy of Cabal being tested is, as well as some information which was
used to configure it. By default, `PackageTests` tries to look at the
`LocalBuildInfo`, but if the format of `LocalBuildInfo` has changed
between the version of Cabal which ran the configure step, and the
version of Cabal we are testing against, this may fail. In that
case, you can manually specify the information we need using
the following environment variables:
* `CABAL_PACKAGETESTS_GHC` is the path to the GHC you compiled Cabal with
* `CABAL_PACKAGETESTS_WITH_GHC` is the path for the GHC you want to have
Cabal use when running tests; i.e., you can change this to a different
version of GHC to see how Cabal handles that version. If omitted,
it defaults to `CABAL_PACKAGETESTS_GHC`.
* `CABAL_PACKAGETESTS_DB_STACK` is a PATH-style list of package database paths,
`clear`, `global` and `user`. Each component of the list is
interpreted the same way as Cabal's `-package-db` flag. This list
must contain the copy of Cabal you are planning to test against
(as well as its transitive dependencies). By default, we guess
that it is just the global and user database. However, if some of
Cabal's dependencies were installed in a sandbox or other non-standard
location, you will need to add it. Most commonly, if you are are
using 'new-build' you'll need to add
dist-newstyle/packagedb/ghc-VERSION and $HOME/.cabal/store/ghc-VERSION/package.db
to your database stack. (In most situations, the actual inplace
database Cabal was registered into is automatically detected.)
There are a few extra options to toggle (e.g. `CABAL_PACKAGETESTS_GHC_PKG`
lets you explicitly set ghc-pkg in case Cabal can't autodetect it) but
the three above.
If you can successfully run the test suite, we'll print out examples
of all of these values for you under "Environment".
[PackageTests]: PackageTests
[HUnit]: http://hackage.haskell.org/package/HUnit
[PackageTests.hs]: PackageTests.hs
[PackageTests/PackageTester.hs]: PackageTests/PackageTester.hs
[detailed]: ../Distribution/TestSuite.hs
[PackageTests/BuildTestSuiteDetailedV09/Check.hs]: PackageTests/BuildTestSuiteDetailedV09/Check.hs
Ordinary unit tests. If you're looking for the package tests,
they live in cabal-testsuite now.
import Distribution.Simple
main = defaultMain
Copyright (c) 2003-2016, Cabal Development Team.
See the AUTHORS file for the full list of copyright holders.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Isaac Jones nor the names of other
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
......@@ -242,7 +242,7 @@ main = do
-- Create a shared Setup executable to speed up Simple tests
putStrLn $ "Building shared ./Setup executable"
rawCompileSetup verbosity suite [] "tests"
rawCompileSetup verbosity suite [] "."
defaultMainWithIngredients options $
runTestTree "Package Tests" (tests suite)
......
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