Add unittest accepted/tizen_rust tizen accepted/tizen/rust/20231016.020904
authorDongHun Kwak <dh0128.kwak@samsung.com>
Thu, 27 Apr 2023 01:53:31 +0000 (10:53 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Thu, 27 Apr 2023 01:53:31 +0000 (10:53 +0900)
[   14s] running 5 tests
[   14s] test test_eager_digest_pad ... ok
[   14s] test test_eager_paddings ... ok
[   14s] test test_eager_set_data ... ok
[   14s] test test_lazy_digest_pad ... ok
[   14s] test test_try_new ... ok
[   14s]
[   14s] test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s

packaging/rust-block-buffer.spec

index 68921d4013dc889469e3cb14d1e8a3d6c3698416..2d55da2908d78d54f3709c4c9cd3acaecc5cbdc9 100644 (file)
@@ -51,6 +51,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 generic_array \
+        --extern %{real_crate_name}=./lib%{real_crate_name}.so \
+        ./tests/mod.rs
+
+./%{real_crate_name}
+%endif
 %clean
 
 %post -p /sbin/ldconfig