libtest: use #[deriving(Copy)]
This commit is contained in:
parent
64234b3541
commit
ce92437769
@ -110,15 +110,13 @@ impl Show for TestName {
|
||||
}
|
||||
}
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[deriving(Clone, Copy)]
|
||||
enum NamePadding {
|
||||
PadNone,
|
||||
PadOnLeft,
|
||||
PadOnRight,
|
||||
}
|
||||
|
||||
impl Copy for NamePadding {}
|
||||
|
||||
impl TestDesc {
|
||||
fn padded_name(&self, column_count: uint, align: NamePadding) -> String {
|
||||
let mut name = String::from_str(self.name.as_slice());
|
||||
@ -215,14 +213,12 @@ pub struct TestDescAndFn {
|
||||
pub testfn: TestFn,
|
||||
}
|
||||
|
||||
#[deriving(Clone, Encodable, Decodable, PartialEq, Show)]
|
||||
#[deriving(Clone, Copy, Encodable, Decodable, PartialEq, Show)]
|
||||
pub struct Metric {
|
||||
value: f64,
|
||||
noise: f64
|
||||
}
|
||||
|
||||
impl Copy for Metric {}
|
||||
|
||||
impl Metric {
|
||||
pub fn new(value: f64, noise: f64) -> Metric {
|
||||
Metric {value: value, noise: noise}
|
||||
@ -240,7 +236,7 @@ impl Clone for MetricMap {
|
||||
}
|
||||
|
||||
/// Analysis of a single change in metric
|
||||
#[deriving(PartialEq, Show)]
|
||||
#[deriving(Copy, PartialEq, Show)]
|
||||
pub enum MetricChange {
|
||||
LikelyNoise,
|
||||
MetricAdded,
|
||||
@ -249,8 +245,6 @@ pub enum MetricChange {
|
||||
Regression(f64)
|
||||
}
|
||||
|
||||
impl Copy for MetricChange {}
|
||||
|
||||
pub type MetricDiff = BTreeMap<String,MetricChange>;
|
||||
|
||||
// The default console test runner. It accepts the command line
|
||||
@ -287,14 +281,13 @@ pub fn test_main_static(args: &[String], tests: &[TestDescAndFn]) {
|
||||
test_main(args, owned_tests)
|
||||
}
|
||||
|
||||
#[deriving(Copy)]
|
||||
pub enum ColorConfig {
|
||||
AutoColor,
|
||||
AlwaysColor,
|
||||
NeverColor,
|
||||
}
|
||||
|
||||
impl Copy for ColorConfig {}
|
||||
|
||||
pub struct TestOpts {
|
||||
pub filter: Option<Regex>,
|
||||
pub run_ignored: bool,
|
||||
|
Loading…
x
Reference in New Issue
Block a user