Skip to content

Move tests from spirv-builder to their own crate #201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/clippy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ clippy crates/spirv-builder
clippy examples/runners/ash
clippy examples/runners/wgpu

clippy_no_features crates/testsuite
clippy_no_features examples/runners/cpu
clippy_no_features examples/shaders/sky-shader
clippy_no_features examples/shaders/simplest-shader
1 change: 1 addition & 0 deletions .github/workflows/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ fi

cargo_test examples/runners/wgpu

cargo_test_no_features crates/testsuite
cargo_test_no_features examples/runners/cpu
cargo_test_no_features examples/shaders/sky-shader
cargo_test_no_features examples/shaders/simplest-shader
11 changes: 11 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ members = [
"crates/spirv-std",
"crates/spirv-tools",
"crates/spirv-tools-sys",
"crates/testsuite",
]

[patch.crates-io]
Expand Down
3 changes: 0 additions & 3 deletions crates/spirv-builder/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#[cfg(test)]
mod test;

mod depfile;

use raw_string::{RawStr, RawString};
Expand Down
13 changes: 13 additions & 0 deletions crates/testsuite/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[package]
name = "testsuite"
version = "0.1.0"
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
spirv-builder = { path = "../spirv-builder", default-features = false }
rustc_codegen_spirv = { path = "../rustc_codegen_spirv", default-features = false }
lazy_static = "1.4"
pretty_assertions = "0.6"
cfg-if = "0.1.10"
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
mod basic;
mod control_flow;
cfg_if::cfg_if! {
if #[cfg(test)] {
mod basic;
mod control_flow;
}
}

use lazy_static::lazy_static;
use rustc_codegen_spirv::rspirv;
Expand Down Expand Up @@ -74,7 +78,7 @@ fn setup(src: &str) -> Result<PathBuf, Box<dyn Error>> {

fn build(src: &str) -> PathBuf {
let project = setup(src).expect("Failed to set up project");
crate::SpirvBuilder::new(&project)
spirv_builder::SpirvBuilder::new(&project)
.print_metadata(false)
.build()
.expect("Failed to build test")
Expand Down