summaryrefslogtreecommitdiff
path: root/packaging/rust-async-channel.spec
diff options
context:
space:
mode:
Diffstat (limited to 'packaging/rust-async-channel.spec')
-rw-r--r--packaging/rust-async-channel.spec26
1 files changed, 24 insertions, 2 deletions
diff --git a/packaging/rust-async-channel.spec b/packaging/rust-async-channel.spec
index 30bffb4..3d0db2c 100644
--- a/packaging/rust-async-channel.spec
+++ b/packaging/rust-async-channel.spec
@@ -31,8 +31,10 @@ Requires: rust-concurrent-queue
# ==========================================================
# dev-dependencies
# ==========================================================
-# BuildRequires: rust-easy-parallel
-# BuildRequires: rust-futures-lite
+%if 0%{?run_tests}
+BuildRequires: rust-easy-parallel
+BuildRequires: rust-futures-lite
+%endif
%description
@@ -60,6 +62,26 @@ 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}
+for unit_test in "bounded" "unbounded"
+do
+%{rustc_std_build} --test --crate-type=dylib \
+ --crate-name=${unit_test} \
+ %{?rustc_edition:--edition=%{rustc_edition}} \
+ --extern %{real_crate_name}=./lib%{real_crate_name}.so \
+ %rust_dylib_extern easy_parallel \
+ %rust_dylib_extern futures_lite \
+ ./tests/${unit_test}.rs
+done
+
+for unit_test in "bounded" "unbounded"
+do
+./${unit_test}
+done
+
+%endif
+
%clean
%post -p /sbin/ldconfig