From 470e4696e081c8ef1ace784a3c34f893d5a190f4 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 17 May 2021 18:05:13 +0100 Subject: [PATCH] apitest: Prepare for at-bundles Signed-off-by: Ian Jackson --- apitest/at-bundles.rs | 27 +++++++++++++++++++++++++++ apitest/at-otter.rs | 7 +------ apitest/main.rs | 8 +++++++- 3 files changed, 35 insertions(+), 7 deletions(-) create mode 100644 apitest/at-bundles.rs diff --git a/apitest/at-bundles.rs b/apitest/at-bundles.rs new file mode 100644 index 00000000..a286802c --- /dev/null +++ b/apitest/at-bundles.rs @@ -0,0 +1,27 @@ +// Copyright 2020-2021 Ian Jackson and contributors to Otter +// SPDX-License-Identifier: AGPL-3.0-or-later +// There is NO WARRANTY. + +use crate::*; + +type Setup = Rc>; + +#[allow(dead_code)] +struct Ctx { + opts: Opts, + su_rc: Setup, +} + +#[throws(Explode)] +fn tests(_c: Ctx) { +} + +#[throws(Explode)] +pub fn main() { + let (opts, _instance, su) = setup_core( + &[module_path!()], + )?; + + let su_rc = Rc::new(RefCell::new(su)); + tests(Ctx { opts, su_rc })?; +} diff --git a/apitest/at-otter.rs b/apitest/at-otter.rs index f5cb71e7..b0e6aedb 100644 --- a/apitest/at-otter.rs +++ b/apitest/at-otter.rs @@ -2,15 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-or-later // There is NO WARRANTY. -use otter_api_tests::*; - -pub use std::cell::{RefCell, RefMut}; -pub use std::rc::Rc; +use crate::*; pub use index_vec::Idx; -type Setup = Rc>; - #[allow(dead_code)] struct Ctx { opts: Opts, diff --git a/apitest/main.rs b/apitest/main.rs index 81897523..71dda64c 100644 --- a/apitest/main.rs +++ b/apitest/main.rs @@ -4,7 +4,13 @@ pub use otter_api_tests::*; -portmanteau_has!("at-otter.rs", at_otter); +pub use std::cell::{RefCell, RefMut}; +pub use std::rc::Rc; + +type Setup = Rc>; + +portmanteau_has!("at-otter.rs", at_otter); +portmanteau_has!("at-bundles.rs", at_bundles); #[throws(AE)] fn main() { portmanteau_main("at")? } -- 2.30.2