Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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
2 changes: 1 addition & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
xtask = "run --package xtask --"
build-test-shader = "xtask test-build"
compiletest = "run --release -p compiletests --"
difftest = "run --release -p difftests --"
difftest = "nextest run --release -P difftests -p difftests"
run-wasm = ["run", "--release", "-p", "run-wasm", "--"]

[target.'cfg(target_arch = "wasm32")']
Expand Down
10 changes: 10 additions & 0 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[profile.default]
default-filter = '!package(difftest*) & !package(compiletest*) & !package(example-runner-*)'
fail-fast = false

[profile.difftests]
default-filter = 'package(difftests)'
slow-timeout = "2m"

[profile.difftest-runner]
default-filter = 'package(difftest-runner) | package(difftest-types)'
14 changes: 10 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ jobs:
# figure out native target triple while we're at it
- name: install rust-toolchain
run: echo "TARGET=$(rustc --print host-tuple)" >> "$GITHUB_ENV"
- name: install nextest
uses: taiki-e/install-action@nextest
# Fetch dependencies in a separate step to clearly show how long each part
# of the testing takes
- name: cargo fetch --locked
Expand All @@ -49,13 +51,13 @@ jobs:
# Core crates
# Compiled in --release because cargo compiletest would otherwise compile in release again.
- name: rustc_codegen_spirv build
run: cargo test -p rustc_codegen_spirv --release --no-default-features --features "use-installed-tools" --no-run
run: cargo nextest run -p rustc_codegen_spirv --release --no-default-features --features "use-installed-tools" --no-run

- name: rustc_codegen_spirv test
run: cargo test -p rustc_codegen_spirv --release --no-default-features --features "use-installed-tools"
run: cargo nextest run -p rustc_codegen_spirv --release --no-default-features --features "use-installed-tools"

- name: workspace test (excluding examples)
run: cargo test --release --workspace --exclude "example-runner-*" --exclude "cargo-gpu*" --no-default-features --features "use-installed-tools,clap"
run: cargo nextest run --release --workspace --exclude "example-runner-*" --exclude "cargo-gpu*" --no-default-features --features "use-installed-tools,clap"

# Examples
- name: cargo check examples
Expand Down Expand Up @@ -173,12 +175,16 @@ jobs:
sudo apt install -y xvfb libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers
- name: install rust-toolchain
run: echo "TARGET=$(rustc --print host-tuple)" >> "$GITHUB_ENV"
- name: install nextest
uses: taiki-e/install-action@nextest
- name: cargo fetch --locked
run: cargo fetch --locked --target $TARGET
- name: cargo fetch --locked difftests
run: cargo fetch --locked --manifest-path=tests/difftests/tests/Cargo.toml --target $TARGET
- name: build difftests (without shaders)
run: cargo nextest run -P difftests -p difftests --release --no-default-features --features "use-installed-tools" --no-run
- name: difftests
run: cargo run -p difftests --release --no-default-features --features "use-installed-tools"
run: cargo nextest run -P difftests -p difftests --release --no-default-features --features "use-installed-tools"

cargo-gpu-os:
strategy:
Expand Down
51 changes: 36 additions & 15 deletions Cargo.lock

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

7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ members = [
"tests/compiletests",
"tests/compiletests/deps-helper",
"tests/difftests/bin",
"tests/difftests/lib",
"tests/difftests/runner",
"tests/difftests/types",
]

exclude = [
Expand Down Expand Up @@ -84,7 +85,9 @@ expect-test = "1.5.1"
regex-lite = "0.1.9"

# difftest libraries mirrored from difftest workspace
difftest = { path = "tests/difftests/lib" }
difftest = { path = "tests/difftests/tests/lib" }
difftest-runner = { path = "tests/difftests/runner", default-features = false }
difftest-types = { path = "tests/difftests/types" }

# External dependencies that need to be mentioned more than once.
tracing = "0.1"
Expand Down
2 changes: 1 addition & 1 deletion crates/rustc_codegen_spirv/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ naga = ["dep:naga"]
# HACK(eddyb) these only exist to unify features across dependency trees,
# in order to avoid multiple separate instances of `rustc_codegen_spirv`.
ahash = { version = "0.8.11", features = ["no-rng"] }
bytemuck = { version = "1.20.0", features = ["aarch64_simd", "derive"] }
bytemuck = { workspace = true, features = ["aarch64_simd"] }
log = { version = "0.4.22", features = ["std"] }
regex = { version = "1", features = ["perf"] }
rustix = { version = "1.0.8", features = ["all-apis"] }
Expand Down
2 changes: 1 addition & 1 deletion crates/spirv-std/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ workspace = true
spirv-std-types.workspace = true
spirv-std-macros.workspace = true
bitflags = "1.3.2"
bytemuck = { version = "1.18.0", features = ["derive"], optional = true }
bytemuck = { workspace = true, optional = true }

[target.'cfg(target_arch = "spirv")'.dependencies]
num-traits = { workspace = true, features = ["libm"] }
Expand Down
3 changes: 2 additions & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ in with pkgs; stdenv.mkDerivation rec {
# Allow cargo to download crates (even inside `nix-shell --pure`).
SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";

nativeBuildInputs = [ rustup ];
nativeBuildInputs = [ rustup spirv-tools ];
buildInputs = [ cargo-nextest ];

# Runtime dependencies (for the example runners).
LD_LIBRARY_PATH = with xorg; lib.makeLibraryPath [
Expand Down
6 changes: 6 additions & 0 deletions tests/difftests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,12 @@ config.write_metadata(&metadata)?;

## Running Tests

### Install cargo-nextest:

```sh
cargo install cargo-nextest
```

### Run all difftests:

```sh
Expand Down
25 changes: 8 additions & 17 deletions tests/difftests/bin/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,35 +1,26 @@
[package]
name = "difftests"
version = "0.0.0"
publish = false
authors.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
publish = false

# See rustc_codegen_spirv/Cargo.toml for details on these features
[features]
default = ["use-compiled-tools"]
use-installed-tools = []
use-compiled-tools = []
use-installed-tools = ["difftest-runner/use-installed-tools"]
use-compiled-tools = ["difftest-runner/use-compiled-tools"]

[dependencies]
anyhow = "1.0"
tracing = "0.1"
tracing-subscriber = { version = "0.3.20", features = ["fmt", "env-filter"] }
tempfile = "3.5"
tester = "0.9.1"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
thiserror = "2.0.12"
toml = { version = "0.9.2", default-features = false, features = ["parse", "serde"] }
bytesize = "2.0.1"
bytemuck = "1.21.0"
difftest = { path = "../lib" }
tabled = { version = "0.20.0", default-features = false, features = ["std"] }
difftest-runner.workspace = true

[lints]
workspace = true

[package.metadata.release]
release = false
[[test]]
name = "difftests"
path = "src/test.rs"
harness = false
140 changes: 0 additions & 140 deletions tests/difftests/bin/src/main.rs

This file was deleted.

Loading
Loading