From f45d812266545db12e6ed5191d997d06957c644d Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Thu, 13 May 2021 10:21:43 -0700 Subject: [PATCH] [wgsl-in]: Move WGSL front end integration tests into a WGSL-specific file. This lets us reduce noise by removing a bunch of `#[cfg]` attributes. In the future, if we have tests for other front ends, we can create an `errors` subdirectory, but for now, we only have the WGSL tests, so we should keep things flat. --- tests/{errors.rs => wgsl-errors.rs} | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) rename tests/{errors.rs => wgsl-errors.rs} (91%) diff --git a/tests/errors.rs b/tests/wgsl-errors.rs similarity index 91% rename from tests/errors.rs rename to tests/wgsl-errors.rs index 9bfefc407f..face95d911 100644 --- a/tests/errors.rs +++ b/tests/wgsl-errors.rs @@ -1,4 +1,6 @@ -#[cfg(feature = "wgsl-in")] +//! Tests for the WGSL front end. +#![cfg(feature = "wgsl-in")] + fn check(input: &str, snapshot: &str) { let output = naga::front::wgsl::parse_str(input) .expect_err("expected parser error") @@ -15,7 +17,6 @@ fn check(input: &str, snapshot: &str) { } } -#[cfg(feature = "wgsl-in")] #[test] fn function_without_identifier() { check( @@ -30,7 +31,6 @@ fn function_without_identifier() { ); } -#[cfg(feature = "wgsl-in")] #[test] fn invalid_integer() { check( @@ -45,7 +45,6 @@ fn invalid_integer() { ); } -#[cfg(feature = "wgsl-in")] #[test] fn invalid_float() { check( @@ -60,7 +59,6 @@ fn invalid_float() { ); } -#[cfg(feature = "wgsl-in")] #[test] fn invalid_scalar_width() { check(