From 531f09879e4cc5bfeb0025dcc2de48e5277a8b42 Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Mon, 17 Apr 2023 14:49:40 +0900 Subject: Add unittest [ 55s] + ./async_trait [ 55s] [ 55s] running 3 tests [ 55s] test drop_order::test_drop_order ... ok [ 55s] test issue199::test ... ok [ 55s] test issue45::tracing ... ok [ 55s] [ 55s] test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s --- packaging/rust-async-trait.spec | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/packaging/rust-async-trait.spec b/packaging/rust-async-trait.spec index d22c8cf..f385c7d 100644 --- a/packaging/rust-async-trait.spec +++ b/packaging/rust-async-trait.spec @@ -32,11 +32,13 @@ Requires: rust-syn # ========================================================== # dev-dependencies # ========================================================== -# BuildRequires: rust-futures -# BuildRequires: rust-rustversion -# BuildRequires: rust-tracing +%if 0%{?run_tests} +BuildRequires: rust-tracing +BuildRequires: rust-rustversion +BuildRequires: rust-futures # BuildRequires: rust-tracing-attributes # BuildRequires: rust-trybuild +%endif %description @@ -64,6 +66,20 @@ 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-name=%{real_crate_name} \ + %{?rustc_edition:--edition=%{rustc_edition}} \ + --extern %{real_crate_name}=lib%{real_crate_name}.so \ + %rust_dylib_extern tracing \ + %rust_dylib_extern rustversion \ + %rust_dylib_extern futures \ + ./tests/test.rs + +./%{real_crate_name} +%endif + %clean %post -p /sbin/ldconfig -- cgit v1.2.3