Skip to content

Commit

Permalink
Merge pull request #284 from oli-obk/globa
Browse files Browse the repository at this point in the history
Remove global variable
  • Loading branch information
oli-obk authored Oct 7, 2024
2 parents 3cb12b4 + 7714e22 commit 37f42aa
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ui_test"
version = "0.27.0"
version = "0.27.1"
edition = "2021"
license = "MIT OR Apache-2.0"
description = "A test framework for testing rustc diagnostics output"
Expand Down
12 changes: 6 additions & 6 deletions src/status_emitter/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ pub struct Text {
progress: OutputVerbosity,
#[cfg(feature = "indicatif")]
handle: Arc<JoinOnDrop>,
#[cfg(feature = "indicatif")]
ids: Arc<AtomicUsize>,
}

#[cfg(feature = "indicatif")]
Expand Down Expand Up @@ -316,6 +318,7 @@ impl Text {
progress,
#[cfg(feature = "indicatif")]
handle: Arc::new(handle.into()),
ids: Arc::new(AtomicUsize::new(1)),
}
}

Expand Down Expand Up @@ -357,9 +360,6 @@ struct TextTest {
style: RevisionStyle,
}

#[cfg(feature = "indicatif")]
static ID_GENERATOR: AtomicUsize = AtomicUsize::new(1);

impl TestStatus for TextTest {
fn done(&self, result: &TestResult, aborted: bool) {
#[cfg(feature = "indicatif")]
Expand Down Expand Up @@ -458,7 +458,7 @@ impl TestStatus for TextTest {
#[cfg(feature = "indicatif")]
parent: self.id,
#[cfg(feature = "indicatif")]
id: ID_GENERATOR.fetch_add(1, Ordering::Relaxed),
id: self.text.ids.fetch_add(1, Ordering::Relaxed),
revision: revision.to_owned(),
style,
};
Expand All @@ -485,7 +485,7 @@ impl TestStatus for TextTest {
#[cfg(feature = "indicatif")]
parent: self.id,
#[cfg(feature = "indicatif")]
id: ID_GENERATOR.fetch_add(1, Ordering::Relaxed),
id: self.text.ids.fetch_add(1, Ordering::Relaxed),
revision: String::new(),
style: RevisionStyle::Show,
};
Expand All @@ -510,7 +510,7 @@ impl TestStatus for TextTest {
impl StatusEmitter for Text {
fn register_test(&self, path: PathBuf) -> Box<dyn TestStatus> {
#[cfg(feature = "indicatif")]
let id = ID_GENERATOR.fetch_add(1, Ordering::Relaxed);
let id = self.ids.fetch_add(1, Ordering::Relaxed);
#[cfg(feature = "indicatif")]
self.sender
.send(Msg::Push {
Expand Down
2 changes: 1 addition & 1 deletion tests/integrations/basic-bin/Cargo.lock

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

2 changes: 1 addition & 1 deletion tests/integrations/basic-fail-mode/Cargo.lock

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

2 changes: 1 addition & 1 deletion tests/integrations/basic-fail/Cargo.lock

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

2 changes: 1 addition & 1 deletion tests/integrations/basic/Cargo.lock

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

2 changes: 1 addition & 1 deletion tests/integrations/cargo-run/Cargo.lock

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

0 comments on commit 37f42aa

Please sign in to comment.