Add unittest
authorRoy7Kim <myoungwoon.kim@samsung.com>
Wed, 3 May 2023 07:38:05 +0000 (16:38 +0900)
committerRoy7Kim <myoungwoon.kim@samsung.com>
Wed, 3 May 2023 07:38:17 +0000 (16:38 +0900)
[   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

packaging/rust-version-compare.spec

index eb6232d893cf76274f98f9952563ac0a27d8ed14..6c1cb3f8242a65d1765378c111b12e3e2bd45144 100644 (file)
@@ -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