chiark / gitweb /
apitest: Prepare for at-bundles
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 17 May 2021 17:05:13 +0000 (18:05 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 17 May 2021 17:15:28 +0000 (18:15 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
apitest/at-bundles.rs [new file with mode: 0644]
apitest/at-otter.rs
apitest/main.rs

diff --git a/apitest/at-bundles.rs b/apitest/at-bundles.rs
new file mode 100644 (file)
index 0000000..a286802
--- /dev/null
@@ -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<RefCell<SetupCore>>;
+
+#[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 })?;
+}
index f5cb71e7bd2f6c07a0a82b3ea88a853affdf8f19..b0e6aedb49a37fe5327fbe089c949711b9920c85 100644 (file)
@@ -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<RefCell<SetupCore>>;
-
 #[allow(dead_code)]
 struct Ctx {
   opts: Opts,
index 8189752317d79d0049abb5f75d44758e36a2a845..71dda64caaf234f7e85248b6f02a27d1bd791bfd 100644 (file)
@@ -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<RefCell<SetupCore>>;
+
+portmanteau_has!("at-otter.rs",   at_otter);
+portmanteau_has!("at-bundles.rs", at_bundles);
 
 #[throws(AE)]
 fn main() { portmanteau_main("at")? }