From 5f5bbb4ec17f2fcef21e23a04aeb4a992919c074 Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 30 Sep 2018 09:35:51 +0800 Subject: enter the test package directory --- xmake/actions/require/action/test.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/xmake/actions/require/action/test.lua b/xmake/actions/require/action/test.lua index 5b8b40aee..6fec10d5a 100644 --- a/xmake/actions/require/action/test.lua +++ b/xmake/actions/require/action/test.lua @@ -40,6 +40,13 @@ function main(package) -- save the current directory local oldir = os.curdir() + -- enter the test directory + local testdir = path.join(os.tmpdir(), "pkgtest", package:name(), package:version_str() or "lastest") + if not os.isdir(testdir) then + os.mkdir(testdir) + os.cd(testdir) + end + -- test it for i = 1, 3 do local script = scripts[i] @@ -48,6 +55,9 @@ function main(package) end end + -- remove the test directory + os.tryrm(testdir) + -- restore the current directory os.cd(oldir) end -- cgit v1.3.1