Skip to content

Commit 8357e7a

Browse files
committed
Add sep variable to compiletest headers
1 parent fdb70da commit 8357e7a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/tools/compiletest/src/header.rs

+5
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,7 @@ impl Config {
793793

794794
fn expand_variables(mut value: String, config: &Config) -> String {
795795
const CWD: &str = "{{cwd}}";
796+
const SEP: &str = "{{sep}}";
796797
const SRC_BASE: &str = "{{src-base}}";
797798
const BUILD_BASE: &str = "{{build-base}}";
798799

@@ -801,6 +802,10 @@ fn expand_variables(mut value: String, config: &Config) -> String {
801802
value = value.replace(CWD, &cwd.to_string_lossy());
802803
}
803804

805+
if value.contains(SEP) {
806+
value = value.replace(SEP, std::path::MAIN_SEPARATOR_STR);
807+
}
808+
804809
if value.contains(SRC_BASE) {
805810
value = value.replace(SRC_BASE, &config.src_base.to_string_lossy());
806811
}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Check to see if we can get parameters from an @argsfile file
22
//
3-
// compile-flags: --cfg cmdline_set -Z shell-argfiles @shell:{{src-base}}/shell-argfiles/shell-argfiles-badquotes.args
3+
// compile-flags: --cfg cmdline_set -Z shell-argfiles @shell:{{src-base}}{{sep}}shell-argfiles/shell-argfiles-badquotes.args
44

55
fn main() {
66
}

0 commit comments

Comments
 (0)