aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/test_environment.lua22
1 files changed, 8 insertions, 14 deletions
diff --git a/test/test_environment.lua b/test/test_environment.lua
index 9f22e701..372351de 100644
--- a/test/test_environment.lua
+++ b/test/test_environment.lua
@@ -205,22 +205,16 @@ end
205 205
206--- Create md5sum of directory structure recursively, based on filename and size 206--- Create md5sum of directory structure recursively, based on filename and size
207-- @param path string: path to directory for generate md5sum 207-- @param path string: path to directory for generate md5sum
208-- @param testing_os string(optional): version of PC OS
209-- @return md5sum string: md5sum of directory 208-- @return md5sum string: md5sum of directory
210local function hash_environment(path, testing_os) 209local function hash_environment(path)
211 local md5sum = "" 210 if test_env.TEST_TARGET_OS == "linux" then
212 testing_os = testing_os or test_env.TEST_TARGET_OS 211 return execute_output("find " .. path .. " -printf \"%s %p\n\" | md5sum")
213 212 elseif test_env.TEST_TARGET_OS == "osx" then
214 if testing_os == "linux" then 213 return execute_output("find " .. path .. " -type f -exec stat -f \"%z %N\" {} \\; | md5")
215 md5sum = execute_output("find " .. path .. " -printf \"%s %p\n\" | md5sum") 214 else
216 end 215 -- TODO: Windows
217 if testing_os == "osx" then 216 return ""
218 md5sum = execute_output("find " .. path .. " -type f -exec stat -f \"%z %N\" {} \\; | md5")
219 end 217 end
220 --TODO if testing_os == "windows" then
221 -- md5sum = execute_output("find . -printf \"%s %p\n\" | md5sum")
222 -- end
223 return md5sum
224end 218end
225 219
226--- Create environment variables needed for tests 220--- Create environment variables needed for tests