summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author김명운/Tizen Platform Lab(SR)/삼성전자 <myoungwoon.kim@samsung.com>2023-05-12 16:45:03 +0900
committerGitHub Enterprise <noreply-CODE@samsung.com>2023-05-12 16:45:03 +0900
commit699db4ac4c0e52895ab547d257366345156f7605 (patch)
treee091552107e05b3a3fec682541169f87e442bcd7
parentbc2961e568e47f37258d0f5cc27e5560bac708af (diff)
parentfa1bf7e8a3b72903d1206a751365e4f24fe19b57 (diff)
downloadrust-serde_cbor-tizen.tar.gz
rust-serde_cbor-tizen.tar.bz2
rust-serde_cbor-tizen.zip
Merge pull request #1 from myoungwoon-kim/devaccepted/tizen/rust/20231016.021856tizenaccepted/tizen_rust
Add unittest
-rw-r--r--packaging/rust-serde_cbor.spec24
1 files changed, 24 insertions, 0 deletions
diff --git a/packaging/rust-serde_cbor.spec b/packaging/rust-serde_cbor.spec
index 5e9e5e5..777db2d 100644
--- a/packaging/rust-serde_cbor.spec
+++ b/packaging/rust-serde_cbor.spec
@@ -60,6 +60,30 @@ 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="bennofs canonical de enum ser std_types tags value"
+
+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"' \
+ %rust_dylib_extern half \
+ %rust_dylib_extern serde \
+ ./tests/${unit_test}.rs
+done
+
+for unit_test in ${unit_test_list}
+do
+./${unit_test}
+done
+
+%endif
+
%clean
%post -p /sbin/ldconfig