summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packaging/rust-signal-hook-registry.spec11
1 files changed, 11 insertions, 0 deletions
diff --git a/packaging/rust-signal-hook-registry.spec b/packaging/rust-signal-hook-registry.spec
index 3aaa49a..3129fa6 100644
--- a/packaging/rust-signal-hook-registry.spec
+++ b/packaging/rust-signal-hook-registry.spec
@@ -55,6 +55,17 @@ 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}} \
+ --extern libc=%{_rust_dylibdir}/liblibc.so \
+ ./src/lib.rs
+
+./%{real_crate_name}
+%endif
+
%clean
%post -p /sbin/ldconfig