summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--subplot/benchmark.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/subplot/benchmark.rs b/subplot/benchmark.rs
new file mode 100644
index 0000000..1a64ecc
--- /dev/null
+++ b/subplot/benchmark.rs
@@ -0,0 +1,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,
+ )?;
+}