aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPeter Melnichenko <mpeterval@gmail.com>2016-07-08 15:30:31 +0300
committerPeter Melnichenko <mpeterval@gmail.com>2016-07-08 15:30:31 +0300
commite0f97460ba8d212c8336a7ff2ccec61cf0ec983c (patch)
treed12a4bb30c6e7c8586df28661e8ac548991015a5 /test
parent34baafd3d7a7d32bc7a3a4c519071de6355d0351 (diff)
downloadluarocks-e0f97460ba8d212c8336a7ff2ccec61cf0ec983c.tar.gz
luarocks-e0f97460ba8d212c8336a7ff2ccec61cf0ec983c.tar.bz2
luarocks-e0f97460ba8d212c8336a7ff2ccec61cf0ec983c.zip
Tests: remove optional OS argument in hash_environment
Diffstat (limited to 'test')
-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