summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2023-05-16 13:44:15 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2023-05-16 13:44:15 +0900
commit2a0fe6198243b7eeddae1785dc0c2bf265b940a9 (patch)
tree855182164e2d72956834b3772f2724ab1f6f6fb8
parent39701e42e54015c3cb2dbb95e7db56bb8a41fb63 (diff)
downloadrust-crc32fast-tizen.tar.gz
rust-crc32fast-tizen.tar.bz2
rust-crc32fast-tizen.zip
[ 23s] + ./crc32fast [ 23s] [ 23s] running 4 tests [ 23s] test baseline::test::slow ... ok [ 23s] test baseline::test::fast_16_is_the_same_as_slow ... ok [ 23s] test test::combine ... ok [ 23s] test test::combine_from_len ... ok [ 23s] [ 23s] test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.02s
-rw-r--r--packaging/rust-crc32fast.spec16
1 files changed, 15 insertions, 1 deletions
diff --git a/packaging/rust-crc32fast.spec b/packaging/rust-crc32fast.spec
index 155bb6d..660548e 100644
--- a/packaging/rust-crc32fast.spec
+++ b/packaging/rust-crc32fast.spec
@@ -27,9 +27,11 @@ Requires: rust-cfg-if
# ==========================================================
# dev-dependencies
# ==========================================================
+%if 0%{?run_tests}
+BuildRequires: rust-quickcheck
# BuildRequires: rust-bencher
-# BuildRequires: rust-quickcheck
# BuildRequires: rust-rand
+%endif
%description
@@ -58,6 +60,18 @@ 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}} \
+ --cfg='feature="std"' \
+ --extern cfg_if=%{_rust_dylibdir}/libcfg_if.so \
+ ./src/lib.rs
+
+./%{real_crate_name}
+%endif
+
%clean
%post -p /sbin/ldconfig