summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-12-04 12:43:26 +0200
committerLars Wirzenius <liw@liw.fi>2021-12-04 12:43:26 +0200
commit684b96b132282a4723e9fa847746b13ee0900ecb (patch)
tree06444148bbc93cf809720a12c95f8c4b45a8cfd5
parent69d172e06ce957d24e8ff07e42120ad2006bdc9a (diff)
downloadobnam-benchmark-684b96b132282a4723e9fa847746b13ee0900ecb.tar.gz
rustt funcs
Sponsored-by: author
-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,
+ )?;
+}