Add unittest accepted/tizen_rust tizen accepted/tizen/rust/20231016.021805
authorDongHun Kwak <dh0128.kwak@samsung.com>
Thu, 8 Jun 2023 06:46:54 +0000 (15:46 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Thu, 8 Jun 2023 06:46:54 +0000 (15:46 +0900)
packaging/rust-rkyv.spec

index 4bc301f163fce1b4cb92e5e8da0be5a50513493f..06ab9d33da929eab363852ea0537110d0add16c5 100644 (file)
@@ -69,6 +69,22 @@ 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}} \
+        --cfg='feature="std"' \
+        --cfg='feature="alloc"' \
+        --cfg='feature="size_32"' \
+        %rust_dylib_extern ptr_meta \
+        %rust_dylib_extern seahash \
+        %rust_dylib_extern rkyv_derive \
+        ./src/lib.rs
+
+./%{real_crate_name}
+%endif
+
 %clean
 
 %post -p /sbin/ldconfig