summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packaging/rust-const-random.spec11
1 files changed, 11 insertions, 0 deletions
diff --git a/packaging/rust-const-random.spec b/packaging/rust-const-random.spec
index 7fec401..3998bb7 100644
--- a/packaging/rust-const-random.spec
+++ b/packaging/rust-const-random.spec
@@ -54,6 +54,17 @@ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:%{_rust_dylibdir}
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 %{real_crate_name}=./lib%{real_crate_name}.so \
+ ./tests/tests.rs
+
+./%{real_crate_name}
+%endif
+
%clean
%post -p /sbin/ldconfig