From 7e6e699f73872da188dfa6131377775b26b08f98 Mon Sep 17 00:00:00 2001 From: Roy7Kim Date: Fri, 12 May 2023 16:00:19 +0900 Subject: Add unittest [ 102s] + ./serde_derive [ 102s] [ 102s] running 2 tests [ 102s] test internals::case::rename_fields ... ok [ 102s] test internals::case::rename_variants ... ok [ 102s] [ 102s] test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s --- packaging/rust-serde_derive.spec | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packaging/rust-serde_derive.spec b/packaging/rust-serde_derive.spec index f54a08e..0bca659 100644 --- a/packaging/rust-serde_derive.spec +++ b/packaging/rust-serde_derive.spec @@ -50,6 +50,18 @@ 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=proc-macro \ + --crate-name=%{real_crate_name} \ + -lproc_macro2 \ + -lquote \ + -lsyn \ + ./src/lib.rs + +./%{real_crate_name} +%endif + %clean %post -p /sbin/ldconfig -- cgit v1.2.3