Skip to content
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

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

Merged
merged 83 commits into from
Jul 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
b3c647a
(cabal check) Add “Unknown OS” test
ffaf1 Jun 28, 2022
77f7876
(cabal check) Add “Unknown arch” test
ffaf1 Jun 28, 2022
e2f27b9
(cabal check) Add “Unknown compiler” test
ffaf1 Jun 28, 2022
ad4cb38
(cabal check) Add “Package versions” check
ffaf1 Jun 28, 2022
397550d
(cabal check) Add “`-Werror`” test
ffaf1 Jun 28, 2022
6743050
(cabal check) Add “-j[n]” test
ffaf1 Jun 28, 2022
2819829
(cabal check) Add “Defer type errors” test
ffaf1 Jun 28, 2022
6a0ceb8
(cabal check) Add “Debug flag” test
ffaf1 Jun 28, 2022
b54b7d6
(cabal check) Add “Profiling flag” test
ffaf1 Jun 28, 2022
70136f4
(cabal check) Add “Unused flag” test
ffaf1 Jun 28, 2022
b778b9f
(cabal check) Add “Custom fields” check
ffaf1 Jun 28, 2022
092d3f9
(cabal check) Add “Paths_module extension” test
ffaf1 Jun 28, 2022
8c8ba73
(cabal check) Add “Setup bounds” test
ffaf1 Jun 28, 2022
02eccf8
(cabal check) Add “Duplicate module” test
ffaf1 Jun 28, 2022
a531b08
(cabal check) Add “No license” check
ffaf1 Jun 23, 2022
a258ad6
(cabal check) Add “NONE license” test
ffaf1 Jun 23, 2022
0e173e4
(cabal check) Add AllRightsReserved warning test
ffaf1 Jun 23, 2022
23589cd
(cabal check) Add “compatibility” license test
ffaf1 Jun 23, 2022
956c62c
(cabal check) Add “Unknown license” test
ffaf1 Jun 23, 2022
cbde429
(cabal check) Add “Suspicious BSD4” test
ffaf1 Jun 23, 2022
28a45ed
(cabal check) Add “Suspicious version” test
ffaf1 Jun 23, 2022
9673c34
(cabal check) Add “`license-file` missing” test
ffaf1 Jun 23, 2022
a79ce58
(cabal check) Add “Unrecognised repo type” test
ffaf1 Jun 23, 2022
d188fb8
(cabal check) Add “No `type`” test
ffaf1 Jun 23, 2022
c0407e3
(cabal test) Add “No `location`” test
ffaf1 Jun 23, 2022
83a8cd5
(cabal check) Add “No `module`” test
ffaf1 Jun 23, 2022
c6e9fb4
(cabal check) Add “`tag` needed” test
ffaf1 Jun 23, 2022
ac5c348
(cabal check) Add “Relative path” test
ffaf1 Jun 23, 2022
24ff209
(cabal check) Add “Good relative path” test
ffaf1 Jun 23, 2022
bfe638c
(cabal check) Add “ghc-options” test.
ffaf1 Jun 24, 2022
0bdc854
(cabal check) Add “ghc-shared-options” test.
ffaf1 Jun 24, 2022
9b43945
(cabal check) Add “ghc-prof-options” test.
ffaf1 Jun 24, 2022
2a2a83d
(cabal check) Add “`cc-options` include” test
ffaf1 Jun 25, 2022
94c97d8
(cabal check) Add “Cxx `extra-libraries`” test
ffaf1 Jun 25, 2022
2d340a8
(cabal check) Add “`cc-options` libdir” test
ffaf1 Jun 25, 2022
8977f0f
(cabal check) Add `Cxx -Os` test.
ffaf1 Jun 25, 2022
0c3ba9e
(cabal check) Add “Portable CPP flags” test
ffaf1 Jun 25, 2022
c3e9fdc
(cabal check) Add “Invalid on Win” test
ffaf1 Jun 25, 2022
a2a4bfa
(cabal check) Add “Outside relative path” test
ffaf1 Jun 25, 2022
8d90972
(cabal check) Add “Absolute path” test.
ffaf1 Jun 25, 2022
465cacb
(cabal check) Add “points to dist/” test
ffaf1 Jun 25, 2022
aad155c
(cabal check) Add “Testsuite ≥1.8” test
ffaf1 Jun 26, 2022
1d0cb30
(cabal check) Add “Default language” test
ffaf1 Jun 26, 2022
4c1773e
(cabal check) Add “Default language spec” test
ffaf1 Jun 26, 2022
d8740b8
(cabal check) Add “Extra doc” test
ffaf1 Jun 26, 2022
3badcd5
(cabal check) Add “Multilib/namedlib” test
ffaf1 Jun 26, 2022
fead43d
(cabal check) Add “Reexported module” test
ffaf1 Jun 26, 2022
3b53fc6
(cabal check) Add “Mixins” test
ffaf1 Jun 27, 2022
b7c8480
(cabal check) Add “Extra framework dirs” test
ffaf1 Jun 27, 2022
cf6eb49
(cabal check) Add “Default extensions” test
ffaf1 Jun 27, 2022
641a1fa
(cabal check) Add `extensions` test
ffaf1 Jun 27, 2022
ec8d19b
(cabal check) Add Sources test
ffaf1 Jun 27, 2022
57a7d8d
(cabal check) Add “Extra libs” test
ffaf1 Jun 27, 2022
8e9c6f2
(cabal check) Add “Virtual modules” test
ffaf1 Jun 27, 2022
eb565e5
(cabal check) Add “Source repository” test
ffaf1 Jun 27, 2022
85854d1
(cabal check) Add “Extension break” test
ffaf1 Jun 27, 2022
f1d48dc
(cabal check) Add “Custom setup” test
ffaf1 Jun 27, 2022
e6986ca
(cabal check) Add “Autogen modules” test
ffaf1 Jun 27, 2022
23504aa
(cabal check) Add “No z-prefixed check” test
ffaf1 Jun 23, 2022
4741c43
(cabal check) Add “No `build-type` specified” test
ffaf1 Jun 23, 2022
654d3af
(cabal check) Add “Ignoring custom-setup” test
ffaf1 Jun 23, 2022
b3a4130
(cabal check) Add “Unknown compiler” test
ffaf1 Jun 23, 2022
e17c0c5
(cabal check) Add “Unknown language” test
ffaf1 Jun 23, 2022
ea3ba05
(cabal check) Add “Unknown extension” test
ffaf1 Jun 23, 2022
5f44c65
(cabal check) Add “Language as extension” test
ffaf1 Jun 23, 2022
71730c2
(cabal check) Add “Deprecated extension” test
ffaf1 Jun 23, 2022
196f0ef
(cabal check) Add “No synopsis” test
ffaf1 Jun 23, 2022
a98385c
(cabal check) Add “No description” test
ffaf1 Jun 23, 2022
cb1200d
(cabal check) Add “No category” test
ffaf1 Jun 23, 2022
f5884b2
(cabal check) Add “No maintainer” test
ffaf1 Jun 23, 2022
ea2d851
(cabal check) Add “Short description” test
ffaf1 Jun 23, 2022
7c4adda
(cabal check) Add “Invalid tested with range” test
ffaf1 Jun 23, 2022
8cb879b
(cabal check) Add “Internal library” test
ffaf1 Jun 23, 2022
8ca98b7
(cabal check) Add BOM test
ffaf1 Jun 30, 2022
64f0559
(cabal check) Add “Name mismatch” test
ffaf1 Jun 30, 2022
3f2a8ba
(cabal check) Add “Missing .cabal” test
ffaf1 Jun 30, 2022
54dbef3
(cabal check) Add “Missing license file” test
ffaf1 Jun 30, 2022
c6cfa3c
(cabal check) Add “No setup file” test
ffaf1 Jun 30, 2022
cc46086
(cabal check) Add “No configure file” test
ffaf1 Jun 30, 2022
fe81390
(cabal check) Add “Local paths” check
ffaf1 Jun 30, 2022
560e049
(cabal check) Add “Missing VCS info” test
ffaf1 Jun 30, 2022
0250b4a
(cabal check) Add “Partial extension match” test
ffaf1 Jun 30, 2022
50138ec
(cabal check) Add “Filename too long” check
ffaf1 Jun 30, 2022
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# 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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Test.Cabal.Prelude

-- `cc-options`, use `extra-lib-dirs` instead of `-L`.
main = cabalTest $
fails $ cabal "check" []
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# 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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Test.Cabal.Prelude

-- `cc-options`, use `include-dirs` instead of `-I`.
main = cabalTest $
fails $ cabal "check" []
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# 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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Test.Cabal.Prelude

-- `cpp-options`, do not use use non portable flags.
main = cabalTest $
fails $ cabal "check" []
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# 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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Test.Cabal.Prelude

-- `cxx-options`, use `extra-libraries` instead of `-l`.
main = cabalTest $
fails $ cabal "check" []
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Test.Cabal.Prelude

-- `cxx-options`, do not use `-O1`.
main = cabalTest $
fails $ cabal "check" []
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# 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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Test.Cabal.Prelude

-- autogenerated modules in `autogen-modules` w/ ≥ 2.0.
main = cabalTest $
fails $ cabal "check" []
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# cabal check
Warning: These warnings may cause trouble when distributing the package:
Warning: From version 1.24 cabal supports specifying explicit dependencies for Custom setup scripts. Consider using 'cabal-version: 1.24' or higher and adding a 'custom-setup' section with a 'setup-depends' field that specifies the dependencies of the Setup.hs script itself. The 'setup-depends' field uses the same syntax as 'build-depends', so a simple example would be 'setup-depends: base, Cabal'.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Test.Cabal.Prelude

-- `custom-setup` on ≥1.24.
main = cabalTest $
cabal "check" []
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
cabal-version: 1.12
build-type: Custom
name: pkg
synopsis: synopsis
description: description
version: 0
category: example
maintainer: none@example.com
license: GPL-3
license-file: LICENSE

library
exposed-modules: Module
default-language: Haskell2010
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# cabal check
Warning: These warnings may cause trouble when distributing the package:
Warning: pkg.cabal:14:3: The field "default-extensions" is available only since the Cabal specification version 1.10. This field will be ignored.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Test.Cabal.Prelude

-- `default-extensions` need ≥1.10.
main = cabalTest $
fails $ cabal "check" []
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
cabal-version: >= 1.8
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
default-extensions: ScopedTypeVariables
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# cabal check
Warning: These warnings may cause trouble when distributing the package:
Warning: pkg.cabal:14:3: The field "default-language" is available only since the Cabal specification version 1.10. This field will be ignored.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Test.Cabal.Prelude

-- `default-language` need ≥1.10.
main = cabalTest $
fails $ cabal "check" []
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
cabal-version: >= 1.8
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
default-language: Haskell2010
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# cabal check
Warning: The following warnings are likely to affect your build negatively:
Warning: Packages using 'cabal-version: >= 1.10' and before 'cabal-version: 3.4' must specify the 'default-language' field for each component (e.g. Haskell98 or Haskell2010). If a component uses different languages in different modules then list the other ones in the 'other-languages' field.
Warning: Hackage would reject this package.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Test.Cabal.Prelude

-- You need to specify `default-language`.
main = cabalTest $
fails $ cabal "check" []
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# cabal check
Warning: The following errors will cause portability problems on other environments:
Warning: Unfortunately the language extensions 'MonoPatBinds' break the parser in earlier Cabal versions so you need to specify 'cabal-version: >= 1.4'. Alternatively if you require compatibility with earlier Cabal versions then you may be able to use an equivalent compiler-specific flag.
Warning: Hackage would reject this package.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Test.Cabal.Prelude

-- Some extension need ≥1.2.
main = cabalTest $
fails $ cabal "check" []
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
cabal-version: >= 1.2
build-type: Simple
name: pkg
synopsis: synopsis
description: description
version: 0
category: example
maintainer: none@example.com
license: BSD3
license-file: LICENSE

library
exposed-modules: Module
extensions: MonoPatBinds
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# cabal check
Warning: The following warnings are likely to affect your build negatively:
Warning: For packages using 'cabal-version: >= 1.10' the 'extensions' field is deprecated. The new 'default-extensions' field lists extensions that are used in all modules in the component, while the 'other-extensions' field lists extensions that are used in some modules, e.g. via the {-# LANGUAGE #-} pragma.
Warning: These warnings may cause trouble when distributing the package:
Warning: pkg.cabal:14:3: The field "extensions" is deprecated in the Cabal specification version 1.12. Please use 'default-extensions' or 'other-extensions' fields.
Warning: Hackage would reject this package.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Test.Cabal.Prelude

-- `extensions` deprecated.
main = cabalTest $
fails $ cabal "check" []
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
cabal-version: 1.12
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
extensions: ScopedTypeVariables
default-language: Haskell2010
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# cabal check
Warning: The following errors will cause portability problems on other environments:
Warning: To use the 'extra-doc-files' field the package needs to specify 'cabal-version: 1.18' or higher.
Warning: Hackage would reject this package.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Test.Cabal.Prelude

-- `extra-doc-files` need ≥1.18.
main = cabalTest $
fails $ cabal "check" []
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
cabal-version: >= 1.10
build-type: Simple
name: pkg
synopsis: synopsis
description: description
version: 0
category: example
maintainer: none@example.com
license: GPL-3
license-file: LICENSE
extra-doc-files: docs

test-suite test
main-is: Main.hs
type: exitcode-stdio-1.0
default-language: Haskell2010
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# cabal check
Warning: These warnings may cause trouble when distributing the package:
Warning: pkg.cabal:14:3: The field "extra-dynamic-library-flavours" is available only since the Cabal specification version 3.0. This field will be ignored.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Test.Cabal.Prelude

-- `extra-dynamic-library-flavour` need ≥3.0.
main = cabalTest $
fails $ cabal "check" []
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
cabal-version: 1.12
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
extra-dynamic-library-flavours: asm
default-language: Haskell2010
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# cabal check
Warning: These warnings may cause trouble when distributing the package:
Warning: To use the 'extra-framework-dirs' field the package needs to specify 'cabal-version: 1.24' or higher.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Test.Cabal.Prelude

-- `extra-framework-dirs` need ≥1.24. (just warning)
main = cabalTest $
cabal "check" []
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
cabal-version: >= 1.10
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
default-language: Haskell98
extra-framework-dirs: dir
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# cabal check
Warning: These warnings may cause trouble when distributing the package:
Warning: pkg.cabal:15:3: The field "mixins" is available only since the Cabal specification version 2.0. This field will be ignored.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Test.Cabal.Prelude

-- `mixins` need ≥2.0.
main = cabalTest $
fails $ cabal "check" []
Loading