From ad1ad1856e9d705c77899440db619b6c238d065b Mon Sep 17 00:00:00 2001 From: Agustin Borgna Date: Mon, 15 Jul 2024 11:46:46 +0100 Subject: [PATCH] Test compiled small_eccs in addition to json def --- tket2/src/optimiser/badger.rs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tket2/src/optimiser/badger.rs b/tket2/src/optimiser/badger.rs index 5d632f94..17401208 100644 --- a/tket2/src/optimiser/badger.rs +++ b/tket2/src/optimiser/badger.rs @@ -562,10 +562,16 @@ mod tests { /// A badger optimiser using a reduced set of rewrite rules. #[fixture] - fn badger_opt() -> DefaultBadgerOptimiser { + fn badger_opt_json() -> DefaultBadgerOptimiser { BadgerOptimiser::default_with_eccs_json_file("../test_files/small_eccs.json").unwrap() } + /// A badger optimiser using a reduced set of rewrite rules. + #[fixture] + fn badger_opt_compiled() -> DefaultBadgerOptimiser { + BadgerOptimiser::default_with_rewriter_binary("../test_files/small_eccs.rwr").unwrap() + } + /// A badger optimiser using the complete nam_6_3 rewrite set. /// /// NOTE: This takes a few seconds to load. @@ -576,7 +582,9 @@ mod tests { } #[rstest] - fn rz_rz_cancellation(rz_rz: Circuit, badger_opt: DefaultBadgerOptimiser) { + #[case::compiled(badger_opt_compiled())] + #[case::json(badger_opt_json())] + fn rz_rz_cancellation(rz_rz: Circuit, #[case] badger_opt: DefaultBadgerOptimiser) { let opt_rz = badger_opt.optimise( &rz_rz, BadgerOptions { @@ -589,7 +597,9 @@ mod tests { } #[rstest] - fn rz_rz_cancellation_parallel(rz_rz: Circuit, badger_opt: DefaultBadgerOptimiser) { + #[case::compiled(badger_opt_compiled())] + #[case::json(badger_opt_json())] + fn rz_rz_cancellation_parallel(rz_rz: Circuit, #[case] badger_opt: DefaultBadgerOptimiser) { let mut opt_rz = badger_opt.optimise( &rz_rz, BadgerOptions {