Add unittest accepted/tizen_9.0_unified accepted/tizen_rust accepted/tizen_unified accepted/tizen_unified_dev accepted/tizen_unified_x tizen tizen_9.0 accepted/tizen/9.0/unified/20241030.235254 accepted/tizen/rust/20231016.021025 accepted/tizen/unified/20240328.121820 accepted/tizen/unified/dev/20240620.001224 accepted/tizen/unified/x/20240328.130557 tizen_9.0_m2_release
authorDongHun Kwak <dh0128.kwak@samsung.com>
Thu, 11 May 2023 23:38:55 +0000 (08:38 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Thu, 11 May 2023 23:38:55 +0000 (08:38 +0900)
[   13s] + ./const_random
[   13s]
[   13s] running 6 tests
[   13s] test array ... ok
[   13s] test i64 ... ok
[   13s] test suffixed ... ok
[   13s] test u128 ... ok
[   13s] test u32 ... ok
[   13s] test usize ... ok
[   13s]
[   13s] test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.02s

packaging/rust-const-random.spec

index 7fec40171feb0817eb47e8768636f1477cba95cf..3998bb7e9e9e3e26f54a765af20d99323a742f2e 100644 (file)
@@ -54,6 +54,17 @@ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:%{_rust_dylibdir}
 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}} \
+        --extern %{real_crate_name}=./lib%{real_crate_name}.so \
+        ./tests/tests.rs
+
+./%{real_crate_name}
+%endif
+
 %clean
 
 %post -p /sbin/ldconfig