-
Notifications
You must be signed in to change notification settings - Fork 114
difftest: nextest support and speedups #334
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
1fe3a99
difftest: use relative paths, create output directory in target
Firestar99 3b0ab05
difftest: fix test mod paths with subdirectories
Firestar99 70c0363
difftest: fix test names on windows
Firestar99 1621161
difftest: move difftest `bin` to `runner`
Firestar99 941c8c7
difftest: switch to `mimic-libtest` from `tester`
Firestar99 b13a250
difftest: disable logger when listing available tests
Firestar99 9a87ecb
difftest: fix `use-installed-tools` feature
Firestar99 79582bb
difftest: use nextest to properly filter tests, adjust ci
Firestar99 5a95941
difftest: move `lib` into `tests` workspace, move `mod config` to new…
Firestar99 106ae13
difftest: compile difftest in ci before running
Firestar99 d54a579
difftest: better io error reporting in config
Firestar99 ccad94f
difftest: cargo windows bug workaround, mirror all workspace dependen…
Firestar99 2c553b4
difftest: Unconditionally create output file
LegNeato 2c0e2d5
difftest: typo fixes
Firestar99 08f6d09
difftest: document nextest requirement
Firestar99 376f532
difftest: unify `num-traits` features on cpu to prevent `rustc_codege…
Firestar99 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| use anyhow::Result; | ||
| use std::process::ExitCode; | ||
|
|
||
| pub fn main() -> Result<ExitCode> { | ||
| difftest_runner::run() | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| [package] | ||
| name = "difftest-runner" | ||
| version = "0.0.0" | ||
| publish = false | ||
| authors.workspace = true | ||
| edition.workspace = true | ||
| license.workspace = true | ||
| repository.workspace = true | ||
|
|
||
| # See rustc_codegen_spirv/Cargo.toml for details on these features | ||
| [features] | ||
| default = ["use-compiled-tools"] | ||
| use-installed-tools = [] | ||
| use-compiled-tools = [] | ||
|
|
||
| [dependencies] | ||
| anyhow = "1.0" | ||
| tracing = "0.1" | ||
| tracing-subscriber = { version = "0.3.20", features = ["fmt", "env-filter"] } | ||
| libtest-mimic = "0.8.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"] } | ||
|
|
||
| [dev-dependencies] | ||
| tempfile = "3.5" | ||
|
|
||
| [lints] | ||
| workspace = true | ||
|
|
||
| [package.metadata.release] | ||
| release = false |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| #![allow(clippy::exit)] | ||
|
|
||
| use crate::testcase::collect_test_dirs; | ||
| use anyhow::Result; | ||
| use libtest_mimic::{Arguments, Trial}; | ||
| use runner::Runner; | ||
| use std::process::ExitCode; | ||
| use std::sync::Arc; | ||
| use std::{ | ||
| env, fs, | ||
| process::{self}, | ||
| }; | ||
| use tracing_subscriber::FmtSubscriber; | ||
|
|
||
| mod differ; | ||
| mod runner; | ||
| mod testcase; | ||
|
|
||
| pub fn run() -> Result<ExitCode> { | ||
| let subscriber = FmtSubscriber::builder() | ||
| .with_env_filter(tracing_subscriber::EnvFilter::from_default_env()) | ||
| .finish(); | ||
| tracing::subscriber::set_global_default(subscriber).expect("Failed to set global subscriber"); | ||
|
|
||
| let mut args = Arguments::from_args(); | ||
|
|
||
| // If filters are provided that look like paths (contain '/'), convert them to test names | ||
| if let Some(filter) = &mut args.filter { | ||
| *filter = filter.replace('/', "::"); | ||
| } | ||
|
|
||
| let tests = collect_tests()?; | ||
| Ok(libtest_mimic::run(&args, tests).exit_code()) | ||
| } | ||
|
|
||
| fn collect_tests() -> Result<Vec<Trial>> { | ||
| // Find the manifest directory at compile time and locate tests in ../tests. | ||
| let manifest_dir = env!("CARGO_MANIFEST_DIR"); | ||
| let base = std::path::Path::new(manifest_dir) | ||
| .join("../tests") | ||
| .canonicalize() | ||
| .expect("Failed to canonicalize tests directory"); | ||
| tracing::debug!("Using tests directory: {}", base.display()); | ||
|
|
||
| let output_dir = std::path::Path::new(manifest_dir).join("../tests/target/difftest"); | ||
| fs::create_dir_all(&output_dir)?; | ||
| let output_dir = output_dir | ||
| .canonicalize() | ||
| .expect("Failed to canonicalize tests directory"); | ||
| tracing::debug!("Using output directory: {}", output_dir.display()); | ||
|
|
||
| let runner = Arc::new(Runner { | ||
| base_dir: base.clone(), | ||
| output_dir, | ||
| }); | ||
|
|
||
| let test_cases = collect_test_dirs(&base).expect("Failed to collect test case directories"); | ||
| if test_cases.is_empty() { | ||
| eprintln!("No valid tests found in {}", base.display()); | ||
| process::exit(1); | ||
| } | ||
|
|
||
| let trails = test_cases | ||
| .into_iter() | ||
| .map(|case| { | ||
| let runner = runner.clone(); | ||
| Trial::test(case.to_string(), move || Ok(runner.run_test_case(&case)?)) | ||
| }) | ||
| .collect(); | ||
| Ok(trails) | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.