aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2016-08-23 13:23:25 -0300
committerGitHub <noreply@github.com>2016-08-23 13:23:25 -0300
commit9907ae567205777873e47b74c44d163367860d52 (patch)
tree09626863e8556a9803013a33ae3a5cef66cff258
parent4c837a0c953f0dd83485d65979893c3c773eb1ba (diff)
parent00c12a63ed41c1506b84d5682d8c457c40ae8872 (diff)
downloadluarocks-9907ae567205777873e47b74c44d163367860d52.tar.gz
luarocks-9907ae567205777873e47b74c44d163367860d52.tar.bz2
luarocks-9907ae567205777873e47b74c44d163367860d52.zip
Merge pull request #608 from keplerproject/mingw
Run Windows tests with MinGW
-rw-r--r--appveyor.yml21
-rw-r--r--src/luarocks/cfg.lua1
-rw-r--r--test/test_environment.lua11
3 files changed, 26 insertions, 7 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/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 ab6c3edd..00213d31 100644
--- a/test/test_environment.lua
+++ b/test/test_environment.lua
@@ -172,6 +172,10 @@ function test_env.set_args()
172 test_env.OPENSSL_DIRS = "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"
173 elseif argument:find("^os=") then 173 elseif argument:find("^os=") then
174 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
175 else 179 else
176 help() 180 help()
177 end 181 end
@@ -630,11 +634,8 @@ local function install_luarocks(install_env_vars)
630 local testing_paths = test_env.testing_paths 634 local testing_paths = test_env.testing_paths
631 title("Installing LuaRocks") 635 title("Installing LuaRocks")
632 if test_env.TEST_TARGET_OS == "windows" then 636 if test_env.TEST_TARGET_OS == "windows" then
633 if test_env.LUA_V then 637 local compiler_flag = test_env.MINGW and "/MW" or ""
634 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))
635 else
636 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))
637 end
638 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"))
639 else 640 else
640 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