1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 12:07:46 +00:00

Merge pull request #940 from knight42/cleanup-tests

Cleanup tests
This commit is contained in:
mpkh 2016-08-06 21:51:30 +04:00 committed by GitHub
commit b85b8dc18c
11 changed files with 18 additions and 44 deletions

View file

@ -192,14 +192,8 @@ yes = { optional=true, path="src/yes" }
[dev-dependencies] [dev-dependencies]
time = "*" time = "*"
kernel32-sys = "*"
winapi = "*"
filetime = "*" filetime = "*"
libc = "*" libc = "*"
memchr = "*"
primal = "*"
aho-corasick= "*"
regex-syntax= "*"
regex="*" regex="*"
rand="*" rand="*"
tempdir="*" tempdir="*"

0
tests/common/macros.rs Executable file → Normal file
View file

3
tests/common/util.rs Executable file → Normal file
View file

@ -1,4 +1,5 @@
#![allow(dead_code)] #![allow(dead_code)]
extern crate tempdir;
use std::env; use std::env;
use std::fs::{self, File, OpenOptions}; use std::fs::{self, File, OpenOptions};
@ -14,7 +15,7 @@ use std::ffi::OsStr;
use std::rc::Rc; use std::rc::Rc;
use std::thread::sleep; use std::thread::sleep;
use std::time::Duration; use std::time::Duration;
use tempdir::TempDir; use self::tempdir::TempDir;
#[cfg(windows)] #[cfg(windows)]
static PROGNAME: &'static str = "uutils.exe"; static PROGNAME: &'static str = "uutils.exe";

View file

@ -8,9 +8,14 @@
// //
use common::util::*; use common::util::*;
use rand::{weak_rng, Rng};
use rand::distributions::{IndependentSample, Range}; #[path="../src/factor/sieve.rs"]
use sieve::Sieve; mod sieve;
use self::sieve::Sieve;
extern crate rand;
use self::rand::{weak_rng, Rng};
use self::rand::distributions::{IndependentSample, Range};
const NUM_PRIMES: usize = 10000; const NUM_PRIMES: usize = 10000;
const LOG_PRIMES: f64 = 14.0; // ceil(log2(NUM_PRIMES)) const LOG_PRIMES: f64 = 14.0; // ceil(log2(NUM_PRIMES))

View file

@ -1,10 +1,3 @@
extern crate libc;
extern crate time;
extern crate kernel32;
extern crate winapi;
extern crate filetime;
use self::filetime::*;
use common::util::*; use common::util::*;
use std::os::unix::fs::PermissionsExt; use std::os::unix::fs::PermissionsExt;
@ -17,7 +10,7 @@ fn at_and_ucmd() -> (AtPath, UCommand) {
#[test] #[test]
fn test_install_help() { fn test_install_help() {
let (at, mut ucmd) = at_and_ucmd(); let (_, mut ucmd) = at_and_ucmd();
let result = ucmd.arg("--help").run(); let result = ucmd.arg("--help").run();

View file

@ -1,5 +1,3 @@
extern crate libc;
use common::util::*; use common::util::*;
static UTIL_NAME: &'static str = "link"; static UTIL_NAME: &'static str = "link";

View file

@ -1,5 +1,6 @@
use common::util::*; use common::util::*;
use tempdir::TempDir; extern crate tempdir;
use self::tempdir::TempDir;
static UTIL_NAME: &'static str = "mktemp"; static UTIL_NAME: &'static str = "mktemp";

View file

@ -1,7 +1,4 @@
extern crate libc;
extern crate time; extern crate time;
extern crate kernel32;
extern crate winapi;
extern crate filetime; extern crate filetime;
use self::filetime::*; use self::filetime::*;

View file

@ -1,5 +1,3 @@
extern crate libc;
use common::util::*; use common::util::*;
static UTIL_NAME: &'static str = "rmdir"; static UTIL_NAME: &'static str = "rmdir";

View file

@ -4,8 +4,8 @@ extern crate regex;
use std::fs::{File, read_dir}; use std::fs::{File, read_dir};
use std::io::{Read, Write}; use std::io::{Read, Write};
use std::path::Path; use std::path::Path;
use rand::{Rng, thread_rng}; use self::rand::{Rng, thread_rng};
use regex::Regex; use self::regex::Regex;
use common::util::*; use common::util::*;
static UTIL_NAME: &'static str = "split"; static UTIL_NAME: &'static str = "split";

View file

@ -1,19 +1,6 @@
extern crate filetime;
extern crate libc;
extern crate rand;
extern crate regex;
extern crate tempdir;
extern crate time;
#[cfg(windows)] extern crate kernel32;
#[cfg(windows)] extern crate winapi;
#[macro_use] #[macro_use]
mod common; mod common;
#[path="../src/factor/sieve.rs"]
mod sieve;
// For conditional compilation // For conditional compilation
macro_rules! unix_only { macro_rules! unix_only {
($($fea:expr, $m:ident);+) => { ($($fea:expr, $m:ident);+) => {