From 96d8e20cf16f82d18266a52aa8eb2669b18fdd06 Mon Sep 17 00:00:00 2001 From: Roy7Kim Date: Mon, 8 May 2023 16:03:31 +0900 Subject: [PATCH] Add unittest [ 7s] + ./unic_ucd_version [ 7s] [ 7s] running 1 test [ 7s] test unicode_version::tests::validate_version_values ... ok [ 7s] [ 7s] test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s --- packaging/rust-unic-ucd-version.spec | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packaging/rust-unic-ucd-version.spec b/packaging/rust-unic-ucd-version.spec index b96f9cd..1c0bb97 100644 --- a/packaging/rust-unic-ucd-version.spec +++ b/packaging/rust-unic-ucd-version.spec @@ -61,6 +61,21 @@ export CARGO_PKG_DESCRIPTION="%{summary}" 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 CARGO_PKG_VERSION=1.67.1 +export CARGO_PKG_NAME="%{crate}" +export CARGO_PKG_DESCRIPTION="%{summary}" + +%{rustc_std_build} --test --crate-type=dylib \ + --crate-name=%{real_crate_name} \ + %{?rustc_edition:--edition=%{rustc_edition}} \ + %rust_dylib_extern unic_common \ + ./src/lib.rs + +./%{real_crate_name} +%endif + %clean %post -p /sbin/ldconfig -- 2.34.1