summaryrefslogtreecommitdiff
path: root/test/withrepo.lua
blob: bf90b0c17b3a31aeb9936054dec883d18a07d22f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
-- test/withrepo.lua
--
-- Gall -- Test utilities for when you have repositories
--

local _xpcall = xpcall

function xpcall(fn, tb)
   os.execute("rm -rf test/test_repo")
   local ok, msg = _xpcall(fn, tb)
   os.execute("rm -rf test/test_repo")
   return ok, msg
end

function test_repo()
   os.execute("sh test/create_test_repo.sh")
   return assert(require("gall.repository").new "test/test_repo")
end