Skip to content
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

Use indicatif to show a progress bar and the currently running tests #108

Merged
merged 8 commits into from
Jul 26, 2023
147 changes: 129 additions & 18 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 @@ -27,6 +27,7 @@ comma = "1.0.0"
distance = "0.4.0"
clap = { version = "4.3.11", features = ["derive"] }
anyhow = "1.0.6"
indicatif = "0.17.5"
prettydiff = "0.6.4"

[dependencies.regex]
Expand Down
6 changes: 3 additions & 3 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ pub struct Config {
impl Config {
/// Create a configuration for testing the output of running
/// `rustc` on the test files.
pub fn rustc(root_dir: PathBuf) -> Self {
pub fn rustc(root_dir: impl Into<PathBuf>) -> Self {
Self {
host: None,
target: None,
Expand All @@ -73,7 +73,7 @@ impl Config {
#[cfg(windows)]
(Match::Exact(vec![b'\r']), b""),
],
root_dir,
root_dir: root_dir.into(),
mode: Mode::Fail {
require_patterns: true,
},
Expand All @@ -100,7 +100,7 @@ impl Config {

/// Create a configuration for testing the output of running
/// `cargo` on the test `Cargo.toml` files.
pub fn cargo(root_dir: PathBuf) -> Self {
pub fn cargo(root_dir: impl Into<PathBuf>) -> Self {
Self {
program: CommandBuilder::cargo(),
edition: None,
Expand Down
7 changes: 7 additions & 0 deletions src/dependencies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ pub fn build_dependencies(config: &mut Config) -> Result<Dependencies> {
continue
};
if let cargo_metadata::Message::CompilerArtifact(artifact) = message {
if artifact
.filenames
.iter()
.any(|f| f.ends_with("build-script-build"))
{
continue;
}
for filename in &artifact.filenames {
import_paths.insert(filename.parent().unwrap().into());
}
Expand Down
Loading