Add unittest accepted/tizen_rust tizen accepted/tizen/rust/20231016.021741
authorWoohyun Jung <wh0705.jung@samsung.com>
Thu, 4 May 2023 06:06:30 +0000 (15:06 +0900)
committerWoohyun Jung <wh0705.jung@samsung.com>
Thu, 4 May 2023 06:06:30 +0000 (15:06 +0900)
[    9s] + ./rand_xorshift
[    9s]
[    9s] running 4 tests
[    9s] test test_xorshift_clone ... ok
[    9s] test test_xorshift_construction ... ok
[    9s] test test_xorshift_true_values ... ok
[    9s] test test_xorshift_zero_seed ... ok
[    9s]
[    9s] test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s

packaging/rust-rand_xorshift.spec

index d009ddb69c67a0d2ee69831a60e40d6c32d2eca2..7088ca8363e6c7dfbcac82c7475da88f45f142f8 100644 (file)
@@ -49,6 +49,18 @@ cp %{SOURCE1} .
         %rust_dylib_extern rand_core \
         ./src/lib.rs
 
+%check
+%if 0%{?run_tests}
+%{rustc_std_build} --test --crate-type=dylib \
+        --crate-name=%{real_crate_name} \
+        %{?rustc_edition:--edition=%{rustc_edition}} \
+        %rust_dylib_extern rand_core \
+        --extern %{real_crate_name}=lib%{real_crate_name}.so \
+        ./tests/mod.rs
+
+./%{real_crate_name}
+%endif
+
 # ==========================================================
 # install section
 # ==========================================================