From: Ian Jackson Date: Tue, 26 Jan 2021 23:05:57 +0000 (+0000) Subject: wdt: Break out game_spec_path X-Git-Tag: otter-0.4.0~673 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=db331a5cafabfd0c4a68f461904bc368094d0732;p=otter.git wdt: Break out game_spec_path Signed-off-by: Ian Jackson --- diff --git a/wdriver.rs b/wdriver.rs index 35dbae41..b2370e34 100644 --- a/wdriver.rs +++ b/wdriver.rs @@ -638,16 +638,25 @@ impl DirSubst { .context(dbg) .context("run otter client")?; } + + #[throws(AE)] + pub fn game_spec_path(&self) -> String { + self.subst("@specs@/demo.game.toml")? + } } #[throws(AE)] pub fn prepare_game(ds: &DirSubst, table: &str) -> InstanceName { - let subst = ds.also(&[("table", &table)]); + let game_spec = ds.game_spec_path()?; + let subst = ds.also(&[ + ("table", table), + ("game_spec", &game_spec), + ]); ds.otter(&subst.ss( "--account server: \ reset \ --reset-table @specs@/test.table.toml \ - @table@ @specs@/demo.game.toml \ + @table@ @game_spec@ \ ")?).context("reset table")?; let instance : InstanceName = table.parse()