From 5143d1b978501e3b16a6abe7fdfc8160157ae7ef Mon Sep 17 00:00:00 2001 From: Pierre Chapuis Date: Mon, 28 Nov 2022 15:10:41 +0100 Subject: fix `test --prepare` with non-busted rocks (#1453) * fix `test --prepare` with non-busted rocks --- spec/test_spec.lua | 9 +++++++++ src/luarocks/test.lua | 6 +++++- 2 files changed, 14 insertions(+), 1 deletion(-) 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() end) end) + + describe("command backend", function() + describe("prepare", function() + it("works with non-busted rocks", function() + write_file("test.lua", "", finally) + assert.is_true(run.luarocks_bool("test --prepare " .. testing_paths.fixtures_dir .. "/a_rock-1.0-1.rockspec")) + end) + end) + end) end) 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) end if prepare then - return test_mod.run_tests(rockspec_arg, {"--version"}) + if test_type == "busted" then + return test_mod.run_tests(rockspec_arg, {"--version"}) + else + return true + end else local flags = rockspec.test and rockspec.test.flags if type(flags) == "table" then -- cgit v1.2.3-55-g6feb