diff options
author | Roy7Kim <myoungwoon.kim@samsung.com> | 2023-05-11 13:59:43 +0900 |
---|---|---|
committer | Roy7Kim <myoungwoon.kim@samsung.com> | 2023-05-11 13:59:52 +0900 |
commit | 3724eee8b646d426d29e9fc3f4899a20b60b5568 (patch) | |
tree | 859a74c8dacaff94a2b2f2ba2ad04c19cb202857 | |
parent | 1290c6216bf69212405c56fe0949be1daa3363e6 (diff) | |
download | rust-slog-3724eee8b646d426d29e9fc3f4899a20b60b5568.tar.gz rust-slog-3724eee8b646d426d29e9fc3f4899a20b60b5568.tar.bz2 rust-slog-3724eee8b646d426d29e9fc3f4899a20b60b5568.zip |
Add unittest
[ 21s] + ./slog
[ 21s]
[ 21s] running 24 tests
[ 21s] test filter_level_accepts_tests ... ok
[ 21s] test filter_level_from_str ... ok
[ 21s] test filter_level_sanity ... ok
[ 21s] test filter_level_to_string_and_from_str_are_compatible ... ok
[ 21s] test level_at_least ... ok
[ 21s] test level_from_str ... ok
[ 21s] test level_to_string_and_from_str_are_compatible ... ok
[ 21s] test tests::can_hash_keys ... ok
[ 21s] test tests::expressions ... ok
[ 21s] test tests::display_and_alternate_display ... ok
[ 21s] test tests::expressions_fmt ... ok
[ 21s] test tests::logger_by_ref ... ok
[ 21s] test tests::logger_to_erased ... ok
[ 21s] test tests::makers ... ok
[ 21s] test tests::no_imports::test_slog_o_macro_expansion ... ok
[ 21s] test tests::no_imports::test_o_macro_expansion ... ok
[ 21s] test tests::simple_logger_erased ... ok
[ 21s] test tests::std_only::error_fmt_no_source ... ok
[ 21s] test tests::std_only::error_fmt_single_source ... ok
[ 21s] test tests::std_only::error_fmt_two_sources ... ok
[ 21s] test tests::std_only::ioerror_impls_value ... ok
[ 21s] test tests::std_only::logger_fmt_debug_sanity ... ok
[ 21s] test tests::std_only::multichain ... ok
[ 21s] test tests::test_never_type_clone ... ok
[ 21s]
[ 21s] test result: ok. 24 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.03s
-rw-r--r-- | packaging/rust-slog.spec | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/packaging/rust-slog.spec b/packaging/rust-slog.spec index c749a3e..bac1dc8 100644 --- a/packaging/rust-slog.spec +++ b/packaging/rust-slog.spec @@ -50,6 +50,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} + +export CARGO_PKG_VERSION=1.67.1 + +%{rustc_std_build} --test --crate-type=dylib \ + --crate-name=%{real_crate_name} \ + %{?rustc_edition:--edition=%{rustc_edition}} \ + --cfg='feature="std"' \ + ./src/lib.rs + +./%{real_crate_name} +%endif + %clean %post -p /sbin/ldconfig |