Skip to content

Commit 9388b3f

Browse files
authored
Merge pull request #123 from anthonyprintup/quotes-fix
Prevent wrapping test command arguments in quotes
2 parents 08204d9 + 339c2aa commit 9388b3f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/cmake_generator.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1347,7 +1347,12 @@ void generate_cmake(const char *path, const parser::Project *parent_project) {
13471347
}
13481348
auto working_directory = std::make_pair("WORKING_DIRECTORY", dir);
13491349
auto command = std::make_pair("COMMAND", test.command);
1350-
auto arguments = std::make_pair("", test.arguments);
1350+
1351+
// Transform the provided arguments into raw arguments to prevent them from being quoted when the generator runs
1352+
std::vector<RawArg> raw_arguments{};
1353+
for (const auto &argument : test.arguments)
1354+
raw_arguments.emplace_back(argument);
1355+
auto arguments = std::make_pair("", raw_arguments);
13511356
ConditionScope cs(gen, test.condition);
13521357
cmd("add_test")(name, configurations, working_directory, command, arguments).endl();
13531358
}

0 commit comments

Comments
 (0)