Skip to content

Commit 0572151

Browse files
committed
Make stage_id use the env
Without this the skip directives weren't working. This looks to largely be legacy anyway, but tests now run and pass in the correct environments.
1 parent 775b5d5 commit 0572151

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

tests/src/main.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,13 @@ impl Runner {
145145
// in different testing variations (i.e. experimental features), while
146146
// keeping *most* of the tests unchanged, we make use of "stage IDs",
147147
// which offer `// only-S` and `// ignore-S` for any stage ID `S`.
148-
let stage_id = variation.name;
148+
let stage_id = if variation.name == "default" {
149+
// Use the environment name as the stage ID.
150+
env.to_string()
151+
} else {
152+
// Include the variation name in the stage ID.
153+
format!("{}-{}", env, variation.name)
154+
};
149155

150156
let target = format!("{SPIRV_TARGET_PREFIX}{env}");
151157
let libs = build_deps(&self.deps_target_dir, &self.codegen_backend_path, &target);
@@ -164,7 +170,7 @@ impl Runner {
164170
flags += variation.extra_flags;
165171

166172
let config = compiletest::Config {
167-
stage_id: stage_id.to_string(),
173+
stage_id,
168174
target_rustcflags: Some(flags),
169175
mode: mode.parse().expect("Invalid mode"),
170176
target: target_spec_json(&target),

tests/ui/lang/core/ref/member_ref_arg-broken.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// we care more that the error messages do not regress too much.
44

55
// build-fail
6-
6+
// normalize-stderr-test "ref/member_ref_arg-broken\.[^`]*" -> "ref/member_ref_arg-broken"
77
// normalize-stderr-test "38\[%38\]" -> "$$ID[%$$ID]"
88

99
use spirv_std::spirv;

tests/ui/lang/core/ref/member_ref_arg-broken.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ error: error:0:0 - OpLoad Pointer <id> '$ID[%$ID]' is not a logical pointer.
66
%39 = OpLoad %uint %38
77
|
88
= note: spirv-val failed
9-
= note: module `$TEST_BUILD_DIR/lang/core/ref/member_ref_arg-broken.default`
9+
= note: module `$TEST_BUILD_DIR/lang/core/ref/member_ref_arg-broken`
1010

1111
error: aborting due to 1 previous error; 2 warnings emitted
1212

0 commit comments

Comments
 (0)