# ==========================================================
# dev-dependencies
# ==========================================================
-# BuildRequires: rust-cipher
+BuildRequires: rust-cipher
# BuildRequires: rust-hex-literal
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}} \
+ --cfg='feature="hazmat"' \
+ --cfg='feature="zeroize"' \
+ %rust_dylib_extern cfg_if \
+ %rust_dylib_extern cipher \
+ %rust_dylib_extern zeroize \
+ $_RUSTC_EXTERN_PACKAGES_ \
+ ./src/lib.rs
+
+./%{real_crate_name}
+%endif
+
%clean
%post -p /sbin/ldconfig