diff options
-rw-r--r-- | packaging/rust-assert_matches.spec | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/packaging/rust-assert_matches.spec b/packaging/rust-assert_matches.spec index 3427430..219a024 100644 --- a/packaging/rust-assert_matches.spec +++ b/packaging/rust-assert_matches.spec @@ -51,6 +51,25 @@ 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} +export unit_test_list="selective_import1 selective_import2" +for unit_test in ${unit_test_list} +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 \ + ./tests/${unit_test}.rs +done + +for unit_test in ${unit_test_list} +do +./${unit_test} +done + +%endif + %clean %post -p /sbin/ldconfig |