diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2015-07-16 11:49:13 +0100 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2015-07-16 11:49:13 +0100 |
commit | fed46e8941daae8df4e008a707c1c34ca73284f5 (patch) | |
tree | fb7c56f038d35bef0dbcecffe06e76db28019e01 | |
parent | df4ccaa9eb21ba358b2c09d76114d834128a746e (diff) | |
download | gall-fed46e8941daae8df4e008a707c1c34ca73284f5.tar.gz |
Rewrite test for libgit2 presence slightly
-rw-r--r-- | test/test-gall.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/test-gall.lua b/test/test-gall.lua index 2803751..636339a 100644 --- a/test/test-gall.lua +++ b/test/test-gall.lua @@ -53,9 +53,11 @@ end function suite.test_that_git2_present_if_wanted() local want_git2 = not(os.getenv "GALL_DISABLE_GIT2") - local have_git2 = io.open("lib/gall/ll/git2.so", "r") ~= nil - if want_git2 and have_git2 then - assert(gall.ll.git2) + local have_git2 = pcall(require, "gall.ll.git2") + if want_git2 then + if have_git2 then + assert(gall.ll.git2) + end else assert(not gall.ll.git2) end |