pub struct Config { /* private fields */ }
Expand description

Global config for running a bunch of tooltests Accumulates statistics

Implementations

new

Examples found in repository?
src/tooltest.rs (line 473)
472
473
474
    fn default() -> Self {
        Self::new().unwrap()
    }
More examples
Hide additional 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()
}

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()
}

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()
}

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()
}

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

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more