Add unittest accepted/tizen_rust tizen accepted/tizen/rust/20231016.021718
authorDongHun Kwak <dh0128.kwak@samsung.com>
Thu, 8 Jun 2023 02:27:37 +0000 (11:27 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Thu, 8 Jun 2023 02:27:37 +0000 (11:27 +0900)
[   16s] + ./ptr_meta
[   16s]
[   16s] running 4 tests
[   16s] test tests::last_field_dst ... ok
[   16s] test tests::sized_types ... ok
[   16s] test tests::trait_objects ... ok
[   16s] test tests::unsized_types ... ok
[   16s]
[   16s] test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s

packaging/rust-ptr_meta.spec

index a830c73..28a44d4 100644 (file)
@@ -51,6 +51,18 @@ 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"' \
+        %rust_dylib_extern ptr_meta_derive \
+        ./src/lib.rs
+
+./%{real_crate_name}
+%endif
+
 %clean
 
 %post -p /sbin/ldconfig