From a5305f659c159173002b0a2d393021dadc25fc8f Mon Sep 17 00:00:00 2001 From: George Roman Date: Tue, 29 May 2018 12:21:02 +0300 Subject: Add temporary path utility function to test_env --- spec/util/test_env.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/util/test_env.lua b/spec/util/test_env.lua index b3b9bb77..08d5c850 100644 --- a/spec/util/test_env.lua +++ b/spec/util/test_env.lua @@ -88,6 +88,15 @@ function test_env.copy(source, destination) r_destination:close() end +function test_env.get_tmp_path() + local path = os.tmpname() + if test_env.TEST_TARGET_OS == "windows" and not path:find(":") then + path = os.getenv("TEMP") .. path + end + os.remove(path) + return path +end + --- Helper function for execute_bool and execute_output -- @param command string: command to execute -- @param print_command boolean: print command if 'true' -- cgit v1.2.3-55-g6feb