Add unittest accepted/tizen_rust tizen accepted/tizen/rust/20231016.021754
authorWoohyun Jung <wh0705.jung@samsung.com>
Thu, 4 May 2023 09:24:33 +0000 (18:24 +0900)
committerWoohyun Jung <wh0705.jung@samsung.com>
Thu, 4 May 2023 09:24:33 +0000 (18:24 +0900)
[  158s] + ./regex_automata
[  158s]
[  158s] running 43 tests
[  158s] test dfa::dense::tests::roundtrip_never_match ... ok
[  158s] test nfa::thompson::compiler::tests::compile_empty ... ok
[  158s] test dfa::dense::tests::errors_with_unicode_word_boundary ... ok
[  158s] test dfa::dense::tests::roundtrip_always_match ... ok
[  158s] test nfa::thompson::compiler::tests::compile_alternation ... ok
[  158s] test nfa::thompson::compiler::tests::compile_repetition ... ok
[  158s] test nfa::thompson::compiler::tests::compile_unanchored_prefix ... ok
[  158s] test nfa::thompson::compiler::tests::compile_group ... ok
[  158s] test nfa::thompson::range_trie::tests::no_splits ... ok
[  158s] test nfa::thompson::compiler::tests::many_start_pattern ... ok
[  158s] test nfa::thompson::compiler::tests::compile_literal ... ok
[  158s] test nfa::thompson::range_trie::tests::splits ... ok
[  158s] test nfa::thompson::compiler::tests::compile_class ... ok
[  158s] test nfa::thompson::tests::always_match ... ok
[  158s] test nfa::thompson::tests::look_matches_end_line ... ok
[  158s] test nfa::thompson::tests::look_matches_end_text ... ok
[  158s] test nfa::thompson::tests::look_matches_start_line ... ok
[  158s] test nfa::thompson::tests::look_matches_start_text ... ok
[  158s] test nfa::thompson::tests::look_matches_word_ascii ... ok
[  158s] test nfa::thompson::tests::look_matches_word_ascii_negate ... ok
[  158s] test nfa::thompson::tests::look_set ... ok
[  158s] test nfa::thompson::tests::never_match ... ok
[  158s] test util::alphabet::tests::byte_classes ... ok
[  158s] test util::alphabet::tests::elements_empty ... ok
[  158s] test util::alphabet::tests::elements_singletons ... ok
[  158s] test util::alphabet::tests::elements_typical ... ok
[  158s] test util::alphabet::tests::full_byte_classes ... ok
[  158s] test util::bytes::tests::bad_label_almost_too_long ... ok
[  158s] test util::bytes::tests::labels ... ok
[  158s] test util::bytes::tests::padding ... ok
[  158s] test util::bytes::tests::bad_label_interior_nul - should panic ... ok
[  158s] test util::bytes::tests::bad_label_too_long - should panic ... ok
[  158s] test util::determinize::state::tests::prop_read_write_vari32 ... ok
[  158s] test util::determinize::state::tests::prop_read_write_varu32 ... ok
[  158s] test util::determinize::tests::start_fwd ... ok
[  158s] test util::determinize::tests::start_fwd_bad_range - should panic ... ok
[  158s] test util::determinize::tests::start_rev ... ok
[  158s] test util::determinize::tests::start_rev_bad_range - should panic ... ok
[  158s] test util::determinize::state::tests::prop_state_read_write_pattern_ids ... ok
[  158s] test util::determinize::state::tests::prop_state_read_write_nfa_state_ids ... ok
[  158s] test util::determinize::state::tests::prop_state_read_write_nfa_state_and_pattern_ids ... ok
[  158s] test nfa::thompson::tests::look_matches_word_unicode ... ok
[  158s] test nfa::thompson::tests::look_matches_word_unicode_negate ... ok
[  158s]
[  158s] test result: ok. 43 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.16s

packaging/rust-regex-automata.spec

index b5b82781c7966ff6e38ce7c5173c5b222b684c04..000d2e996dbd0e3c313bd8ec74c119d0e5f5f1a0 100644 (file)
@@ -31,6 +31,13 @@ Requires:  rust-log
 Requires:  rust-memchr
 Requires:  rust-regex-syntax
 
+# ==========================================================
+# dev-dependencies
+# ==========================================================
+%if 0%{?run_tests}
+BuildRequires:  rust-quickcheck 
+%endif
+
 
 %description
 Automata construction and matching using regular expressions.
@@ -54,6 +61,21 @@ cp %{SOURCE1} .
         --extern memchr=%{_rust_dylibdir}/libmemchr.so \
         ./src/lib.rs
 
+%check
+%if 0%{?run_tests}
+%{rustc_std_build} --test --crate-type=dylib \
+        --crate-name=%{real_crate_name} \
+        %{?rustc_edition:--edition=%{rustc_edition}} \
+        --cfg='feature="std"' \
+        --cfg='feature="alloc"' \
+        --cfg='feature="syntax"' \
+        --extern memchr=%{_rust_dylibdir}/libmemchr.so \
+        %rust_dylib_extern quickcheck \
+        ./src/lib.rs
+
+./%{real_crate_name}
+%endif
+
 # ==========================================================
 # install section
 # ==========================================================