summaryrefslogtreecommitdiff
path: root/packaging
diff options
context:
space:
mode:
Diffstat (limited to 'packaging')
-rw-r--r--packaging/rust-ciborium-ll.spec19
1 files changed, 18 insertions, 1 deletions
diff --git a/packaging/rust-ciborium-ll.spec b/packaging/rust-ciborium-ll.spec
index 4fb9a6b..e99ddca 100644
--- a/packaging/rust-ciborium-ll.spec
+++ b/packaging/rust-ciborium-ll.spec
@@ -30,7 +30,9 @@ Requires: rust-half
# ==========================================================
# dev-dependencies
# ==========================================================
-# BuildRequires: rust-hex
+%if 0%{?run_tests}
+BuildRequires: rust-hex
+%endif
%description
@@ -62,6 +64,21 @@ cp %{SOURCE2} .
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}} \
+ %rust_dylib_extern ciborium_io \
+ %rust_dylib_extern half \
+ %rust_dylib_extern hex \
+ --cfg='feature="std"' \
+ --cfg='feature="alloc"' \
+ ./src/lib.rs
+
+./%{real_crate_name}
+%endif
+
%clean
%post -p /sbin/ldconfig