summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy7Kim <myoungwoon.kim@samsung.com>2023-05-11 13:54:34 +0900
committerRoy7Kim <myoungwoon.kim@samsung.com>2023-05-11 13:54:46 +0900
commit5327e53d8bcd4f99547cc0716943598546bedd68 (patch)
tree1d17e024717538e52651d7c3a577be7838d357f6
parente4ffaa7a3b005b0ff1f576a020275b240ed1e7e5 (diff)
downloadrust-smallvec-5327e53d8bcd4f99547cc0716943598546bedd68.tar.gz
rust-smallvec-5327e53d8bcd4f99547cc0716943598546bedd68.tar.bz2
rust-smallvec-5327e53d8bcd4f99547cc0716943598546bedd68.zip
Add unittest
[ 28s] + ./smallvec [ 28s] [ 28s] running 57 tests [ 28s] test tests::drain ... ok [ 28s] test tests::drain_forget ... ok [ 28s] test tests::drain_rev ... ok [ 28s] test tests::empty_macro ... ok [ 28s] test tests::grow_spilled_same_size ... ok [ 28s] test tests::drain_overflow - should panic ... ok [ 28s] test tests::grow_to_shrink ... ok [ 28s] test tests::insert_many_panic::panic_early_at_end ... ok [ 28s] test tests::insert_many_panic::panic_early_at_start ... ok [ 28s] test tests::insert_many_panic::panic_early_in_middle ... ok [ 28s] test tests::insert_many_panic::panic_late_at_end ... ok [ 28s] test tests::insert_many_panic::panic_late_at_start ... ok [ 28s] test tests::into_iter ... ok [ 28s] test tests::into_iter_drop ... ok [ 28s] test tests::issue_4 ... ok [ 28s] test tests::into_iter_rev ... ok [ 28s] test tests::issue_5 ... ok [ 28s] test tests::resumable_extend ... ok [ 28s] test tests::shrink_to_fit_unspill ... ok [ 28s] test tests::test_as_mut ... ok [ 28s] test tests::test_as_ref ... ok [ 28s] test tests::test_borrow ... ok [ 28s] test tests::test_borrow_mut ... ok [ 28s] test tests::test_capacity ... ok [ 28s] test tests::test_clone_from ... ok [ 28s] test tests::test_double_spill ... ok [ 28s] test tests::test_eq ... ok [ 28s] test tests::test_drop_panic_smallvec - should panic ... ok [ 28s] test tests::test_dedup ... ok [ 28s] test tests::test_exact_size_iterator ... ok [ 28s] test tests::test_from_slice ... ok [ 28s] test tests::test_from_vec ... ok [ 28s] test tests::test_extend_from_slice ... ok [ 28s] test tests::test_hash ... ok [ 28s] test tests::test_from ... ok [ 28s] test tests::test_inline ... ok [ 28s] test tests::test_insert_many ... ok [ 28s] test tests::test_insert_from_slice ... ok [ 28s] test tests::test_insert_many_long_hint ... ok [ 28s] test tests::test_insert_many_overflow ... ok [ 28s] test tests::test_insert_many_short_hint ... ok [ 28s] test tests::test_into_inner ... ok [ 28s] test tests::test_into_iter_as_slice ... ok [ 28s] test tests::test_into_iter_clone ... ok [ 28s] test tests::test_into_vec ... ok [ 28s] test tests::test_into_iter_clone_empty_smallvec ... ok [ 28s] test tests::test_into_iter_clone_partially_consumed_iterator ... ok [ 28s] test tests::test_invalid_grow - should panic ... ok [ 28s] test tests::test_ord ... ok [ 28s] test tests::test_resize ... ok [ 28s] test tests::test_retain ... ok [ 28s] test tests::test_spill ... ok [ 28s] test tests::test_truncate ... ok [ 28s] test tests::test_with_capacity ... ok [ 28s] test tests::test_zero ... ok [ 28s] test tests::uninhabited ... ok [ 28s] test tests::zero_size_items ... ok [ 28s] [ 28s] test result: ok. 57 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.07s
-rw-r--r--packaging/rust-smallvec.spec11
1 files changed, 11 insertions, 0 deletions
diff --git a/packaging/rust-smallvec.spec b/packaging/rust-smallvec.spec
index 92ccd17..820395d 100644
--- a/packaging/rust-smallvec.spec
+++ b/packaging/rust-smallvec.spec
@@ -51,6 +51,17 @@ 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} \
+ -larbitrary \
+ -lserde \
+ ./src/lib.rs
+
+./%{real_crate_name}
+%endif
+
%clean
%post -p /sbin/ldconfig