From bde5c1356e19add51af4bc31c6665f74fc33c6f8 Mon Sep 17 00:00:00 2001 From: Woohyun Jung Date: Thu, 4 May 2023 14:44:24 +0900 Subject: [PATCH] Add unittest [ 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 | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/packaging/rust-radium.spec b/packaging/rust-radium.spec index c40adb2..c5c5488 100644 --- a/packaging/rust-radium.spec +++ b/packaging/rust-radium.spec @@ -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 # ========================================================== -- 2.34.1