diff options
author | Pierre Chapuis <git@catwell.info> | 2022-11-28 15:10:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-28 11:10:41 -0300 |
commit | 5143d1b978501e3b16a6abe7fdfc8160157ae7ef (patch) | |
tree | 40bed07979aff4c6dfbd54e0452b700ad8117d1f | |
parent | 1ca5337b3ab3afaaa928a06c25f27e04e6c8091e (diff) | |
download | luarocks-5143d1b978501e3b16a6abe7fdfc8160157ae7ef.tar.gz luarocks-5143d1b978501e3b16a6abe7fdfc8160157ae7ef.tar.bz2 luarocks-5143d1b978501e3b16a6abe7fdfc8160157ae7ef.zip |
fix `test --prepare` with non-busted rocks (#1453)
* fix `test --prepare` with non-busted rocks
-rw-r--r-- | spec/test_spec.lua | 9 | ||||
-rw-r--r-- | src/luarocks/test.lua | 6 |
2 files changed, 14 insertions, 1 deletions
diff --git a/spec/test_spec.lua b/spec/test_spec.lua index 33643097..4be0567f 100644 --- a/spec/test_spec.lua +++ b/spec/test_spec.lua | |||
@@ -98,6 +98,15 @@ describe("luarocks test #integration", function() | |||
98 | 98 | ||
99 | end) | 99 | end) |
100 | end) | 100 | end) |
101 | |||
102 | describe("command backend", function() | ||
103 | describe("prepare", function() | ||
104 | it("works with non-busted rocks", function() | ||
105 | write_file("test.lua", "", finally) | ||
106 | assert.is_true(run.luarocks_bool("test --prepare " .. testing_paths.fixtures_dir .. "/a_rock-1.0-1.rockspec")) | ||
107 | end) | ||
108 | end) | ||
109 | end) | ||
101 | end) | 110 | end) |
102 | 111 | ||
103 | test_env.unload_luarocks() | 112 | test_env.unload_luarocks() |
diff --git a/src/luarocks/test.lua b/src/luarocks/test.lua index 2a836671..d074b950 100644 --- a/src/luarocks/test.lua +++ b/src/luarocks/test.lua | |||
@@ -77,7 +77,11 @@ function test.run_test_suite(rockspec_arg, test_type, args, prepare) | |||
77 | end | 77 | end |
78 | 78 | ||
79 | if prepare then | 79 | if prepare then |
80 | return test_mod.run_tests(rockspec_arg, {"--version"}) | 80 | if test_type == "busted" then |
81 | return test_mod.run_tests(rockspec_arg, {"--version"}) | ||
82 | else | ||
83 | return true | ||
84 | end | ||
81 | else | 85 | else |
82 | local flags = rockspec.test and rockspec.test.flags | 86 | local flags = rockspec.test and rockspec.test.flags |
83 | if type(flags) == "table" then | 87 | if type(flags) == "table" then |