aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2018-09-11 16:06:15 -0400
committerHisham Muhammad <hisham@gobolinux.org>2018-09-11 16:06:40 -0400
commit8d95d5607fdd829d4b77c5225fd6b9015b1df034 (patch)
tree0102dcf95b0ce7b4a3c3164bbb5524f817d6fa5f
parent4adac26b6f214ccd0adab99c0ac72ab84bd77935 (diff)
downloadluarocks-8d95d5607fdd829d4b77c5225fd6b9015b1df034.tar.gz
luarocks-8d95d5607fdd829d4b77c5225fd6b9015b1df034.tar.bz2
luarocks-8d95d5607fdd829d4b77c5225fd6b9015b1df034.zip
Tests: add regression test for luarocks.loader startup
-rw-r--r--spec/loader_spec.lua10
-rw-r--r--spec/util/test_env.lua6
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 @@
1local test_env = require("spec.util.test_env")
2local run = test_env.run
3
4describe("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)
10end)
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
492local function make_run_functions() 494local 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),