Add unittest accepted/tizen_rust tizen accepted/tizen/rust/20231016.021554
authorDongHun Kwak <dh0128.kwak@samsung.com>
Wed, 7 Jun 2023 00:58:10 +0000 (09:58 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Wed, 7 Jun 2023 00:58:10 +0000 (09:58 +0900)
[   25s] + ./partial_io
[   25s]
[   25s] running 2 tests
[   25s] test read::tests::test_sendable ... ok
[   25s] test write::tests::test_sendable ... ok
[   25s]
[   25s] test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s

packaging/rust-partial-io.spec

index 857aa5476df5c5f3ec2cc1c1dcb0ac988adacbb5..ca5897c512fdf47b635751bcc11f45e014758b2f 100644 (file)
@@ -65,6 +65,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}} \
+        --cfg='feature="quickcheck1"' \
+        %rust_dylib_extern quickcheck \
+        %rust_dylib_extern rand \
+        ./src/lib.rs
+
+./%{real_crate_name}
+%endif
+
 %clean
 
 %post -p /sbin/ldconfig