From 17e0f624bbdc7fd78125d332ae582a9be876d1b0 Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Tue, 23 May 2023 10:23:42 +0900 Subject: [PATCH] Add unittest [ 44s] + ./dirs [ 44s] [ 44s] running 2 tests [ 44s] test lin::tests::test_file_user_dirs_exists ... ok [ 44s] test tests::test_dirs ... ok [ 44s] [ 44s] test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s --- packaging/rust-dirs.spec | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packaging/rust-dirs.spec b/packaging/rust-dirs.spec index 4d259cd..143a137 100644 --- a/packaging/rust-dirs.spec +++ b/packaging/rust-dirs.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}} \ + %rust_dylib_extern dirs_sys \ + ./src/lib.rs + +./%{real_crate_name} +%endif + %clean %post -p /sbin/ldconfig -- 2.7.4