aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHisham <hisham@gobolinux.org>2016-08-23 16:00:30 -0300
committerHisham <hisham@gobolinux.org>2016-08-23 16:00:30 -0300
commit311d2ea373d01a71ad12d31bc250d8e6f6f6c3f8 (patch)
tree07e03292d726a0fb4cfb17eb2c0446efc4d5e7ff
parent0e6b922d2618fc90195299e2f944110c4ffe5600 (diff)
parent9907ae567205777873e47b74c44d163367860d52 (diff)
downloadluarocks-311d2ea373d01a71ad12d31bc250d8e6f6f6c3f8.tar.gz
luarocks-311d2ea373d01a71ad12d31bc250d8e6f6f6c3f8.tar.bz2
luarocks-311d2ea373d01a71ad12d31bc250d8e6f6f6c3f8.zip
Merge branch 'master' of https://github.com/keplerproject/luarocks
-rw-r--r--appveyor.yml21
-rw-r--r--install.bat59
-rw-r--r--spec/build_spec.lua18
-rw-r--r--spec/install_spec.lua12
-rw-r--r--spec/pack_spec.lua6
-rw-r--r--spec/upload_spec.lua12
-rw-r--r--src/luarocks/cfg.lua1
-rw-r--r--test/test_environment.lua14
8 files changed, 47 insertions, 96 deletions
diff --git a/appveyor.yml b/appveyor.yml
index 66a12896..1d29b18d 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -7,28 +7,45 @@ environment:
7 7
8 matrix: 8 matrix:
9 - LUA: "lua 5.1" 9 - LUA: "lua 5.1"
10 COMPILER: "vs"
11 - LUA: "lua 5.1"
12 COMPILER: "mingw"
13 - LUA: "lua 5.2"
14 COMPILER: "vs"
10 - LUA: "lua 5.2" 15 - LUA: "lua 5.2"
16 COMPILER: "mingw"
17 - LUA: "lua 5.3"
18 COMPILER: "vs"
11 - LUA: "lua 5.3" 19 - LUA: "lua 5.3"
20 COMPILER: "mingw"
12 - LUA: "luajit 2.0" 21 - LUA: "luajit 2.0"
22 COMPILER: "vs"
23 - LUA: "luajit 2.0"
24 COMPILER: "mingw"
25 - LUA: "luajit 2.1"
26 COMPILER: "vs"
13 - LUA: "luajit 2.1" 27 - LUA: "luajit 2.1"
28 COMPILER: "mingw"
14 29
15 30
16init: 31init:
17# Setup Lua development/build environment 32# Setup Lua development/build environment
18# Make VS 2015 command line tools available 33# Make VS 2015 command line tools available
19- call "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %platform% 34- call "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %platform%
35# Add MinGW compiler to the path
36- set PATH=C:\MinGW\bin;%PATH%
20 37
21before_build: 38before_build:
22 - set PATH=C:\Python27\Scripts;%PATH% # Add directory containing 'pip' to PATH 39 - set PATH=C:\Python27\Scripts;%PATH% # Add directory containing 'pip' to PATH
23 - pip install hererocks 40 - pip install hererocks
24 - hererocks env --%LUA% -rlatest 41 - hererocks env --%LUA% -rlatest --target=%COMPILER%
25 - call env\bin\activate 42 - call env\bin\activate
26 43
27build_script: 44build_script:
28 - luarocks install busted 1> NUL 2> NUL 45 - luarocks install busted 1> NUL 2> NUL
29 46
30test_script: 47test_script:
31 - busted --lpath=.//?.lua --exclude-tags=ssh,unix,mock -Xhelper appveyor 48 - busted --lpath=.//?.lua --exclude-tags=ssh,unix,mock -Xhelper appveyor,%COMPILER%
32 49
33after_test: 50after_test:
34 - if "%LUA%"=="lua 5.1" (luarocks show bit32 || luarocks install bit32) 51 - if "%LUA%"=="lua 5.1" (luarocks show bit32 || luarocks install bit32)
diff --git a/install.bat b/install.bat
index e28734dc..cfa080e5 100644
--- a/install.bat
+++ b/install.bat
@@ -24,10 +24,6 @@ vars.LUA_LIBDIR = nil
24vars.LUA_LIBNAME = nil 24vars.LUA_LIBNAME = nil
25vars.LUA_VERSION = "5.1" 25vars.LUA_VERSION = "5.1"
26vars.LUA_SHORTV = nil -- "51" 26vars.LUA_SHORTV = nil -- "51"
27-- MinGW does not generate .lib, nor needs it to link, but MSVC does
28-- so .lib must be listed first to ensure they are found first if present.
29-- To prevent MSVC trying to link to a .dll, which won't work.
30vars.LUA_LIB_NAMES = "lua5.1.lib lua51.lib lua5.1.dll lua51.dll liblua.dll.a"
31vars.LUA_RUNTIME = nil 27vars.LUA_RUNTIME = nil
32vars.UNAME_M = nil 28vars.UNAME_M = nil
33vars.COMPILER_ENV_CMD = nil 29vars.COMPILER_ENV_CMD = nil
@@ -57,32 +53,6 @@ local function die(message)
57 os.exit(1) 53 os.exit(1)
58end 54end
59 55
60local function split_string(str, delim, maxNb)
61 -- Eliminate bad cases...
62 if string.find(str, delim) == nil then
63 return { str }
64 end
65 if maxNb == nil or maxNb < 1 then
66 maxNb = 0 -- No limit
67 end
68 local result = {}
69 local pat = "(.-)" .. delim .. "()"
70 local nb = 0
71 local lastPos
72 for part, pos in string.gmatch(str, pat) do
73 nb = nb + 1
74 result[nb] = part
75 lastPos = pos
76 if nb == maxNb then break end
77 end
78 -- Handle the last field
79 if nb ~= maxNb then
80 result[nb + 1] = string.sub(str, lastPos)
81 end
82 return result
83end
84
85
86local function exec(cmd) 56local function exec(cmd)
87 --print(cmd) 57 --print(cmd)
88 local status = os.execute("type NUL && "..cmd) 58 local status = os.execute("type NUL && "..cmd)
@@ -273,14 +243,8 @@ local function check_flags()
273 die("Bundled Lua version is 5.1, cannot install "..vars.LUA_VERSION) 243 die("Bundled Lua version is 5.1, cannot install "..vars.LUA_VERSION)
274 end 244 end
275 end 245 end
276 if vars.LUA_VERSION ~= "5.1" then 246 if not vars.LUA_VERSION:match("^5%.[123]$") then
277 if vars.LUA_VERSION == "5.2" then 247 die("Bad argument: /LV must either be 5.1, 5.2, or 5.3")
278 vars.LUA_LIB_NAMES = vars.LUA_LIB_NAMES:gsub("5([%.]?)1", "5%12")
279 elseif vars.LUA_VERSION == "5.3" then
280 vars.LUA_LIB_NAMES = vars.LUA_LIB_NAMES:gsub("5([%.]?)1", "5%13")
281 else
282 die("Bad argument: /LV must either be 5.1, 5.2, or 5.3")
283 end
284 end 248 end
285 if USE_MSVC_MANUAL and USE_MINGW then 249 if USE_MSVC_MANUAL and USE_MINGW then
286 die("Cannot combine option /MSVC and /MW") 250 die("Cannot combine option /MSVC and /MW")
@@ -339,7 +303,6 @@ local function look_for_interpreter(directory)
339 else 303 else
340 vars.LUA_VERSION = version 304 vars.LUA_VERSION = version
341 vars.LUA_SHORTV = version:gsub("%.", "") 305 vars.LUA_SHORTV = version:gsub("%.", "")
342 vars.LUA_LIB_NAMES = vars.LUA_LIB_NAMES:gsub("5([%.]?)[123]", "5%1" .. version:sub(-1))
343 end 306 end
344 end 307 end
345 308
@@ -358,6 +321,10 @@ local function look_for_interpreter(directory)
358end 321end
359 322
360local function look_for_link_libraries(directory) 323local function look_for_link_libraries(directory)
324 -- MinGW does not generate .lib, nor needs it to link, but MSVC does,
325 -- so .lib must be listed first to ensure they are found first if present,
326 -- to prevent MSVC trying to link to a .dll, which won't work.
327 local names = {S"lua$LUA_VERSION.lib", S"lua$LUA_SHORTV.lib", S"lua$LUA_VERSION.dll", S"lua$LUA_SHORTV.dll", "liblua.dll.a"}
361 local directories 328 local directories
362 if vars.LUA_LIBDIR then 329 if vars.LUA_LIBDIR then
363 directories = {vars.LUA_LIBDIR} 330 directories = {vars.LUA_LIBDIR}
@@ -366,7 +333,7 @@ local function look_for_link_libraries(directory)
366 end 333 end
367 334
368 for _, dir in ipairs(directories) do 335 for _, dir in ipairs(directories) do
369 for name in vars.LUA_LIB_NAMES:gmatch("[^%s]+") do 336 for _, name in ipairs(names) do
370 local full_name = dir .. "\\" .. name 337 local full_name = dir .. "\\" .. name
371 print(" checking for " .. full_name) 338 print(" checking for " .. full_name)
372 if exists(full_name) then 339 if exists(full_name) then
@@ -379,7 +346,7 @@ local function look_for_link_libraries(directory)
379 end 346 end
380 347
381 if vars.LUA_LIBDIR then 348 if vars.LUA_LIBDIR then
382 die(S"link library (one of; $LUA_LIB_NAMES) not found in $LUA_LIBDIR") 349 die(("Link library (one of %s) not found in %s"):format(table.concat(names, ", "), vars.LUA_LIBDIR))
383 end 350 end
384 return false 351 return false
385end 352end
@@ -574,16 +541,15 @@ local function get_possible_lua_directories()
574 541
575 -- No prefix given, so use PATH. 542 -- No prefix given, so use PATH.
576 local path = os.getenv("PATH") or "" 543 local path = os.getenv("PATH") or ""
577 path = path:gsub(";+", ";") -- Remove duplicates. 544 local directories = {}
578 local directories = split_string(path, ";") 545 for dir in path:gmatch("[^;]+") do
579 for i, dir in ipairs(directories) do
580 -- Remove trailing backslashes, but not from a drive letter like `C:\`. 546 -- Remove trailing backslashes, but not from a drive letter like `C:\`.
581 dir = dir:gsub("([^:])\\+$", "%1") 547 dir = dir:gsub("([^:])\\+$", "%1")
582 -- Remove trailing `bin` subdirectory, the searcher will check there anyway. 548 -- Remove trailing `bin` subdirectory, the searcher will check there anyway.
583 if dir:upper():match("[:\\]BIN$") then 549 if dir:upper():match("[:\\]BIN$") then
584 dir = dir:sub(1, -5) 550 dir = dir:sub(1, -5)
585 end 551 end
586 directories[i] = dir 552 table.insert(directories, dir)
587 end 553 end
588 -- Finally add some other default paths. 554 -- Finally add some other default paths.
589 table.insert(directories, [[c:\lua5.1.2]]) 555 table.insert(directories, [[c:\lua5.1.2]])
@@ -763,9 +729,6 @@ vars.INCDIR = S"$PREFIX\\include"
763vars.LUA_SHORTV = vars.LUA_VERSION:gsub("%.", "") 729vars.LUA_SHORTV = vars.LUA_VERSION:gsub("%.", "")
764 730
765if INSTALL_LUA then 731if INSTALL_LUA then
766 if vars.LUA_VERSION ~= "5.1" then
767 die("Cannot install own copy of Lua because only 5.1 is bundled")
768 end
769 vars.LUA_INTERPRETER = "lua5.1" 732 vars.LUA_INTERPRETER = "lua5.1"
770 vars.LUA_BINDIR = vars.BINDIR 733 vars.LUA_BINDIR = vars.BINDIR
771 vars.LUA_LIBDIR = vars.LIBDIR 734 vars.LUA_LIBDIR = vars.LIBDIR
diff --git a/spec/build_spec.lua b/spec/build_spec.lua
index b4f838ca..8f08f0a0 100644
--- a/spec/build_spec.lua
+++ b/spec/build_spec.lua
@@ -120,11 +120,7 @@ describe("LuaRocks build tests #blackbox #b_build", function()
120 end) 120 end)
121 121
122 it("LuaRocks build luasec with skipping dependency checks", function() 122 it("LuaRocks build luasec with skipping dependency checks", function()
123 if test_env.APPVEYOR then 123 assert.is_true(run.luarocks_bool("build luasec " .. test_env.OPENSSL_DIRS .. " --nodeps"))
124 assert.is_true(run.luarocks_bool("build luasec " .. test_env.APPVEYOR_OPENSSL .. " --nodeps"))
125 else
126 assert.is_true(run.luarocks_bool("build luasec --nodeps"))
127 end
128 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/luasec/0.6-1/luasec-0.6-1.rockspec")) 124 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/luasec/0.6-1/luasec-0.6-1.rockspec"))
129 end) 125 end)
130 126
@@ -150,11 +146,7 @@ describe("LuaRocks build tests #blackbox #b_build", function()
150 end 146 end
151 147
152 it("LuaRocks build luasec only deps", function() 148 it("LuaRocks build luasec only deps", function()
153 if test_env.APPVEYOR then 149 assert.is_true(run.luarocks_bool(test_env.quiet("build luasec " .. test_env.OPENSSL_DIRS .. " --only-deps")))
154 assert.is_true(run.luarocks_bool(test_env.quiet("build luasec " .. test_env.APPVEYOR_OPENSSL .. " --only-deps")))
155 else
156 assert.is_true(run.luarocks_bool(test_env.quiet("build luasec --only-deps")))
157 end
158 assert.is_false(run.luarocks_bool("show luasec")) 150 assert.is_false(run.luarocks_bool("show luasec"))
159 assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/luasec/0.6-1/luasec-0.6-1.rockspec")) 151 assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/luasec/0.6-1/luasec-0.6-1.rockspec"))
160 end) 152 end)
@@ -189,12 +181,8 @@ describe("LuaRocks build tests #blackbox #b_build", function()
189 181
190 it("LuaRocks build with https", function() 182 it("LuaRocks build with https", function()
191 assert.is_true(run.luarocks_bool("download --rockspec validate-args 1.5.4-1")) 183 assert.is_true(run.luarocks_bool("download --rockspec validate-args 1.5.4-1"))
184 assert.is_true(run.luarocks_bool(test_env.quiet("install luasec " .. test_env.OPENSSL_DIRS)))
192 185
193 if test_env.APPVEYOR then
194 assert.is_true(run.luarocks_bool(test_env.quiet("install luasec " .. test_env.APPVEYOR_OPENSSL)))
195 else
196 assert.is_true(run.luarocks_bool(test_env.quiet("install luasec")))
197 end
198 assert.is_true(run.luarocks_bool("build validate-args-1.5.4-1.rockspec")) 186 assert.is_true(run.luarocks_bool("build validate-args-1.5.4-1.rockspec"))
199 assert.is.truthy(run.luarocks("show validate-args")) 187 assert.is.truthy(run.luarocks("show validate-args"))
200 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/validate-args/1.5.4-1/validate-args-1.5.4-1.rockspec")) 188 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/validate-args/1.5.4-1/validate-args-1.5.4-1.rockspec"))
diff --git a/spec/install_spec.lua b/spec/install_spec.lua
index 2b6cb77f..e5b9e2cc 100644
--- a/spec/install_spec.lua
+++ b/spec/install_spec.lua
@@ -66,22 +66,14 @@ describe("LuaRocks install tests #blackbox #b_install", function()
66 end) 66 end)
67 67
68 it("LuaRocks install luasec and show luasocket (dependency)", function() 68 it("LuaRocks install luasec and show luasocket (dependency)", function()
69 if test_env.APPVEYOR then 69 assert.is_true(run.luarocks_bool(test_env.quiet("install luasec " .. test_env.OPENSSL_DIRS)))
70 assert.is_true(run.luarocks_bool(test_env.quiet("install luasec " .. test_env.APPVEYOR_OPENSSL)))
71 else
72 assert.is_true(run.luarocks_bool(test_env.quiet("install luasec")))
73 end
74 assert.is_true(run.luarocks_bool("show luasocket")) 70 assert.is_true(run.luarocks_bool("show luasocket"))
75 end) 71 end)
76 end) 72 end)
77 73
78 describe("LuaRocks install - more complex tests", function() 74 describe("LuaRocks install - more complex tests", function()
79 it('LuaRocks install luasec with skipping dependency checks', function() 75 it('LuaRocks install luasec with skipping dependency checks', function()
80 if test_env.APPVEYOR then 76 assert.is_true(run.luarocks_bool(test_env.quiet("install luasec " .. test_env.OPENSSL_DIRS .. " --nodeps")))
81 assert.is_true(run.luarocks_bool(test_env.quiet("install luasec " .. test_env.APPVEYOR_OPENSSL .. " --nodeps")))
82 else
83 assert.is_true(run.luarocks_bool(test_env.quiet("install luasec --nodeps")))
84 end
85 assert.is_true(run.luarocks_bool(test_env.quiet("show luasec"))) 77 assert.is_true(run.luarocks_bool(test_env.quiet("show luasec")))
86 if env_variables.TYPE_TEST_ENV == "minimal" then 78 if env_variables.TYPE_TEST_ENV == "minimal" then
87 assert.is_false(run.luarocks_bool(test_env.quiet("show luasocket"))) 79 assert.is_false(run.luarocks_bool(test_env.quiet("show luasocket")))
diff --git a/spec/pack_spec.lua b/spec/pack_spec.lua
index 21f33b02..3191e80c 100644
--- a/spec/pack_spec.lua
+++ b/spec/pack_spec.lua
@@ -49,11 +49,7 @@ describe("LuaRocks pack tests #blackbox #b_pack", function()
49 end) 49 end)
50 50
51 it("LuaRocks pack src", function() 51 it("LuaRocks pack src", function()
52 if test_env.APPVEYOR then 52 assert.is_true(run.luarocks_bool(test_env.quiet("install luasec " .. test_env.OPENSSL_DIRS)))
53 assert.is_true(run.luarocks_bool(test_env.quiet("install luasec " .. test_env.APPVEYOR_OPENSSL)))
54 else
55 assert.is_true(run.luarocks_bool(test_env.quiet("install luasec")))
56 end
57 assert.is_true(run.luarocks_bool("download --rockspec luasocket 3.0rc1-2")) 53 assert.is_true(run.luarocks_bool("download --rockspec luasocket 3.0rc1-2"))
58 assert.is_true(run.luarocks_bool("pack luasocket-3.0rc1-2.rockspec")) 54 assert.is_true(run.luarocks_bool("pack luasocket-3.0rc1-2.rockspec"))
59 assert.is_true(test_env.remove_files(lfs.currentdir(), "luasocket-")) 55 assert.is_true(test_env.remove_files(lfs.currentdir(), "luasocket-"))
diff --git a/spec/upload_spec.lua b/spec/upload_spec.lua
index af4c36d3..ff39cb96 100644
--- a/spec/upload_spec.lua
+++ b/spec/upload_spec.lua
@@ -63,18 +63,10 @@ describe("LuaRocks upload tests #blackbox #b_upload", function()
63 end) 63 end)
64 64
65 it("LuaRocks upload rockspec with api-key", function() 65 it("LuaRocks upload rockspec with api-key", function()
66 if test_env.APPVEYOR then 66 assert.is_true(run.luarocks_bool("upload " .. testing_paths.testing_server .. "/luasocket-3.0rc1-2.rockspec " .. test_env.OPENSSL_DIRS .. " --api-key=123", {LUAROCKS_CONFIG = testing_paths.testing_dir .. "/luarocks_site.lua"}))
67 assert.is_true(run.luarocks_bool("upload " .. testing_paths.testing_server .. "/luasocket-3.0rc1-2.rockspec " .. test_env.APPVEYOR_OPENSSL .. " --api-key=123", {LUAROCKS_CONFIG = testing_paths.testing_dir .. "/luarocks_site.lua"}))
68 else
69 assert.is_true(run.luarocks_bool("upload " .. testing_paths.testing_server .. "/luasocket-3.0rc1-2.rockspec --api-key=123", {LUAROCKS_CONFIG = testing_paths.testing_dir .. "/luarocks_site.lua"}))
70 end
71 end) 67 end)
72 it("LuaRocks upload rockspec with api-key and skip-pack", function() 68 it("LuaRocks upload rockspec with api-key and skip-pack", function()
73 if test_env.APPVEYOR then 69 assert.is_true(run.luarocks_bool("upload --skip-pack " .. testing_paths.testing_server .. "/luasocket-3.0rc1-2.rockspec " .. test_env.OPENSSL_DIRS .. " --api-key=123", {LUAROCKS_CONFIG = testing_paths.testing_dir .. "/luarocks_site.lua"}))
74 assert.is_true(run.luarocks_bool("upload --skip-pack " .. testing_paths.testing_server .. "/luasocket-3.0rc1-2.rockspec " .. test_env.APPVEYOR_OPENSSL .. " --api-key=123", {LUAROCKS_CONFIG = testing_paths.testing_dir .. "/luarocks_site.lua"}))
75 else
76 assert.is_true(run.luarocks_bool("upload --skip-pack " .. testing_paths.testing_server .. "/luasocket-3.0rc1-2.rockspec --api-key=123", {LUAROCKS_CONFIG = testing_paths.testing_dir .. "/luarocks_site.lua"}))
77 end
78 end) 70 end)
79 end) 71 end)
80end) 72end)
diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua
index d84ebc6e..bcb30342 100644
--- a/src/luarocks/cfg.lua
+++ b/src/luarocks/cfg.lua
@@ -468,6 +468,7 @@ if cfg.platforms.mingw32 then
468 defaults.variables.LD = "mingw32-gcc" 468 defaults.variables.LD = "mingw32-gcc"
469 defaults.variables.CFLAGS = "-O2" 469 defaults.variables.CFLAGS = "-O2"
470 defaults.variables.LIBFLAG = "-shared" 470 defaults.variables.LIBFLAG = "-shared"
471 defaults.makefile = "Makefile"
471 defaults.external_deps_patterns = { 472 defaults.external_deps_patterns = {
472 bin = { "?.exe", "?.bat" }, 473 bin = { "?.exe", "?.bat" },
473 -- mingw lookup list from http://stackoverflow.com/a/15853231/1793220 474 -- mingw lookup list from http://stackoverflow.com/a/15853231/1793220
diff --git a/test/test_environment.lua b/test/test_environment.lua
index 37bd38f1..00213d31 100644
--- a/test/test_environment.lua
+++ b/test/test_environment.lua
@@ -153,6 +153,7 @@ end
153function test_env.set_args() 153function test_env.set_args()
154 -- if at least Lua/LuaJIT version argument was found on input start to parse other arguments to env. variables 154 -- if at least Lua/LuaJIT version argument was found on input start to parse other arguments to env. variables
155 test_env.TYPE_TEST_ENV = "minimal" 155 test_env.TYPE_TEST_ENV = "minimal"
156 test_env.OPENSSL_DIRS = ""
156 test_env.RESET_ENV = true 157 test_env.RESET_ENV = true
157 158
158 for _, argument in ipairs(arg) do 159 for _, argument in ipairs(arg) do
@@ -168,9 +169,13 @@ function test_env.set_args()
168 test_env.TRAVIS = true 169 test_env.TRAVIS = true
169 elseif argument == "appveyor" then 170 elseif argument == "appveyor" then
170 test_env.APPVEYOR = true 171 test_env.APPVEYOR = true
171 test_env.APPVEYOR_OPENSSL = "OPENSSL_LIBDIR=C:\\OpenSSL-Win32\\lib OPENSSL_INCDIR=C:\\OpenSSL-Win32\\include" 172 test_env.OPENSSL_DIRS = "OPENSSL_LIBDIR=C:\\OpenSSL-Win32\\lib OPENSSL_INCDIR=C:\\OpenSSL-Win32\\include"
172 elseif argument:find("^os=") then 173 elseif argument:find("^os=") then
173 test_env.TEST_TARGET_OS = argument:match("^os=(.*)$") 174 test_env.TEST_TARGET_OS = argument:match("^os=(.*)$")
175 elseif argument == "mingw" then
176 test_env.MINGW = true
177 elseif argument == "vs" then
178 test_env.MINGW = false
174 else 179 else
175 help() 180 help()
176 end 181 end
@@ -629,11 +634,8 @@ local function install_luarocks(install_env_vars)
629 local testing_paths = test_env.testing_paths 634 local testing_paths = test_env.testing_paths
630 title("Installing LuaRocks") 635 title("Installing LuaRocks")
631 if test_env.TEST_TARGET_OS == "windows" then 636 if test_env.TEST_TARGET_OS == "windows" then
632 if test_env.LUA_V then 637 local compiler_flag = test_env.MINGW and "/MW" or ""
633 assert(execute_bool("install.bat /LUA " .. testing_paths.luadir .. " /LV " .. test_env.LUA_V .. " /P " .. testing_paths.testing_lrprefix .. " /NOREG /NOADMIN /F /Q /CONFIG " .. testing_paths.testing_lrprefix .. "/etc/luarocks", false, install_env_vars)) 638 assert(execute_bool("install.bat /LUA " .. testing_paths.luadir .. " " .. compiler_flag .. " /P " .. testing_paths.testing_lrprefix .. " /NOREG /NOADMIN /F /Q /CONFIG " .. testing_paths.testing_lrprefix .. "/etc/luarocks", false, install_env_vars))
634 else
635 assert(execute_bool("install.bat /LUA " .. testing_paths.luadir .. " /P " .. testing_paths.testing_lrprefix .. " /NOREG /NOADMIN /F /Q /CONFIG " .. testing_paths.testing_lrprefix .. "/etc/luarocks", false, install_env_vars))
636 end
637 assert(execute_bool(testing_paths.win_tools .. "/cp " .. testing_paths.testing_lrprefix .. "/lua/luarocks/site_config* " .. testing_paths.src_dir .. "/luarocks/site_config.lua")) 639 assert(execute_bool(testing_paths.win_tools .. "/cp " .. testing_paths.testing_lrprefix .. "/lua/luarocks/site_config* " .. testing_paths.src_dir .. "/luarocks/site_config.lua"))
638 else 640 else
639 local configure_cmd = "./configure --with-lua=" .. testing_paths.luadir .. " --prefix=" .. testing_paths.testing_lrprefix 641 local configure_cmd = "./configure --with-lua=" .. testing_paths.luadir .. " --prefix=" .. testing_paths.testing_lrprefix