Skip to content

Commit 957c5db

Browse files
committed
compiletest: add a way to specify params with spaces
This use single quotes, because those aren't used in params, while double quotes are and would be tougher to parse.
1 parent 28ee5da commit 957c5db

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/tools/compiletest/src/header.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,15 @@ impl TestProps {
322322
);
323323

324324
if let Some(flags) = config.parse_name_value_directive(ln, COMPILE_FLAGS) {
325-
self.compile_flags.extend(flags.split_whitespace().map(|s| s.to_owned()));
325+
self.compile_flags.extend(
326+
flags
327+
.split("'")
328+
.enumerate()
329+
.flat_map(|(i, f)| {
330+
if i % 2 == 1 { vec![f] } else { f.split_whitespace().collect() }
331+
})
332+
.map(|s| s.to_owned()),
333+
);
326334
}
327335
if config.parse_name_value_directive(ln, INCORRECT_COMPILER_FLAGS).is_some() {
328336
panic!("`compiler-flags` directive should be spelled `compile-flags`");

0 commit comments

Comments
 (0)