From 80b10b859c5ca03d1380ddf9ddf19c87837e1d14 Mon Sep 17 00:00:00 2001 From: Francesco Ariis Date: Wed, 22 Jun 2022 15:17:05 +0200 Subject: [PATCH] (cabal check) Add "`main-is` C obj" test MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit You need `cabal-version` ≥ 1.18 to use C/C++/obj-C source files in `main-is`. --- .../ConfiguredPackage/Sanity/CMainIsVersion/LICENSE | 0 .../ConfiguredPackage/Sanity/CMainIsVersion/Setup.hs | 0 .../ConfiguredPackage/Sanity/CMainIsVersion/cabal.out | 4 ++++ .../Sanity/CMainIsVersion/cabal.test.hs | 6 ++++++ .../ConfiguredPackage/Sanity/CMainIsVersion/pkg.cabal | 16 ++++++++++++++++ 5 files changed, 26 insertions(+) create mode 100644 cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/CMainIsVersion/LICENSE create mode 100644 cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/CMainIsVersion/Setup.hs create mode 100644 cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/CMainIsVersion/cabal.out create mode 100644 cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/CMainIsVersion/cabal.test.hs create mode 100644 cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/CMainIsVersion/pkg.cabal diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/CMainIsVersion/LICENSE b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/CMainIsVersion/LICENSE new file mode 100644 index 000000000..e69de29bb diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/CMainIsVersion/Setup.hs b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/CMainIsVersion/Setup.hs new file mode 100644 index 000000000..e69de29bb diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/CMainIsVersion/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/CMainIsVersion/cabal.out new file mode 100644 index 000000000..7601cdfe9 --- /dev/null +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/CMainIsVersion/cabal.out @@ -0,0 +1,4 @@ +# cabal check +Warning: The following errors will cause portability problems on other environments: +Warning: The package uses a C/C++/obj-C source file for the 'main-is' field. To use this feature you need to specify 'cabal-version: 1.18' or higher. +Warning: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/CMainIsVersion/cabal.test.hs b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/CMainIsVersion/cabal.test.hs new file mode 100644 index 000000000..9ea2870a5 --- /dev/null +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/CMainIsVersion/cabal.test.hs @@ -0,0 +1,6 @@ +import Test.Cabal.Prelude + +-- You need `cabal-version` ≥ 1.18 to use C/C++/obj-C source files +-- in `main-is`. +main = cabalTest $ + fails $ cabal "check" [] diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/CMainIsVersion/pkg.cabal b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/CMainIsVersion/pkg.cabal new file mode 100644 index 000000000..67c7c77e3 --- /dev/null +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/CMainIsVersion/pkg.cabal @@ -0,0 +1,16 @@ +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 + +custom-setup + +executable exe + main-is: main.c + default-language: Haskell2010 -- 2.11.4.GIT