Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lua/cmake-tools/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1183,7 +1183,7 @@ function cmake.run_test(opt, callback)
return
end
if idx == 1 then
ctest.run(const.ctest_command, "'.*'", config:build_directory_path(), env, config, opt)
ctest.run(const.ctest_command, nil, config:build_directory_path(), env, config, opt)
else
ctest.run(
const.ctest_command,
Expand Down
9 changes: 8 additions & 1 deletion lua/cmake-tools/test/ctest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,14 @@ function ctest.run(ctest_command, test_name, build_dir, env, config, opt)
local cmd = ctest_command
opt = opt or {}

local args = { "--test-dir", utils.transform_path(build_dir), "-R", test_name, opt.args }
local args = { "--test-dir", utils.transform_path(build_dir) }
if test_name then
table.insert(args, "-R")
table.insert(args, test_name)
end
if opt.args then
table.insert(args, opt.args)
end
utils.run(cmd, config.env_script, env, args, config.cwd, config.runner, nil)
end

Expand Down