pub struct Config { /* private fields */ }
Expand description
Global config for running a bunch of tooltests Accumulates statistics
Implementations
sourceimpl Config
impl Config
sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
new
Examples found in repository?
More examples
src/bin/cdx/tooltest_main.rs (line 14)
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
pub fn main(argv: &[String], settings: &mut Settings) -> Result<()> {
let prog = args::ProgSpec::new("Select uniq lines.", args::FileCount::Many);
const A: [ArgSpec; 4] = [
arg! {"verbose", "v", "", "Print name of each test before execution."},
arg! {"bin", "b", "Dir", "Location of executables to test"},
arg! {"tmp", "t", "Dir", "Use this as a persistant tmp dir, rather than creating an ephemeral one."},
arg! {"file-format", "", "", "Describe format for '.test' files."},
];
let (args, files) = args::parse(&prog, &A, argv, settings)?;
let mut config = Config::new()?;
let mut verbose = false;
for x in args {
if x.name == "bin" {
config.bin(&x.value);
} else if x.name == "verbose" {
verbose = true;
} else if x.name == "tmp" {
config.tmp(&x.value)?;
} else if x.name == "file-format" {
show_format();
return Ok(());
} else {
unreachable!();
}
}
for x in &files {
if verbose {
eprintln!("{}", x);
}
config.run(x);
}
config.report()
}
sourcepub fn tmp(&mut self, path: &str) -> Result<()>
pub fn tmp(&mut self, path: &str) -> Result<()>
set tmp dir
Examples found in repository?
src/bin/cdx/tooltest_main.rs (line 22)
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
pub fn main(argv: &[String], settings: &mut Settings) -> Result<()> {
let prog = args::ProgSpec::new("Select uniq lines.", args::FileCount::Many);
const A: [ArgSpec; 4] = [
arg! {"verbose", "v", "", "Print name of each test before execution."},
arg! {"bin", "b", "Dir", "Location of executables to test"},
arg! {"tmp", "t", "Dir", "Use this as a persistant tmp dir, rather than creating an ephemeral one."},
arg! {"file-format", "", "", "Describe format for '.test' files."},
];
let (args, files) = args::parse(&prog, &A, argv, settings)?;
let mut config = Config::new()?;
let mut verbose = false;
for x in args {
if x.name == "bin" {
config.bin(&x.value);
} else if x.name == "verbose" {
verbose = true;
} else if x.name == "tmp" {
config.tmp(&x.value)?;
} else if x.name == "file-format" {
show_format();
return Ok(());
} else {
unreachable!();
}
}
for x in &files {
if verbose {
eprintln!("{}", x);
}
config.run(x);
}
config.report()
}
sourcepub fn bin(&mut self, path: &str)
pub fn bin(&mut self, path: &str)
set bin dir
Examples found in repository?
src/bin/cdx/tooltest_main.rs (line 18)
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
pub fn main(argv: &[String], settings: &mut Settings) -> Result<()> {
let prog = args::ProgSpec::new("Select uniq lines.", args::FileCount::Many);
const A: [ArgSpec; 4] = [
arg! {"verbose", "v", "", "Print name of each test before execution."},
arg! {"bin", "b", "Dir", "Location of executables to test"},
arg! {"tmp", "t", "Dir", "Use this as a persistant tmp dir, rather than creating an ephemeral one."},
arg! {"file-format", "", "", "Describe format for '.test' files."},
];
let (args, files) = args::parse(&prog, &A, argv, settings)?;
let mut config = Config::new()?;
let mut verbose = false;
for x in args {
if x.name == "bin" {
config.bin(&x.value);
} else if x.name == "verbose" {
verbose = true;
} else if x.name == "tmp" {
config.tmp(&x.value)?;
} else if x.name == "file-format" {
show_format();
return Ok(());
} else {
unreachable!();
}
}
for x in &files {
if verbose {
eprintln!("{}", x);
}
config.run(x);
}
config.report()
}
sourcepub fn report(&self) -> Result<()>
pub fn report(&self) -> Result<()>
report
Examples found in repository?
src/bin/cdx/tooltest_main.rs (line 36)
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
pub fn main(argv: &[String], settings: &mut Settings) -> Result<()> {
let prog = args::ProgSpec::new("Select uniq lines.", args::FileCount::Many);
const A: [ArgSpec; 4] = [
arg! {"verbose", "v", "", "Print name of each test before execution."},
arg! {"bin", "b", "Dir", "Location of executables to test"},
arg! {"tmp", "t", "Dir", "Use this as a persistant tmp dir, rather than creating an ephemeral one."},
arg! {"file-format", "", "", "Describe format for '.test' files."},
];
let (args, files) = args::parse(&prog, &A, argv, settings)?;
let mut config = Config::new()?;
let mut verbose = false;
for x in args {
if x.name == "bin" {
config.bin(&x.value);
} else if x.name == "verbose" {
verbose = true;
} else if x.name == "tmp" {
config.tmp(&x.value)?;
} else if x.name == "file-format" {
show_format();
return Ok(());
} else {
unreachable!();
}
}
for x in &files {
if verbose {
eprintln!("{}", x);
}
config.run(x);
}
config.report()
}
sourcepub fn run(&mut self, file: &str)
pub fn run(&mut self, file: &str)
run
Examples found in repository?
src/bin/cdx/tooltest_main.rs (line 34)
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
pub fn main(argv: &[String], settings: &mut Settings) -> Result<()> {
let prog = args::ProgSpec::new("Select uniq lines.", args::FileCount::Many);
const A: [ArgSpec; 4] = [
arg! {"verbose", "v", "", "Print name of each test before execution."},
arg! {"bin", "b", "Dir", "Location of executables to test"},
arg! {"tmp", "t", "Dir", "Use this as a persistant tmp dir, rather than creating an ephemeral one."},
arg! {"file-format", "", "", "Describe format for '.test' files."},
];
let (args, files) = args::parse(&prog, &A, argv, settings)?;
let mut config = Config::new()?;
let mut verbose = false;
for x in args {
if x.name == "bin" {
config.bin(&x.value);
} else if x.name == "verbose" {
verbose = true;
} else if x.name == "tmp" {
config.tmp(&x.value)?;
} else if x.name == "file-format" {
show_format();
return Ok(());
} else {
unreachable!();
}
}
for x in &files {
if verbose {
eprintln!("{}", x);
}
config.run(x);
}
config.report()
}
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more