Skip to content

Commit

Permalink
Remove rustup test wrapper macros
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed Jun 16, 2024
1 parent 34060ae commit 1dee499
Show file tree
Hide file tree
Showing 27 changed files with 3 additions and 192 deletions.
10 changes: 0 additions & 10 deletions Cargo.lock

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

4 changes: 1 addition & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ version = "0.52.0"
enum-map = "2.5.0"
platforms.workspace = true
proptest.workspace = true
rustup-macros.workspace = true
tokio = { workspace = true, features = ["rt-multi-thread", "macros"] }
trycmd = "0.15.0"

Expand All @@ -130,7 +129,7 @@ platforms.workspace = true
regex = "1"

[workspace]
members = ["download", "rustup-macros"]
members = ["download"]

[workspace.dependencies]
anyhow = "1.0.69"
Expand All @@ -141,7 +140,6 @@ opentelemetry_sdk = { version = "0.23", features = ["rt-tokio"] }
opentelemetry-otlp = "0.16"
platforms = "3.4"
proptest = "1.1.0"
rustup-macros = { path = "rustup-macros" }
tempfile = "3.8"
termcolor = "1.2"
thiserror = "1.0"
Expand Down
13 changes: 0 additions & 13 deletions rustup-macros/Cargo.toml

This file was deleted.

124 changes: 0 additions & 124 deletions rustup-macros/src/lib.rs

This file was deleted.

2 changes: 0 additions & 2 deletions src/cli/download_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,6 @@ fn format_dhms(sec: u64) -> (u64, u8, u8, u8) {

#[cfg(test)]
mod tests {
use rustup_macros::unit_test as test;

use super::format_dhms;

#[test]
Expand Down
2 changes: 0 additions & 2 deletions src/cli/self_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1335,8 +1335,6 @@ pub(crate) fn cleanup_self_updater(process: &Process) -> Result<()> {
mod tests {
use std::collections::HashMap;

use rustup_macros::unit_test as test;

use crate::cli::common;
use crate::cli::self_update::InstallOpts;
use crate::dist::dist::{PartialToolchainDesc, Profile};
Expand Down
2 changes: 0 additions & 2 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -968,8 +968,6 @@ enum ParseMode {

#[cfg(test)]
mod tests {
use rustup_macros::unit_test as test;

use super::*;

#[test]
Expand Down
2 changes: 0 additions & 2 deletions src/currentprocess/terminalsource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,6 @@ impl io::Write for ColorableTerminalLocked {
mod tests {
use std::collections::HashMap;

use rustup_macros::unit_test as test;

use super::*;
use crate::currentprocess::TestProcess;
use crate::test::Env;
Expand Down
5 changes: 1 addition & 4 deletions src/diskio/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@ use std::collections::HashMap;

use anyhow::Result;

use rustup_macros::unit_test as test;

use crate::test::test_dir;

use super::{get_executor, Executor, Item, Kind};
use crate::currentprocess::TestProcess;
use crate::test::test_dir;

impl Item {
/// The length of the file, for files (for stats)
Expand Down
2 changes: 0 additions & 2 deletions src/dist/component/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ use std::fs;
use std::io::Write;
use std::path::PathBuf;

use rustup_macros::unit_test as test;

use crate::currentprocess::TestProcess;
use crate::dist::component::Transaction;
use crate::dist::dist::DEFAULT_DIST_SERVER;
Expand Down
2 changes: 0 additions & 2 deletions src/dist/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1154,8 +1154,6 @@ fn date_from_manifest_date(date_str: &str) -> Option<NaiveDate> {

#[cfg(test)]
mod tests {
use rustup_macros::unit_test as test;

use super::*;

#[test]
Expand Down
2 changes: 0 additions & 2 deletions src/dist/manifestation/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ use anyhow::{anyhow, Result};
use tokio::{runtime::Handle, task};
use url::Url;

use rustup_macros::unit_test as test;

use crate::{
currentprocess::{Process, TestProcess},
dist::{
Expand Down
2 changes: 0 additions & 2 deletions src/dist/triple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ impl PartialTargetTriple {

#[cfg(test)]
mod test {
use rustup_macros::unit_test as test;

use super::*;

#[test]
Expand Down
2 changes: 0 additions & 2 deletions src/env_var.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ mod tests {
use std::collections::HashMap;
use std::ffi::{OsStr, OsString};

use rustup_macros::unit_test as test;

use super::*;
use crate::currentprocess::TestProcess;
use crate::test::{with_saved_path, Env};
Expand Down
2 changes: 0 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@ pub mod utils;

#[cfg(test)]
mod tests {
use rustup_macros::unit_test as test;

use crate::{is_proxyable_tools, DUP_TOOLS, TOOLS};

#[test]
Expand Down
2 changes: 0 additions & 2 deletions src/utils/units.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ impl Display for Size {

#[cfg(test)]
mod tests {
use rustup_macros::unit_test as test;

#[test]
fn unit_formatter_test() {
use crate::utils::units::{Size, Unit, UnitMode};
Expand Down
2 changes: 0 additions & 2 deletions src/utils/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -666,8 +666,6 @@ pub(crate) fn home_dir_from_passwd() -> Option<PathBuf> {

#[cfg(test)]
mod tests {
use rustup_macros::unit_test as test;

use super::*;

#[test]
Expand Down
1 change: 0 additions & 1 deletion tests/suite/cli_exact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use rustup::test::{
mock::clitools::{self, set_current_dist_date, with_update_server, Config, Scenario},
this_host_triple,
};
use rustup_macros::integration_test as test;

/// Start a test with Scenario::None
fn test(f: &dyn Fn(&mut Config)) {
Expand Down
1 change: 0 additions & 1 deletion tests/suite/cli_inst_interactive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use rustup::test::{
this_host_triple, with_saved_path,
};
use rustup::utils::raw;
use rustup_macros::integration_test as test;

fn run_input(config: &Config, args: &[&str], input: &str) -> SanitizedOutput {
run_input_with_env(config, args, input, &[])
Expand Down
1 change: 0 additions & 1 deletion tests/suite/cli_misc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use rustup::test::{
this_host_triple,
};
use rustup::utils::utils;
use rustup_macros::integration_test as test;

pub fn setup(f: &dyn Fn(&mut Config)) {
clitools::test(Scenario::SimpleV2, f);
Expand Down
4 changes: 1 addition & 3 deletions tests/suite/cli_paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ mod unix {
use std::fs;
use std::path::PathBuf;

use rustup::utils::raw;
use rustup_macros::integration_test as test;

use super::INIT_NONE;
use rustup::test::mock::clitools::{self, Scenario};
use rustup::utils::raw;

// Let's write a fake .rc which looks vaguely like a real script.
const FAKE_RC: &str = r#"
Expand Down
1 change: 0 additions & 1 deletion tests/suite/cli_rustup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use std::{env::consts::EXE_SUFFIX, path::Path};
use rustup::for_host;
use rustup::test::this_host_triple;
use rustup::utils::raw;
use rustup_macros::integration_test as test;

use rustup::test::mock::{
self,
Expand Down
1 change: 0 additions & 1 deletion tests/suite/cli_self_upd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ use rustup::test::{
};
use rustup::utils::{raw, utils};
use rustup::{for_host, DUP_TOOLS, TOOLS};
use rustup_macros::integration_test as test;

#[cfg(windows)]
use rustup::test::with_saved_reg_value;
Expand Down
2 changes: 0 additions & 2 deletions tests/suite/cli_ui.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use std::{fs, path::PathBuf};

use rustup_macros::integration_test as test;

#[test]
fn rustup_ui_doc_text_tests() {
let t = trycmd::TestCases::new();
Expand Down
2 changes: 0 additions & 2 deletions tests/suite/cli_v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
use std::fs;

use rustup::for_host;
use rustup_macros::integration_test as test;

use rustup::test::mock::clitools::{self, set_current_dist_date, Config, Scenario};

pub fn setup(f: &dyn Fn(&mut Config)) {
Expand Down
1 change: 0 additions & 1 deletion tests/suite/cli_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use rustup::dist::dist::TargetTriple;
use rustup::for_host;
use rustup::test::mock::clitools::{self, set_current_dist_date, Config, Scenario};
use rustup::test::this_host_triple;
use rustup_macros::integration_test as test;

pub fn setup(f: &dyn Fn(&mut Config)) {
clitools::test(Scenario::SimpleV2, f);
Expand Down
1 change: 0 additions & 1 deletion tests/suite/dist_install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use rustup::dist::prefix::InstallPrefix;
use rustup::dist::temp;
use rustup::dist::Notification;
use rustup::utils::utils;
use rustup_macros::integration_test as test;

use rustup::test::mock::{MockComponentBuilder, MockFile, MockInstallerBuilder};

Expand Down

0 comments on commit 1dee499

Please sign in to comment.