Skip to content

Commit

Permalink
added smoke test.
Browse files Browse the repository at this point in the history
  • Loading branch information
sakari committed Feb 25, 2011
1 parent d739a72 commit fa56b7a
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 14 deletions.
19 changes: 15 additions & 4 deletions create_bindings.rb
Expand Up @@ -235,17 +235,28 @@ def fill_cabal(headers)
Author: Sakari Jokinen
Maintainer: sakariij@gmail.com
Build-Type: Simple
Cabal-Version: >=1.2
Cabal-Version: >=1.10
test-suite smoke
default-language: Haskell98
type: exitcode-stdio-1.0
main-is: Main.hs
hs-source-dirs: tests
build-depends:
base >=3,
hlibgit2,
process
extra-libraries: git2
library
default-extensions:
ForeignFunctionInterface
build-depends:
base >= 3 && < 5,
bindings-DSL >= 1.0.7 && < 1.1
bindings-DSL >= 1.0.9 && < 1.1
exposed-modules:
Bindings.Libgit2
#{headers.map{|h| " #{module_name(h)}"}.join("\n")}
extensions:
ForeignFunctionInterface
"""
}
end
Expand Down
10 changes: 0 additions & 10 deletions test/Main.hs

This file was deleted.

15 changes: 15 additions & 0 deletions tests/Main.hs
@@ -0,0 +1,15 @@
module Main where
import Bindings.Libgit2
import Foreign
import Foreign.C.String
import System.Exit
import Control.Monad(when)
import System.Process(system)

main = do
alloca $ \ptr -> do
system "git init smoke.git"
withCString "smoke.git/.git" $ \str -> do
r <- c'git_repository_open ptr str
when (r < 0) $ exitWith (ExitFailure 1)
peek ptr >>= c'git_repository_free

0 comments on commit fa56b7a

Please sign in to comment.