Skip to content

Commit

Permalink
Add sep variable to compiletest headers
Browse files Browse the repository at this point in the history
  • Loading branch information
djkoloski committed Jan 5, 2024
1 parent fdb70da commit 8357e7a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/tools/compiletest/src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,7 @@ impl Config {

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

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

if value.contains(SEP) {
value = value.replace(SEP, std::path::MAIN_SEPARATOR_STR);
}

if value.contains(SRC_BASE) {
value = value.replace(SRC_BASE, &config.src_base.to_string_lossy());
}
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/shell-argfiles/shell-argfiles-badquotes.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Check to see if we can get parameters from an @argsfile file
//
// compile-flags: --cfg cmdline_set -Z shell-argfiles @shell:{{src-base}}/shell-argfiles/shell-argfiles-badquotes.args
// compile-flags: --cfg cmdline_set -Z shell-argfiles @shell:{{src-base}}{{sep}}shell-argfiles/shell-argfiles-badquotes.args

fn main() {
}

0 comments on commit 8357e7a

Please sign in to comment.