Option to pass extra arguments to ctest#315
Option to pass extra arguments to ctest#315kalebealvs wants to merge 3 commits intoCivitasv:masterfrom
Conversation
| require("cmake-tools").setup { | ||
| cmake_command = "cmake", -- this is used to specify cmake command path | ||
| ctest_command = "ctest", -- this is used to specify ctest command path | ||
| ctest_extra_args = {}, -- this is used to specify extra args for ctest |
There was a problem hiding this comment.
Maybe we can put this variable into Config.base_settings? So we can edit it easily.
|
Sorry for my late. It's a great option, I personally think putting it into |
I'm so sorry. I completely forgot about this since I was using my fork and didn't pay much attention to the notifications. |
lceWolf
left a comment
There was a problem hiding this comment.
Sorry for my late reply. I think this PR is a move in the right direction, I only got some minor comments.
Unfortunately, there are merge conflicts now which need resolving.
| obj.executor = const.cmake_executor | ||
| obj.runner = const.cmake_runner | ||
|
|
||
| for _, v in pairs(const.ctest_extra_args) do |
There was a problem hiding this comment.
Using a for loop here might not have the desired outcome. Or at least only once^^
It will add the args to the Config table inject of the created obj.
This is not an issue introduced by this PR, but the way new is currently implemented might cause the args to be appended multiple times.
It might be better to assign it directly (like cmake_build_options) until the Config class is fixed
additionally, ctest_extra_args is an array -- you should use ipairs instead of pairs
| it("takes extra args from user config", function() | ||
| local_const.ctest_extra_args = { "-j", "6" } | ||
| local config = Config:new(local_const) | ||
| ctest:run("test_name", "build_dir", "env", config, {}) |
There was a problem hiding this comment.
ctest is not actually an instance. it is a plain table. The colon syntax is not right and passes a wrong value to the ctest_command parameter
This patch enables the plugin to pass extra args to ctest when running tests.
Resolves: #296