mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 11:07:44 +00:00
tests: extern crates in separated test modules
This commit is contained in:
parent
2eeb7b77cc
commit
cfc28ebc05
6 changed files with 17 additions and 23 deletions
0
tests/common/macros.rs
Executable file → Normal file
0
tests/common/macros.rs
Executable file → Normal file
3
tests/common/util.rs
Executable file → Normal file
3
tests/common/util.rs
Executable file → Normal 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";
|
||||||
|
|
|
@ -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))
|
||||||
|
|
|
@ -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";
|
||||||
|
|
||||||
|
|
|
@ -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";
|
||||||
|
|
|
@ -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);+) => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue