summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy7Kim <myoungwoon.kim@samsung.com>2023-05-12 16:44:05 +0900
committerRoy7Kim <myoungwoon.kim@samsung.com>2023-05-12 16:44:15 +0900
commit808f9d99baf5036992b8e9bfb8caa6b45e927694 (patch)
treebbe2ecc0fed66427060a1bcd811ff894d806a204
parent2dbd0e3f5160ad00862c93895bbadc15e00b33dd (diff)
downloadrust-serde-808f9d99baf5036992b8e9bfb8caa6b45e927694.tar.gz
rust-serde-808f9d99baf5036992b8e9bfb8caa6b45e927694.tar.bz2
rust-serde-808f9d99baf5036992b8e9bfb8caa6b45e927694.zip
Add unittest
[ 44s] + ./serde [ 44s] [ 44s] running 1 test [ 44s] test ser::impls::test_format_u8 ... ok [ 44s] [ 44s] test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s
-rw-r--r--packaging/rust-serde.spec13
1 files changed, 13 insertions, 0 deletions
diff --git a/packaging/rust-serde.spec b/packaging/rust-serde.spec
index b58ceae..4da199e 100644
--- a/packaging/rust-serde.spec
+++ b/packaging/rust-serde.spec
@@ -51,6 +51,19 @@ 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}
+%{rustc_std_build} --test --crate-type=dylib \
+ --crate-name=%{real_crate_name} \
+ --cfg='feature="default"' \
+ --cfg='feature="std"' \
+ --cfg='feature="serde_derive"' \
+ -lserde_derive \
+ ./src/lib.rs
+
+./%{real_crate_name}
+%endif
+
%clean
%post -p /sbin/ldconfig