diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2018-09-11 16:06:15 -0400 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-09-11 16:06:40 -0400 |
commit | 8d95d5607fdd829d4b77c5225fd6b9015b1df034 (patch) | |
tree | 0102dcf95b0ce7b4a3c3164bbb5524f817d6fa5f | |
parent | 4adac26b6f214ccd0adab99c0ac72ab84bd77935 (diff) | |
download | luarocks-8d95d5607fdd829d4b77c5225fd6b9015b1df034.tar.gz luarocks-8d95d5607fdd829d4b77c5225fd6b9015b1df034.tar.bz2 luarocks-8d95d5607fdd829d4b77c5225fd6b9015b1df034.zip |
Tests: add regression test for luarocks.loader startup
-rw-r--r-- | spec/loader_spec.lua | 10 | ||||
-rw-r--r-- | spec/util/test_env.lua | 6 |
2 files changed, 15 insertions, 1 deletions
diff --git a/spec/loader_spec.lua b/spec/loader_spec.lua new file mode 100644 index 00000000..0f946b72 --- /dev/null +++ b/spec/loader_spec.lua | |||
@@ -0,0 +1,10 @@ | |||
1 | local test_env = require("spec.util.test_env") | ||
2 | local run = test_env.run | ||
3 | |||
4 | describe("luarocks.loader", function() | ||
5 | describe("#unit", function() | ||
6 | it("starts", function() | ||
7 | assert(run.lua_bool([[-e "require 'luarocks.loader'; print(package.loaded['luarocks.loaded'])"]])) | ||
8 | end) | ||
9 | end) | ||
10 | end) | ||
diff --git a/spec/util/test_env.lua b/spec/util/test_env.lua index 181f4693..f4cd3f60 100644 --- a/spec/util/test_env.lua +++ b/spec/util/test_env.lua | |||
@@ -473,7 +473,9 @@ local function make_run_function(cmd_name, exec_function, with_coverage, do_prin | |||
473 | cmd_prefix = cmd_prefix .. "-e \"require('luacov.runner')('" .. test_env.testing_paths.testrun_dir .. "/luacov.config')\" " | 473 | cmd_prefix = cmd_prefix .. "-e \"require('luacov.runner')('" .. test_env.testing_paths.testrun_dir .. "/luacov.config')\" " |
474 | end | 474 | end |
475 | 475 | ||
476 | cmd_prefix = cmd_prefix .. test_env.testing_paths.src_dir .. "/bin/" .. cmd_name .. " " | 476 | if cmd_name then |
477 | cmd_prefix = cmd_prefix .. test_env.testing_paths.src_dir .. "/bin/" .. cmd_name .. " " | ||
478 | end | ||
477 | 479 | ||
478 | return function(cmd, new_vars) | 480 | return function(cmd, new_vars) |
479 | local temp_vars = {} | 481 | local temp_vars = {} |
@@ -491,6 +493,8 @@ end | |||
491 | 493 | ||
492 | local function make_run_functions() | 494 | local function make_run_functions() |
493 | return { | 495 | return { |
496 | lua = make_run_function(nil, execute_output, true, true), | ||
497 | lua_bool = make_run_function(nil, execute_bool, true, true), | ||
494 | luarocks = make_run_function("luarocks", execute_output, true, true), | 498 | luarocks = make_run_function("luarocks", execute_output, true, true), |
495 | luarocks_bool = make_run_function("luarocks", execute_bool, true, true), | 499 | luarocks_bool = make_run_function("luarocks", execute_bool, true, true), |
496 | luarocks_noprint = make_run_function("luarocks", execute_bool, true, false), | 500 | luarocks_noprint = make_run_function("luarocks", execute_bool, true, false), |