diff options
author | Hisham <hisham@gobolinux.org> | 2016-08-22 16:01:43 -0300 |
---|---|---|
committer | Hisham <hisham@gobolinux.org> | 2016-08-22 16:01:43 -0300 |
commit | 523af94efbedba37bf62279b88e1334fb64c4924 (patch) | |
tree | 60d935e336bd3cc361ee2afa36c3f6622fb0a83d | |
parent | 84d19752fae29d3b1593b92cb4244478ee9a8b75 (diff) | |
download | luarocks-523af94efbedba37bf62279b88e1334fb64c4924.tar.gz luarocks-523af94efbedba37bf62279b88e1334fb64c4924.tar.bz2 luarocks-523af94efbedba37bf62279b88e1334fb64c4924.zip |
Add support for testing using MinGW
-rw-r--r-- | appveyor.yml | 18 | ||||
-rw-r--r-- | test/test_environment.lua | 11 |
2 files changed, 23 insertions, 6 deletions
diff --git a/appveyor.yml b/appveyor.yml index 66a12896..0220514f 100644 --- a/appveyor.yml +++ b/appveyor.yml | |||
@@ -7,10 +7,25 @@ environment: | |||
7 | 7 | ||
8 | matrix: | 8 | matrix: |
9 | - LUA: "lua 5.1" | 9 | - LUA: "lua 5.1" |
10 | COMPILER: "msvc" | ||
10 | - LUA: "lua 5.2" | 11 | - LUA: "lua 5.2" |
12 | COMPILER: "msvc" | ||
11 | - LUA: "lua 5.3" | 13 | - LUA: "lua 5.3" |
14 | COMPILER: "msvc" | ||
12 | - LUA: "luajit 2.0" | 15 | - LUA: "luajit 2.0" |
16 | COMPILER: "msvc" | ||
13 | - LUA: "luajit 2.1" | 17 | - LUA: "luajit 2.1" |
18 | COMPILER: "msvc" | ||
19 | - LUA: "lua 5.1" | ||
20 | COMPILER: "mingw" | ||
21 | - LUA: "lua 5.2" | ||
22 | COMPILER: "mingw" | ||
23 | - LUA: "lua 5.3" | ||
24 | COMPILER: "mingw" | ||
25 | - LUA: "luajit 2.0" | ||
26 | COMPILER: "mingw" | ||
27 | - LUA: "luajit 2.1" | ||
28 | COMPILER: "mingw" | ||
14 | 29 | ||
15 | 30 | ||
16 | init: | 31 | init: |
@@ -28,7 +43,8 @@ build_script: | |||
28 | - luarocks install busted 1> NUL 2> NUL | 43 | - luarocks install busted 1> NUL 2> NUL |
29 | 44 | ||
30 | test_script: | 45 | test_script: |
31 | - busted --lpath=.//?.lua --exclude-tags=ssh,unix,mock -Xhelper appveyor | 46 | - set PATH=C:\MinGW\bin;%PATH% # Add MinGW compiler to the path |
47 | - busted --lpath=.//?.lua --exclude-tags=ssh,unix,mock -Xhelper appveyor,%COMPILER% | ||
32 | 48 | ||
33 | after_test: | 49 | after_test: |
34 | - if "%LUA%"=="lua 5.1" (luarocks show bit32 || luarocks install bit32) | 50 | - if "%LUA%"=="lua 5.1" (luarocks show bit32 || luarocks install bit32) |
diff --git a/test/test_environment.lua b/test/test_environment.lua index 37bd38f1..f7cdcaa1 100644 --- a/test/test_environment.lua +++ b/test/test_environment.lua | |||
@@ -171,6 +171,10 @@ function test_env.set_args() | |||
171 | test_env.APPVEYOR_OPENSSL = "OPENSSL_LIBDIR=C:\\OpenSSL-Win32\\lib OPENSSL_INCDIR=C:\\OpenSSL-Win32\\include" | 171 | test_env.APPVEYOR_OPENSSL = "OPENSSL_LIBDIR=C:\\OpenSSL-Win32\\lib OPENSSL_INCDIR=C:\\OpenSSL-Win32\\include" |
172 | elseif argument:find("^os=") then | 172 | elseif argument:find("^os=") then |
173 | test_env.TEST_TARGET_OS = argument:match("^os=(.*)$") | 173 | test_env.TEST_TARGET_OS = argument:match("^os=(.*)$") |
174 | elseif argument == "mingw" then | ||
175 | test_env.MINGW = true | ||
176 | elseif argument == "msvc" then | ||
177 | test_env.MINGW = false | ||
174 | else | 178 | else |
175 | help() | 179 | help() |
176 | end | 180 | end |
@@ -629,11 +633,8 @@ local function install_luarocks(install_env_vars) | |||
629 | local testing_paths = test_env.testing_paths | 633 | local testing_paths = test_env.testing_paths |
630 | title("Installing LuaRocks") | 634 | title("Installing LuaRocks") |
631 | if test_env.TEST_TARGET_OS == "windows" then | 635 | if test_env.TEST_TARGET_OS == "windows" then |
632 | if test_env.LUA_V then | 636 | 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)) | 637 | 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")) | 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")) |
638 | else | 639 | else |
639 | local configure_cmd = "./configure --with-lua=" .. testing_paths.luadir .. " --prefix=" .. testing_paths.testing_lrprefix | 640 | local configure_cmd = "./configure --with-lua=" .. testing_paths.luadir .. " --prefix=" .. testing_paths.testing_lrprefix |