Commit 579bff0c authored by Oleg Grenrus's avatar Oleg Grenrus
Browse files

Move tests from Cabal to Cabal-tests package

The are various motivation points:
- I'm not aware anyone third party running Cabal tests (maybe nixpkgs?)
- No need to do gen-extra-source-files, as Cabal-tests is not distributed
- No multiple rebuilds of Cabal-QuickCheck, Cabal-tree-diff
- Slightly smaller Cabal sdist (which is quite big still)
parent 2c864830
......@@ -39,7 +39,6 @@ jobs:
- name: Regenerate files
run: |
make lexer
make gen-extra-source-files
make spdx
make templates
make github-actions
......
......@@ -54,6 +54,9 @@ jobs:
run: cabal v2-build Cabal --only-dependencies
- name: cabal v2-build
run: cabal v2-build all
- name: Cabal unit-tests
run: |
cabal v2-test Cabal-tests
- name: cabal-install memory-usage-tests
run: |
cd cabal-install
......@@ -72,7 +75,7 @@ jobs:
cabal v2-run cabal-install:unit-tests -- --pattern "! (/FileMonitor/ || /VCS/ || /Get/)"
- name: cabal-tests
# Using only one job, -j1, to fail less.
run: cabal v2-run cabal-tests -- -j1 --with-cabal=dist-newstyle\build\x86_64-windows\ghc-8.6.5\cabal-install-3.5.0.0\x\cabal\build\cabal\cabal.exe
run: cabal v2-run cabal-testsuite:cabal-tests -- -j1 --with-cabal=dist-newstyle\build\x86_64-windows\ghc-8.6.5\cabal-install-3.5.0.0\x\cabal\build\cabal\cabal.exe
test-windows-8_8_4:
name: test ghc-8.8.4
runs-on: windows-latest
......@@ -109,6 +112,9 @@ jobs:
run: cabal v2-build Cabal --only-dependencies
- name: cabal v2-build
run: cabal v2-build all
- name: Cabal unit-tests
run: |
cabal v2-test Cabal-tests
- name: cabal-install memory-usage-tests
run: |
cd cabal-install
......@@ -127,4 +133,4 @@ jobs:
cabal v2-run cabal-install:unit-tests -- --pattern "! (/FileMonitor/ || /VCS/ || /Get/)"
- name: cabal-tests
# Using only one job, -j1, to fail less.
run: cabal v2-run cabal-tests -- -j1 --with-cabal=dist-newstyle\build\x86_64-windows\ghc-8.8.4\cabal-install-3.5.0.0\x\cabal\build\cabal\cabal.exe
run: cabal v2-run cabal-testsuite:cabal-tests -- -j1 --with-cabal=dist-newstyle\build\x86_64-windows\ghc-8.8.4\cabal-install-3.5.0.0\x\cabal\build\cabal\cabal.exe
......@@ -20,6 +20,12 @@ library
, tasty-quickcheck
, transformers
if !impl(ghc >=7.10)
build-depends: void
if !impl(ghc >=7.8)
build-depends: tagged ^>=0.8.5
exposed-modules:
Distribution.Described
Distribution.Utils.CharSet
......
cabal-version: >=1.10
name: Cabal-tests
version: 3
copyright: 2003-2020, Cabal Development Team (see AUTHORS file)
license: BSD3
license-file: LICENSE
author: Cabal Development Team <cabal-devel@haskell.org>
maintainer: cabal-devel@haskell.org
homepage: http://www.haskell.org/cabal/
bug-reports: https://github.com/haskell/cabal/issues
synopsis: Tests for Cabal library
description: The tests are external for development flows convinience.
category: Distribution
build-type: Simple
source-repository head
type: git
location: https://github.com/haskell/cabal/
subdir: Cabal-tests
-- Small, fast running tests.
test-suite unit-tests
type: exitcode-stdio-1.0
hs-source-dirs: tests
other-modules:
Test.Laws
Test.QuickCheck.Utils
UnitTests.Distribution.CabalSpecVersion
UnitTests.Distribution.Compat.CreatePipe
UnitTests.Distribution.Compat.Graph
UnitTests.Distribution.Compat.Time
UnitTests.Distribution.Described
UnitTests.Distribution.PkgconfigVersion
UnitTests.Distribution.Simple.Glob
UnitTests.Distribution.Simple.Program.GHC
UnitTests.Distribution.Simple.Program.Internal
UnitTests.Distribution.Simple.Utils
UnitTests.Distribution.SPDX
UnitTests.Distribution.System
UnitTests.Distribution.Types.GenericPackageDescription
UnitTests.Distribution.Utils.CharSet
UnitTests.Distribution.Utils.Generic
UnitTests.Distribution.Utils.NubList
UnitTests.Distribution.Utils.ShortText
UnitTests.Distribution.Utils.Structured
UnitTests.Distribution.Version
UnitTests.Orphans
main-is: UnitTests.hs
build-depends:
array
, async >=2.2.2 && <2.3
, base >=0 && <5
, binary
, bytestring
, Cabal
, Cabal-described
, Cabal-QuickCheck
, containers
, deepseq
, Diff >=0.4 && <0.5
, directory
, filepath
, integer-logarithms >=1.0.2 && <1.1
, pretty
, QuickCheck >=2.14 && <2.15
, rere >=0.1 && <0.2
, tagged
, tasty >=1.2.3 && <1.4
, tasty-hunit
, tasty-quickcheck
, temporary
, text
, transformers
ghc-options: -Wall
default-language: Haskell2010
if !impl(ghc >=7.10)
build-depends: void
if !impl(ghc >=8.0)
build-depends: semigroups
test-suite parser-tests
type: exitcode-stdio-1.0
hs-source-dirs: tests
main-is: ParserTests.hs
build-depends:
base
, base-compat >=0.11.0 && <0.12
, bytestring
, Cabal
, Cabal-tree-diff
, Diff >=0.4 && <0.5
, directory
, filepath
, tasty >=1.2.3 && <1.4
, tasty-golden >=2.3.1.1 && <2.4
, tasty-hunit
, tasty-quickcheck
ghc-options: -Wall
default-language: Haskell2010
if !impl(ghc >=8.0)
build-depends: semigroups
if impl(ghc >=7.8)
build-depends: tree-diff ==0.1.*
test-suite check-tests
type: exitcode-stdio-1.0
hs-source-dirs: tests
main-is: CheckTests.hs
build-depends:
base
, bytestring
, Cabal
, Diff >=0.4 && <0.5
, directory
, filepath
, tasty >=1.2.3 && <1.4
, tasty-golden >=2.3.1.1 && <2.4
ghc-options: -Wall
default-language: Haskell2010
if !impl(ghc >=8.0)
build-depends: semigroups
test-suite custom-setup-tests
type: exitcode-stdio-1.0
hs-source-dirs: tests/custom-setup
main-is: CustomSetupTests.hs
other-modules:
CabalDoctestSetup
IdrisSetup
build-depends:
base
, Cabal
, directory
, filepath
, process
default-language: Haskell2010
test-suite hackage-tests
type: exitcode-stdio-1.0
main-is: HackageTests.hs
-- TODO: need to get 01-index.tar on appveyor
if os(windows)
buildable: False
hs-source-dirs: tests
build-depends:
base
, bytestring
, Cabal
, Cabal-tree-diff
, containers
, deepseq
, directory
, filepath
build-depends:
base-compat >=0.11.0 && <0.12
, base-orphans >=0.6 && <0.9
, clock >=0.8 && <0.9
, optparse-applicative >=0.13.2.0 && <0.17
, stm >=2.4.5.0 && <2.6
, tar >=0.5.0.3 && <0.6
if impl(ghc >=7.8)
build-depends: tree-diff ==0.1.*
ghc-options: -Wall -rtsopts -threaded
default-extensions: CPP
default-language: Haskell2010
test-suite rpmvercmp
type: exitcode-stdio-1.0
main-is: RPMVerCmp.hs
hs-source-dirs: tests
build-depends:
base
, bytestring
, Cabal
build-depends:
QuickCheck
, tasty >=1.2.3 && <1.4
, tasty-hunit
, tasty-quickcheck
c-sources: tests/cbits/rpmvercmp.c
cc-options: -Wall
ghc-options: -Wall
default-language: Haskell2010
test-suite no-thunks-test
default-language: Haskell2010
ghc-options: -Wall
type: exitcode-stdio-1.0
main-is: NoThunks.hs
hs-source-dirs: tests
build-depends:
base
, bytestring
, Cabal
, tasty >=1.2.3 && <1.4
, tasty-hunit
-- this is test is buildable on old GHCs
-- but it doesn't do anything.
if impl(ghc >=8.6)
build-depends: nothunks >=0.1.1.0 && <0.2
Copyright (c) 2003-2020, Cabal Development Team.
See the AUTHORS file for the full list of copyright holders.
See */LICENSE for the copyright holders of the subcomponents.
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.
{-# LANGUAGE CPP #-}
#if !(__GLASGOW_HASKELL__ >= 806 && defined(MIN_VERSION_nothunks))
module Main (main) where
main :: IO ()
main = putStrLn "Old GHC, no nothunks"
#else
{-# LANGUAGE DerivingVia #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE ScopedTypeVariables #-}
......@@ -36,7 +43,7 @@ main = defaultMain $ testGroup "nothunks"
noThunksParse :: IO ()
noThunksParse = do
bs <- BS.readFile "Cabal/Cabal.cabal" <|> BS.readFile "Cabal.cabal"
bs <- BS.readFile "Cabal/Cabal.cabal" <|> BS.readFile "../Cabal/Cabal.cabal"
let res = parseGenericPackageDescription bs
gpd <- either (assertFailure . show) return $ snd $
runParseResult res
......@@ -130,3 +137,5 @@ newtype CheckFoldableNamed f a = CheckFoldableNamed (f a)
instance (NoThunks a, Foldable f, Typeable f) => NoThunks (CheckFoldableNamed f a) where
showTypeOf _ = show (typeRep (Proxy :: Proxy f))
wNoThunks ctxt (CheckFoldableNamed xs) = noThunksInValues ctxt (toList xs)
#endif
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