From: Roy7Kim Date: Wed, 3 May 2023 07:38:05 +0000 (+0900) Subject: Add unittest X-Git-Tag: accepted/tizen/rust/20231016.022207^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=70546fe3462657829cbb479d06cef80ff3215ef0;p=platform%2Fupstream%2Frust-version-compare.git Add unittest [ 16s] + ./version_compare [ 16s] [ 16s] running 30 tests [ 16s] test cmp::tests::factor ... ok [ 16s] test cmp::tests::flip ... ok [ 16s] test cmp::tests::from_name ... ok [ 16s] test cmp::tests::from_ord ... ok [ 16s] test cmp::tests::from_sign ... ok [ 16s] test cmp::tests::invert ... ok [ 16s] test cmp::tests::name ... ok [ 16s] test cmp::tests::opposite ... ok [ 16s] test cmp::tests::ord ... ok [ 16s] test cmp::tests::sign ... ok [ 16s] test compare::tests::compare ... ok [ 16s] test compare::tests::compare_to ... ok [ 16s] test manifest::tests::has_max_depth ... ok [ 16s] test part::tests::display ... ok [ 16s] test version::tests::compare ... ok [ 16s] test version::tests::as_str ... ok [ 16s] test version::tests::compare_to ... ok [ 16s] test version::tests::debug ... ok [ 16s] test version::tests::display ... ok [ 16s] test version::tests::from ... ok [ 16s] test version::tests::from_manifest ... ok [ 16s] test version::tests::has_manifest ... ok [ 16s] test version::tests::manifest ... ok [ 16s] test version::tests::part ... ok [ 16s] test version::tests::partial_cmp ... ok [ 16s] test version::tests::partial_eq ... ok [ 16s] test version::tests::parts ... ok [ 16s] test version::tests::parts_ignore_text ... ok [ 16s] test version::tests::parts_max_depth ... ok [ 16s] test version::tests::set_manifest ... ok [ 16s] [ 16s] test result: ok. 30 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.04s --- diff --git a/packaging/rust-version-compare.spec b/packaging/rust-version-compare.spec index eb6232d..6c1cb3f 100644 --- a/packaging/rust-version-compare.spec +++ b/packaging/rust-version-compare.spec @@ -49,6 +49,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