From 06b571b899ce6ff87ec0562234f2e2d1fc8d796b Mon Sep 17 00:00:00 2001 From: Roy7Kim Date: Thu, 11 May 2023 13:49:08 +0900 Subject: [PATCH] Add unittest [ 20s] + ./smawk [ 20s] [ 20s] running 19 tests [ 20s] test monge::tests::is_monge_handles_overflow ... ok [ 20s] test monge::tests::monge_constant_cols ... ok [ 20s] test monge::tests::monge_constant_rows ... ok [ 20s] test monge::tests::monge_lower_left ... ok [ 20s] test monge::tests::monge_upper_right ... ok [ 20s] test tests::online_1x1 ... ok [ 20s] test tests::online_2x2 ... ok [ 20s] test tests::online_4x4 ... ok [ 20s] test tests::online_3x3 ... ok [ 20s] test tests::online_5x5 ... ok [ 20s] test tests::online_works_with_partial_ord ... ok [ 20s] test tests::smawk_2x2 ... ok [ 20s] test tests::smawk_1x2 ... ok [ 20s] test tests::smawk_1x1 ... ok [ 20s] test tests::smawk_3x3 ... ok [ 20s] test tests::smawk_2x1 ... ok [ 20s] test tests::smawk_4x4 ... ok [ 20s] test tests::smawk_5x5 ... ok [ 20s] test tests::smawk_works_with_partial_ord ... ok [ 20s] [ 20s] test result: ok. 19 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.03s --- packaging/rust-smawk.spec | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packaging/rust-smawk.spec b/packaging/rust-smawk.spec index cfe757e..0c9acb6 100644 --- a/packaging/rust-smawk.spec +++ b/packaging/rust-smawk.spec @@ -56,6 +56,16 @@ cp %{SOURCE1} . install -d -m 0755 %{buildroot}%{_rust_dylibdir} install -m 0644 lib%{real_crate_name}.so %{buildroot}/%{_rust_dylibdir}/lib%{real_crate_name}.so +%check +%if 0%{?run_tests} +%{rustc_std_build} --test --crate-type=dylib \ + --crate-name=%{real_crate_name} \ + %{?rustc_edition:--edition=%{rustc_edition}} \ + ./src/lib.rs + +./%{real_crate_name} +%endif + %clean %post -p /sbin/ldconfig -- 2.34.1