Skip to content

Commit 88f2895

Browse files
committed
Moving ctest extra args to Config.base_settings
1 parent e76007b commit 88f2895

3 files changed

Lines changed: 5 additions & 7 deletions

File tree

lua/cmake-tools/config.lua

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ local Config = {
1111
build_directory = nil,
1212
query_directory = nil,
1313
reply_directory = nil,
14-
ctest = {
15-
extra_args = {},
16-
},
1714
build_type = nil,
1815
variant = nil,
1916
build_target = nil,
@@ -29,6 +26,7 @@ local Config = {
2926
generate_options = {},
3027
build_options = {},
3128
show_disabled_build_presets = true,
29+
ctest_extra_args = {},
3230
}, -- general config
3331
target_settings = {}, -- target specific config
3432
executor = nil,
@@ -52,7 +50,7 @@ function Config:new(const)
5250
obj.executor = const.cmake_executor
5351
obj.runner = const.cmake_runner
5452
for _, v in pairs(const.ctest_extra_args) do
55-
table.insert(obj.ctest.extra_args, v)
53+
table.insert(obj.base_settings.ctest_extra_args, v)
5654
end
5755
return obj
5856
end

lua/cmake-tools/test/ctest.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function ctest.run(ctest_command, test_name, build_dir, env, config, opt)
3939
opt = opt or {}
4040

4141
local args = { "--test-dir", utils.transform_path(build_dir), "-R", test_name, opt.args }
42-
for _, v in pairs(config.ctest.extra_args) do
42+
for _, v in pairs(config.base_settings.ctest_extra_args) do
4343
table.insert(args, v)
4444
end
4545
utils.run(cmd, config.env_script, env, args, config.cwd, config.runner, nil)

tests/config_spec.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ describe("Config", function()
1313
it("should parse user provided ctest arguments", function()
1414
local_const.ctest_extra_args = { "-j", "6" }
1515
local config = Config:new(local_const)
16-
assert.are_same({ "-j", "6" }, config.ctest.extra_args)
16+
assert.are_same({ "-j", "6" }, config.base_settings.ctest_extra_args)
1717
end)
1818

1919
it("should parse user ctest empty arguments", function()
2020
local config = Config:new(const)
21-
assert.are_same({}, config.ctest.extra_args)
21+
assert.are_same({}, config.base_settings.ctest_extra_args)
2222
end)
2323
end)

0 commit comments

Comments
 (0)