Add unittest accepted/tizen_rust tizen accepted/tizen/rust/20231016.021732
authorWoohyun Jung <wh0705.jung@samsung.com>
Thu, 4 May 2023 05:44:24 +0000 (14:44 +0900)
committerWoohyun Jung <wh0705.jung@samsung.com>
Thu, 4 May 2023 05:44:24 +0000 (14:44 +0900)
[    8s] + ./radium
[    8s]
[    8s] running 5 tests
[    8s] test tests::absent_traits ... ok
[    8s] test tests::always_alias ... ok
[    8s] test tests::maybe_atom ... ok
[    8s] test tests::always_cell ... ok
[    8s] test tests::present_traits ... ok
[    8s]
[    8s] test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s

packaging/rust-radium.spec

index c40adb21e640c6aee481f637fb6194209e1f135e..c5c5488f2fc61342151c6ba0b812a79b54bbca5b 100644 (file)
@@ -26,7 +26,9 @@ BuildRequires:  rust
 # ==========================================================
 # dev-dependencies
 # ==========================================================
-# BuildRequires:  rust-static_assertions 
+%if 0%{?run_tests}
+BuildRequires:  rust-static_assertions
+%endif
 
 
 %description
@@ -55,6 +57,24 @@ export RUSTC_TARGET_HAS_ATOMIC=64
         --cfg="target_has_atomic=\"$RUSTC_TARGET_HAS_ATOMIC\"" \
         ./src/lib.rs
 
+%check
+%if 0%{?run_tests}
+%ifarch %{ix86} armv7l armv7hl
+export RUSTC_TARGET_HAS_ATOMIC=32
+%endif
+%ifarch x86_64 aarch64
+export RUSTC_TARGET_HAS_ATOMIC=64
+%endif
+%{rustc_std_build} --test --crate-type=dylib \
+        --crate-name=%{real_crate_name} \
+        %{?rustc_edition:--edition=%{rustc_edition}} \
+        --cfg='feature="atomic"' \
+        --cfg="target_has_atomic=\"$RUSTC_TARGET_HAS_ATOMIC\"" \
+        %rust_dylib_extern static_assertions \
+        ./src/lib.rs
+
+./%{real_crate_name}
+%endif
 # ==========================================================
 # install section
 # ==========================================================