Skip to content

Commit 4586c36

Browse files
DenzellceWolf
authored andcommitted
fix(ctest): omit -R flag when running all tests (#345)
1 parent f34418d commit 4586c36

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

lua/cmake-tools/init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1183,7 +1183,7 @@ function cmake.run_test(opt, callback)
11831183
return
11841184
end
11851185
if idx == 1 then
1186-
ctest.run(const.ctest_command, "'.*'", config:build_directory_path(), env, config, opt)
1186+
ctest.run(const.ctest_command, nil, config:build_directory_path(), env, config, opt)
11871187
else
11881188
ctest.run(
11891189
const.ctest_command,

lua/cmake-tools/test/ctest.lua

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,14 @@ function ctest.run(ctest_command, test_name, build_dir, env, config, opt)
3838
local cmd = ctest_command
3939
opt = opt or {}
4040

41-
local args = { "--test-dir", utils.transform_path(build_dir), "-R", test_name, opt.args }
41+
local args = { "--test-dir", utils.transform_path(build_dir) }
42+
if test_name then
43+
table.insert(args, "-R")
44+
table.insert(args, test_name)
45+
end
46+
if opt.args then
47+
table.insert(args, opt.args)
48+
end
4249
utils.run(cmd, config.env_script, env, args, config.cwd, config.runner, nil)
4350
end
4451

0 commit comments

Comments
 (0)