From: Roy7Kim Date: Fri, 28 Apr 2023 06:44:46 +0000 (+0900) Subject: Add unittest X-Git-Tag: accepted/tizen/rust/20231016.022214^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2674bff874e5614d3b8b9f8a4cebaf0eddf60f87;p=platform%2Fupstream%2Frust-walkdir.git Add unittest [ 32s] + ./walkdir [ 32s] [ 32s] running 44 tests [ 32s] test tests::recursive::contents_first ... ok [ 32s] test tests::recursive::empty ... ok [ 32s] test tests::recursive::empty_file ... ok [ 32s] test tests::recursive::empty_file_follow ... ok [ 32s] test tests::recursive::empty_follow ... ok [ 32s] test tests::recursive::many_dirs ... ok [ 32s] test tests::recursive::many_files ... ok [ 32s] test tests::recursive::filter_entry ... ok [ 32s] test tests::recursive::max_depth_0 ... ok [ 32s] test tests::recursive::many_mixed ... ok [ 32s] test tests::recursive::max_depth_1 ... ok [ 32s] test tests::recursive::max_depth_2 ... ok [ 32s] test tests::recursive::min_depth_1 ... ok [ 32s] test tests::recursive::min_depth_2 ... ok [ 32s] test tests::recursive::min_max_depth_diff_0 ... ok [ 32s] test tests::recursive::min_max_depth_diff_1 ... ok [ 32s] test tests::recursive::min_max_depth_diff_nada ... ok [ 32s] test tests::recursive::nested ... ok [ 32s] test tests::recursive::one_dir ... ok [ 32s] test tests::recursive::nested_small_max_open ... ok [ 32s] test tests::recursive::one_dir_one_file ... ok [ 32s] test tests::recursive::one_file ... ok [ 32s] test tests::recursive::regression_skip_current_dir ... ok [ 32s] test tests::recursive::same_file_system ... ok [ 32s] test tests::recursive::send_sync_traits ... ok [ 32s] test tests::recursive::siblings ... ok [ 32s] test tests::recursive::skip_current_dir ... ok [ 32s] test tests::recursive::sort_by ... ok [ 32s] test tests::recursive::sort_by_file_name ... ok [ 32s] test tests::recursive::sort_by_key ... ok [ 32s] test tests::recursive::sort_max_open ... ok [ 32s] test tests::recursive::sym_dir_follow ... ok [ 32s] test tests::recursive::sym_dir_nofollow ... ok [ 32s] test tests::recursive::sym_dir_self_loop_io_error ... ok [ 32s] test tests::recursive::sym_file_follow ... ok [ 32s] test tests::recursive::sym_file_nofollow ... ok [ 32s] test tests::recursive::sym_file_self_loop_io_error ... ok [ 32s] test tests::recursive::sym_noloop ... ok [ 32s] test tests::recursive::sym_root_dir_follow ... ok [ 32s] test tests::recursive::sym_root_file_follow ... ok [ 32s] test tests::recursive::sym_root_dir_nofollow ... ok [ 32s] test tests::recursive::sym_root_file_nofollow ... ok [ 32s] test tests::recursive::sym_loop_detect ... ok [ 32s] test tests::recursive::sym_self_loop_no_error ... ok [ 32s] [ 32s] test result: ok. 44 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.06s --- diff --git a/packaging/rust-walkdir.spec b/packaging/rust-walkdir.spec index 9c1d067..d1e5bdc 100644 --- a/packaging/rust-walkdir.spec +++ b/packaging/rust-walkdir.spec @@ -56,6 +56,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}} \ + --extern same_file=%{_rust_dylibdir}/libsame_file.so \ + ./src/lib.rs + +./%{real_crate_name} +%endif + %clean %post -p /sbin/ldconfig