Add unittest accepted/tizen_rust tizen accepted/tizen/rust/20231016.020835
authorDongHun Kwak <dh0128.kwak@samsung.com>
Wed, 19 Apr 2023 06:37:55 +0000 (15:37 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Wed, 19 Apr 2023 06:37:55 +0000 (15:37 +0900)
[   50s] + ./avif_serialize
[   50s]
[   50s] running 5 tests
[   50s] test premultiplied_flag ... ok
[   50s] test test_roundtrip_parse_avif_colr ... ok
[   50s] test test_roundtrip_parse_avif ... ok
[   50s] test test_roundtrip_parse_mp4 ... ok
[   50s] test test_roundtrip_parse_mp4_alpha ... ok
[   50s]
[   50s] test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.03s

packaging/rust-avif-serialize.spec

index 7603d8981c43205a5a837fb49c7822b943ec8626..42ebc25ecc02f7b7024f64d59118008a3bdb1beb 100644 (file)
@@ -28,7 +28,10 @@ Requires:       rust-arrayvec
 # ==========================================================
 # dev-dependencies
 # ==========================================================
-# BuildRequires:  rust-avif-parse 
+%if 0%{?run_tests}
+BuildRequires:  rust-avif-parse 
+BuildRequires:  rust-mp4parse
+%endif
 
 
 %description
@@ -56,6 +59,19 @@ 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 arrayvec \
+        %rust_dylib_extern avif_parse \
+        %rust_dylib_extern mp4parse \
+        ./src/lib.rs
+
+./%{real_crate_name}
+%endif
+
 %clean
 
 %post -p /sbin/ldconfig