summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author김명운/Tizen Platform Lab(SR)/삼성전자 <myoungwoon.kim@samsung.com>2023-05-12 13:21:05 +0900
committerGitHub Enterprise <noreply-CODE@samsung.com>2023-05-12 13:21:05 +0900
commit8e4f269072ff1d124590c575711097e75ec5a29c (patch)
tree6d0ad41df8a6809fa47abe38db1e976cc058a09f
parent191dee47099fdd20f19fdddbd759a2ece12e7e80 (diff)
parent53e642938c85bd9f698f7f59a2cc33f3778f4608 (diff)
downloadrust-sha2-tizen.tar.gz
rust-sha2-tizen.tar.bz2
rust-sha2-tizen.zip
Merge pull request #1 from myoungwoon-kim/devaccepted/tizen/rust/20231016.021915tizenaccepted/tizen_rust
Add unittest
-rw-r--r--packaging/rust-sha2.spec28
1 files changed, 26 insertions, 2 deletions
diff --git a/packaging/rust-sha2.spec b/packaging/rust-sha2.spec
index a77fc3a..2a8cc20 100644
--- a/packaging/rust-sha2.spec
+++ b/packaging/rust-sha2.spec
@@ -31,8 +31,11 @@ Requires: rust-digest
# ==========================================================
# dev-dependencies
# ==========================================================
-# BuildRequires: rust-digest
-# BuildRequires: rust-hex-literal
+%if 0%{?run_tests}
+BuildRequires: rust-digest
+BuildRequires: rust-hex-literal
+BuildRequires: rust-blobby
+%endif
%description
@@ -66,6 +69,27 @@ export _RUSTC_EXTERN_PACKAGES_="--extern cpufeatures=%{_rust_dylibdir}/libcpufea
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}
+%ifarch %{ix86} aarch64 x86_64
+export _RUSTC_EXTERN_PACKAGES_="--extern cpufeatures=%{_rust_dylibdir}/libcpufeatures.so"
+%endif
+%{rustc_std_build} --test --crate-type=dylib \
+ --crate-name=%{real_crate_name} \
+ %{?rustc_edition:--edition=%{rustc_edition}} \
+ --extern %{real_crate_name}=lib%{real_crate_name}.so \
+ %rust_dylib_extern cfg_if \
+ %rust_dylib_extern digest \
+ %rust_dylib_extern hex_literal\
+ %rust_dylib_extern blobby \
+ $_RUSTC_EXTERN_PACKAGES_ \
+ ./tests/mod.rs
+
+./%{real_crate_name}
+
+%endif
+
+
%clean
%post -p /sbin/ldconfig