c2hs 0.25.1 → 0.25.2
raw patch · 4 files changed
+27/−15 lines, 4 files
Files
- ChangeLog +3/−0
- c2hs.cabal +2/−2
- tests/bugs/issue-25/Issue25.chs +1/−1
- tests/test-bugs.hs +21/−12
ChangeLog view
@@ -1,3 +1,6 @@+0.25.2+ - Test fixes to work with GHC 7.10.1+ 0.25.1 - Marshalling for C bool values [#128]
c2hs.cabal view
@@ -1,5 +1,5 @@ Name: c2hs-Version: 0.25.1+Version: 0.25.2 License: GPL-2 License-File: COPYING Copyright: Copyright (c) 1999-2007 Manuel M T Chakravarty@@ -18,7 +18,7 @@ hsc2hs), this ensures that C functions are imported with the correct Haskell types. Category: Development-Tested-With: GHC==6.12.3, GHC==7.0.4, GHC==7.6.1, GHC==7.6.3, GHC==7.8.3+Tested-With: GHC==6.12.3, GHC==7.0.4, GHC==7.6.1, GHC==7.6.3, GHC==7.8.3, GHC==7.10.1 Cabal-Version: >= 1.8 Build-Type: Simple
tests/bugs/issue-25/Issue25.chs view
@@ -13,5 +13,5 @@ main :: IO () main = do- wcscmp "abc" "def" >>= print+ wcscmp "abc" "def" >>= print . signum wcscat "abc" "def" >>= putStrLn
tests/test-bugs.hs view
@@ -192,7 +192,7 @@ issue95 = build_issue 95 issue93 :: Assertion-issue93 = build_issue 93+issue93 = build_issue_tolerant 93 issue82 :: Assertion issue82 = hs_only_build_issue 82@@ -356,8 +356,8 @@ code <- lastExitCode liftIO $ assertBool "" (code == 0) -do_issue_build :: Bool -> Int -> String -> [Text] -> Sh ()-do_issue_build cbuild n ext c2hsargs =+do_issue_build :: Bool -> Bool -> Int -> String -> [Text] -> Sh ()+do_issue_build strict cbuild n ext c2hsargs = let wdir = "tests/bugs" </> ("issue-" <> show n) lc = "issue" <> show n lcc = lc <> "_c"@@ -368,9 +368,15 @@ mapM_ rm_f [uc <.> "hs", uc <.> "chs.h", uc <.> "chi", lcc <.> "o", uc] run "c2hs" $ c2hsargs ++ [toTextIgnore $ uc <.> "chs"] when cbuild $ cmd cc "-c" "-o" (lcc <.> "o") (lc <.> "c")- if cbuild- then cmd "ghc" "-Wall" "-Werror" "--make" (lcc <.> "o") (uc <.> "hs")- else cmd "ghc" "-Wall" "-Werror" "--make" (uc <.> "hs")+ case (strict, cbuild) of+ (True, True) ->+ cmd "ghc" "-Wall" "-Werror" "--make" (lcc <.> "o") (uc <.> "hs")+ (False, True) ->+ cmd "ghc" "--make" (lcc <.> "o") (uc <.> "hs")+ (True, False) ->+ cmd "ghc" "-Wall" "-Werror" "--make" (uc <.> "hs")+ (False, False) ->+ cmd "ghc" "--make" (uc <.> "hs") expect_issue :: Int -> [Text] -> Assertion expect_issue n expected = expect_issue_with True True n "" [] expected@@ -386,21 +392,24 @@ expect_issue_with :: Bool -> Bool -> Int -> String -> [Text] -> [Text] -> Assertion expect_issue_with ordered cbuild n ext c2hsargs expected = c2hsShelly $ do- do_issue_build cbuild n ext c2hsargs+ do_issue_build True cbuild n ext c2hsargs res <- absPath ("." </> (fromText $ T.pack $ "Issue" <> show n <> (if ext == "" then "" else "_" <> ext))) >>= cmd liftIO $ assertBool "" $ case ordered of True -> T.lines res == expected False -> sort (T.lines res) == sort expected -build_issue_with :: Bool -> Int -> [Text] -> Assertion-build_issue_with cbuild n c2hsargs = c2hsShelly $ do- errExit False $ do_issue_build cbuild n "" c2hsargs+build_issue_with :: Bool -> Bool -> Int -> [Text] -> Assertion+build_issue_with strict cbuild n c2hsargs = c2hsShelly $ do+ errExit False $ do_issue_build strict cbuild n "" c2hsargs code <- lastExitCode liftIO $ assertBool "" (code == 0) build_issue :: Int -> Assertion-build_issue n = build_issue_with True n []+build_issue n = build_issue_with True True n [] +build_issue_tolerant :: Int -> Assertion+build_issue_tolerant n = build_issue_with False True n []+ hs_only_build_issue :: Int -> Assertion-hs_only_build_issue n = build_issue_with False n []+hs_only_build_issue n = build_issue_with True False n []