summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author김명운/Tizen Platform Lab(SR)/삼성전자 <myoungwoon.kim@samsung.com>2023-05-25 10:00:50 +0900
committerGitHub Enterprise <noreply-CODE@samsung.com>2023-05-25 10:00:50 +0900
commit458f4fe4f5b1d36b7fa6699ebeb9c18877ef6465 (patch)
treeb5eed52d2c659d79a091617f174d64b9eb513e3d
parentedc4a337901d26cb30514002dd0eb55ad145d972 (diff)
parent8b5670bc777eb0fb04bae6000966149a5e486b2b (diff)
downloadrust-minimal-lexical-accepted/tizen_rust.tar.gz
rust-minimal-lexical-accepted/tizen_rust.tar.bz2
rust-minimal-lexical-accepted/tizen_rust.zip
Merge pull request #1 from myoungwoon-kim/devaccepted/tizen/rust/20231016.021454tizenaccepted/tizen_rust
Add unittest
-rw-r--r--packaging/rust-minimal-lexical.spec22
1 files changed, 22 insertions, 0 deletions
diff --git a/packaging/rust-minimal-lexical.spec b/packaging/rust-minimal-lexical.spec
index ec08a5a..a751e50 100644
--- a/packaging/rust-minimal-lexical.spec
+++ b/packaging/rust-minimal-lexical.spec
@@ -50,6 +50,28 @@ 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}
+
+export unit_test_list="bellerophon_tests integration_tests lemire_tests libm_tests mask_tests number_tests
+ parse_tests rounding_tests slow_tests vec_tests"
+
+for unit_test in ${unit_test_list}
+do
+%{rustc_std_build} --test --crate-type=dylib \
+ --crate-name=${unit_test} \
+ %{?rustc_edition:--edition=%{rustc_edition}} \
+ --extern %{real_crate_name}=./lib%{real_crate_name}.so \
+ --cfg='feature="std"' \
+ ./tests/${unit_test}.rs
+done
+
+for unit_test in ${unit_test_list}
+do
+./${unit_test}
+done
+%endif
+
%clean
%post -p /sbin/ldconfig