Skip to content
Snippets Groups Projects
Unverified Commit 1cfe7c4c authored by ffaf1's avatar ffaf1 Committed by GitHub
Browse files

`cabal-check` testsuite: add Package/File tests (#8250)

* (cabal check) Add “Unknown OS” test

* (cabal check) Add “Unknown arch” test

* (cabal check) Add “Unknown compiler” test

* (cabal check) Add “Package versions” check

* (cabal check) Add “`-Werror`” test

* (cabal check) Add “-j[n]” test

* (cabal check) Add “Defer type errors” test

* (cabal check) Add “Debug flag” test

* (cabal check) Add “Profiling flag” test

* (cabal check) Add “Unused flag” test

* (cabal check) Add “Custom fields” check

* (cabal check) Add “Paths_module extension” test

* (cabal check) Add “Setup bounds” test

* (cabal check) Add “Duplicate module” test

* (cabal check) Add “No license” check

* (cabal check) Add “NONE license” test

* (cabal check) Add AllRightsReserved warning test

* (cabal check) Add “compatibility” license test

With cabal-version < 1.4, some license (e.g. ISC) mess up the
parser.

* (cabal check) Add “Unknown license” test

* (cabal check) Add “Suspicious BSD4” test

* (cabal check) Add “Suspicious version” test

* (cabal check) Add “`license-file` missing” test

* (cabal check) Add “Unrecognised repo type” test

* (cabal check) Add “No `type`” test

* (cabal test) Add “No `location`” test

* (cabal check) Add “No `module`” test

Only for CVS repos.

* (cabal check) Add “`tag` needed” test

For `this`-type source-repositories.

* (cabal check) Add “Relative path” test

* (cabal check) Add “Good relative path” test

* (cabal check) Add “ghc-options” test.

Checks if there is a tricky GHC option in `ghc-options`. We will
*not* write an integration test for each offending option, just
one (in this case for `-fasm`) to make sure the field is scanned.

* (cabal check) Add “ghc-shared-options” test.

Checks if there is a tricky GHC option in `ghc-shared-options`. We
will *not* write an integration test for each offending option, just
one (in this case for `-fglasgow-exts`) to make sure the field is
scanned.

* (cabal check) Add “ghc-prof-options” test.

Checks if there is a tricky GHC option in `ghc-prof-options`. We
will *not* write an integration test for each offending option,
just one (in this case for `-o`) to make sure the field is scanned.

* (cabal check) Add “`cc-options` include” test

* (cabal check) Add “Cxx `extra-libraries`” test

* (cabal check) Add “`cc-options` libdir” test

* (cabal check) Add `Cxx -Os` test.

* (cabal check) Add “Portable CPP flags” test

* (cabal check) Add “Invalid on Win” test

* (cabal check) Add “Outside relative path” test

Note that this test is not atomic; it comes with a "not a good
relative path" error, and this is unavoidable.

* (cabal check) Add “Absolute path” test.

Note that this test is not atomic; comes with a "not a good relative
path" *and* a "does not match any file" warning. This is unfortunately
unavoidable.

* (cabal check) Add “points to dist/” test

* (cabal check) Add “Testsuite ≥1.8” test

* (cabal check) Add “Default language” test

* (cabal check) Add “Default language spec” test

* (cabal check) Add “Extra doc” test

* (cabal check) Add “Multilib/namedlib” test

* (cabal check) Add “Reexported module” test

* (cabal check) Add “Mixins” test

* (cabal check) Add “Extra framework dirs” test

* (cabal check) Add “Default extensions” test

* (cabal check) Add `extensions` test

* (cabal check) Add Sources test

* (cabal check) Add “Extra libs” test

* (cabal check) Add “Virtual modules” test

* (cabal check) Add “Source repository” test

* (cabal check) Add “Extension break” test

* (cabal check) Add “Custom setup” test

* (cabal check) Add “Autogen modules” test

* (cabal check) Add “No z-prefixed check” test

* (cabal check) Add “No `build-type` specified” test

* (cabal check) Add “Ignoring custom-setup” test

* (cabal check) Add “Unknown compiler” test

In `tested-with`

* (cabal check) Add “Unknown language” test

* (cabal check) Add “Unknown extension” test

* (cabal check) Add “Language as extension” test

Languages cannot be listed in `default-extensions`.

* (cabal check) Add “Deprecated extension” test

* (cabal check) Add “No synopsis” test

* (cabal check) Add “No description” test

* (cabal check) Add “No category” test

* (cabal check) Add “No maintainer” test

* (cabal check) Add “Short description” test

`description` should be longer than `synopsis`.

* (cabal check) Add “Invalid tested with range” test

* (cabal check) Add “Internal library” test

On impossible version ranges for internal libraries.

* (cabal check) Add BOM test

* (cabal check) Add “Name mismatch” test

* (cabal check) Add “Missing .cabal” test

* (cabal check) Add “Missing license file” test

* (cabal check) Add “No setup file” test

* (cabal check) Add “No configure file” test

* (cabal check) Add “Local paths” check

* (cabal check) Add “Missing VCS info” test

* (cabal check) Add “Partial extension match” test

* (cabal check) Add “Filename too long” check
parent be363be7
No related branches found
No related tags found
No related merge requests found
Showing
with 133 additions and 0 deletions
# cabal check
Warning: The following warnings are likely to affect your build negatively:
Warning: Instead of 'cc-options: -Llibdir' use 'extra-lib-dirs: libdir'
Warning: Hackage would reject this package.
import Test.Cabal.Prelude
-- `cc-options`, use `extra-lib-dirs` instead of `-L`.
main = cabalTest $
fails $ cabal "check" []
cabal-version: 3.0
name: pkg
synopsis: synopsis
description: description
version: 0
category: example
maintainer: none@example.com
license: GPL-3.0-or-later
library
exposed-modules: Module
default-language: Haskell2010
cc-options: -Llibdir
# cabal check
Warning: The following warnings are likely to affect your build negatively:
Warning: Instead of 'cc-options: -Ifolder' use 'include-dirs: folder'
Warning: Hackage would reject this package.
import Test.Cabal.Prelude
-- `cc-options`, use `include-dirs` instead of `-I`.
main = cabalTest $
fails $ cabal "check" []
cabal-version: 3.0
name: pkg
synopsis: synopsis
description: description
version: 0
category: example
maintainer: none@example.com
license: GPL-3.0-or-later
library
exposed-modules: Module
default-language: Haskell2010
cc-options: -Ifolder
# cabal check
Warning: The following warnings are likely to affect your build negatively:
Warning: 'cpp-options: -Q' is not a portable C-preprocessor flag.
Warning: Hackage would reject this package.
import Test.Cabal.Prelude
-- `cpp-options`, do not use use non portable flags.
main = cabalTest $
fails $ cabal "check" []
cabal-version: 3.0
name: pkg
synopsis: synopsis
description: description
version: 0
category: example
maintainer: none@example.com
license: GPL-3.0-or-later
library
exposed-modules: Module
default-language: Haskell2010
cpp-options: -Q
# cabal check
Warning: The following warnings are likely to affect your build negatively:
Warning: Instead of 'cxx-options: -lgame' use 'extra-libraries: game'
Warning: Hackage would reject this package.
import Test.Cabal.Prelude
-- `cxx-options`, use `extra-libraries` instead of `-l`.
main = cabalTest $
fails $ cabal "check" []
cabal-version: 3.0
name: pkg
synopsis: synopsis
description: description
version: 0
category: example
maintainer: none@example.com
license: GPL-3.0-or-later
library
exposed-modules: Module
default-language: Haskell2010
cxx-options: -lgame
# cabal check
Warning: These warnings may cause trouble when distributing the package:
Warning: 'cxx-options: -O[n]' is generally not needed. When building with optimisations Cabal automatically adds '-O2' for C++ code. Setting it yourself interferes with the --disable-optimization flag.
import Test.Cabal.Prelude
-- `cxx-options`, do not use `-O1`.
main = cabalTest $
fails $ cabal "check" []
cabal-version: 3.0
name: pkg
synopsis: synopsis
description: description
version: 0
category: example
maintainer: none@example.com
license: GPL-3.0-or-later
library
exposed-modules: Module
default-language: Haskell2010
cxx-options: -O1
# cabal check
Warning: The following errors will cause portability problems on other environments:
Warning: Packages using 'cabal-version: 2.0' and the autogenerated module Paths_* must include it also on the 'autogen-modules' field besides 'exposed-modules' and 'other-modules'. This specifies that the module does not come with the package and is generated on setup. Modules built with a custom Setup.hs script also go here to ensure that commands like sdist don't fail.
Warning: Hackage would reject this package.
import Test.Cabal.Prelude
-- autogenerated modules in `autogen-modules` w/ ≥ 2.0.
main = cabalTest $
fails $ cabal "check" []
cabal-version: 2.0
build-type: Simple
name: pkg
synopsis: synopsis
description: description
version: 0
category: example
maintainer: none@example.com
license: GPL-3
license-file: LICENSE
library
exposed-modules: Module
other-modules: Paths_pkg
default-language: Haskell2010
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment