pub use otter::commands::{MgmtCommand, MgmtResponse};
pub use otter::commands::{MgmtGameInstruction, MgmtGameResponse};
pub use otter::commands::{MgmtGameUpdateMode};
+pub use otter::config::*;
pub use otter::{deref_to_field, deref_to_field_mut};
pub use otter::gamestate::{self, Generation, PlayerId};
pub use otter::global::InstanceName;
#[derive(Copy,Clone,Error,Debug)]
#[error("wait status: {0}")]
-struct ExitStatusError(pub std::process::ExitStatus);
+pub struct ExitStatusError(pub std::process::ExitStatus);
impl DirSubst {
pub fn specs_dir(&self) -> String {
fn library_load(&mut self) {
prepare_game(&self.ds, TABLE)?;
- self.otter(&self.ds.ss("library-add @table@ wikimedia chess-blue-?")?)?;
- // xxx make library-add give distinct exit status here
+ let add_err = self.otter(&self.ds.ss(
+ "library-add @table@ wikimedia chess-blue-?"
+ )?)
+ .expect_err("library-add succeeded after reset!");
+ ensure_eq!(add_err.downcast::<ExitStatusError>()?.0.code(),
+ Some(EXIT_NOTFOUND));
// xxx find load markers ids
let _session = self.connect_player(&self.alice)?;
eprintln!("updated game: {}\n\
please adjust markers as desired and run again",
msg);
- return Ok(());
+ exit(EXIT_NOTFOUND);
}
Good([a, b]) => {
// todo: take account of the space used by the markers themselves