Add unittest
authorRoy7Kim <myoungwoon.kim@samsung.com>
Fri, 28 Apr 2023 06:44:46 +0000 (15:44 +0900)
committerRoy7Kim <myoungwoon.kim@samsung.com>
Fri, 28 Apr 2023 06:44:59 +0000 (15:44 +0900)
[   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

packaging/rust-walkdir.spec

index 9c1d067333139972c0e1fdd3b73406ee578b5adb..d1e5bdc89c9f2adbb1dd3f8d669ec8c9a9b60d6d 100644 (file)
@@ -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