summaryrefslogtreecommitdiff
path: root/find-git2
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2017-07-01 11:16:53 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2017-07-01 11:16:53 +0100
commit1f9144c6b95cb8c949a98842dc8d9df64ba94863 (patch)
tree0b426e321867dde68787ef5c06cbcf45982deeac /find-git2
parent1b31bd6c23e4335fff859e1a82acbf97c2b0929f (diff)
downloadgall-1f9144c6b95cb8c949a98842dc8d9df64ba94863.tar.bz2
Blacklist system git2 modules while running tests
In order to run the tests safely, particularly if the git2 C module isn't built due to a missing dep we need to blacklist any system git2 module. This change also requires lua5.2 for the test suite.
Diffstat (limited to 'find-git2')
-rw-r--r--find-git217
1 files changed, 17 insertions, 0 deletions
diff --git a/find-git2 b/find-git2
new file mode 100644
index 0000000..6bdca05
--- /dev/null
+++ b/find-git2
@@ -0,0 +1,17 @@
+-- -*- Lua -*-
+
+-- Our goal is to find git2.so so we can blacklist it for the duration of
+-- tests. This is done by essentially rummaging in the package loaders...
+
+dofile("blacklist-system-git2")
+
+local ffunc, loc = package.searchers[3]('gall.ll.git2')
+
+local locs = {}
+while ffunc ~= nil do
+ locs[#locs+1] = loc
+ package.searchers[3] = __gall_ll_git2_blacklister(package.searchers[3], loc)
+ ffunc, loc = package.searchers[3]('gall.ll.git2')
+end
+
+print(table.concat(locs, ":"))