Add test cases that reproduce #7241.
[cabal.git] / cabal-testsuite / PackageTests / CCompilerOverride / setup.test.hs
blob5843cb2b7df4765ef3601736a0d266aa74d40040
1 import Test.Cabal.Prelude
3 -- Test that all the respective defines -DNOERROR... specified in various ways
4 -- all end up routed to the C compiler. Otherwise the C file we depend on will
5 -- not compile.
6 main = setupAndCabalTest $ do
7 skipUnlessGhcVersion ">= 8.8"
8 isWin <- isWindows
9 ghc94 <- isGhcVersion ">= 9.4.1"
10 env <- getTestEnv
11 let pwd = testCurrentDir env
12 win_suffix = if ghc94 then "-clang.bat" else ".bat"
13 customCC =
14 pwd ++ "/custom-cc" ++ if isWin then win_suffix else ""
16 setup "configure"
17 [ "--ghc-option=-DNOERROR1"
18 , "--ghc-option=-optc=-DNOERROR2"
19 , "--ghc-option=-optP=-DNOERROR3"
20 , "--with-gcc=" ++ customCC
22 setup "build" ["-v2"]