summaryrefslogtreecommitdiff
path: root/subplot/benchmark.rs
blob: 1a64ecccae6c2a8a25506e3073dc8c7053831f4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Implementations of Subplot scenario steps for sshca.md.

use subplotlib::steplibrary::runcmd::Runcmd;

use std::path::Path;

#[derive(Default)]
struct SubplotContext {}

impl ContextElement for SubplotContext {}

#[step]
#[context(SubplotContext)]
#[context(Runcmd)]
fn install_rust_program(context: &ScenarioContext) {
    let target_exe = env!("CARGO_BIN_EXE_obnam-benchmark");
    let target_path = Path::new(target_exe);
    let target_path = target_path.parent().ok_or("No parent?")?;
    context.with_mut(
        |context: &mut Runcmd| {
            context.prepend_to_path(target_path);
            Ok(())
        },
        false,
    )?;
}