Add unittest accepted/tizen_rust accepted/tizen_unified accepted/tizen_unified_dev accepted/tizen_unified_x tizen accepted/tizen/rust/20231016.021140 accepted/tizen/unified/20240328.122029 accepted/tizen/unified/dev/20240620.001431 accepted/tizen/unified/x/20240328.130625
authorDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 23 May 2023 05:36:15 +0000 (14:36 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 23 May 2023 05:36:15 +0000 (14:36 +0900)
[   15s] + ./either
[   15s]
[   15s] running 7 tests
[   15s] test basic ... ok
[   15s] test deref ... ok
[   15s] test iter ... ok
[   15s] test error ... ok
[   15s] test macros ... ok
[   15s] test read_write ... ok
[   15s] test seek ... ok
[   15s]
[   15s] test result: ok. 7 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.02s

packaging/rust-either.spec

index be528d3..4c5ea58 100644 (file)
@@ -55,6 +55,16 @@ 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="use_std"' \
+        ./src/lib.rs
+
+./%{real_crate_name}
+%endif
 %clean
 
 %post -p /sbin/ldconfig