diff options
| -rw-r--r-- | test/test_environment.lua | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/test/test_environment.lua b/test/test_environment.lua index 372351de..a3802cc0 100644 --- a/test/test_environment.lua +++ b/test/test_environment.lua | |||
| @@ -421,23 +421,18 @@ function test_env.setup_specs(extra_rocks) | |||
| 421 | end | 421 | end |
| 422 | 422 | ||
| 423 | --- Helper function for tests which needs luasocket installed | 423 | --- Helper function for tests which needs luasocket installed |
| 424 | function test_env.need_luasocket(luarocks_nocov, testing_cache, platform) | 424 | function test_env.need_luasocket() |
| 425 | luarocks_nocov = luarocks_nocov or test_env.run.luarocks_nocov | 425 | if test_env.run.luarocks_nocov("show luasocket") then |
| 426 | testing_cache = testing_cache or test_env.testing_paths.testing_cache | ||
| 427 | platform = platform or test_env.platform | ||
| 428 | |||
| 429 | if luarocks_nocov("show luasocket") then | ||
| 430 | return true | 426 | return true |
| 431 | else | 427 | else |
| 432 | testing_cache = testing_cache .. "/" | 428 | local testing_cache = test_env.testing_paths.testing_cache .. "/" |
| 433 | local luasocket_rock = "luasocket-3.0rc1-1." .. platform .. ".rock" | 429 | local luasocket_rock = "luasocket-3.0rc1-1." .. test_env.platform .. ".rock" |
| 434 | if not os.rename( testing_cache .. luasocket_rock, testing_cache .. luasocket_rock) then | 430 | if not os.rename( testing_cache .. luasocket_rock, testing_cache .. luasocket_rock) then |
| 435 | luarocks_nocov("build --pack-binary-rock luasocket 3.0rc1-1") | 431 | test_env.run.luarocks_nocov("build --pack-binary-rock luasocket 3.0rc1-1") |
| 436 | os.rename(luasocket_rock, testing_cache .. luasocket_rock) | 432 | os.rename(luasocket_rock, testing_cache .. luasocket_rock) |
| 437 | end | 433 | end |
| 438 | luarocks_nocov("install " .. testing_cache .. luasocket_rock) | 434 | return test_env.run.luarocks_nocov("install " .. testing_cache .. luasocket_rock) |
| 439 | end | 435 | end |
| 440 | return true | ||
| 441 | end | 436 | end |
| 442 | 437 | ||
| 443 | --- For each key-value pair in replacements table | 438 | --- For each key-value pair in replacements table |
