summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2023-04-14 15:09:43 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2023-04-17 07:52:05 +0900
commit70a6e5ad2458f680b33210073182cdeb98fb77c8 (patch)
tree6362e1d50a5c23a1c184a588776860dad7e8deeb
parentf64f8edb78e03fde098af19035c227b7ae03be67 (diff)
downloadrust-async-task-accepted/tizen_rust.tar.gz
rust-async-task-accepted/tizen_rust.tar.bz2
rust-async-task-accepted/tizen_rust.zip
[ 63s] + ./basic [ 64s] [ 64s] running 11 tests [ 64s] test cancel_and_run ... ok [ 64s] test detach_and_drop ... ok [ 64s] test detach_and_run ... ok [ 64s] test cancel_join ... ok [ 64s] test drop_and_detach ... ok [ 64s] test drop_inside_schedule ... ok [ 64s] test run_and_cancel ... ok [ 64s] test run_and_detach ... ok [ 64s] test schedule ... ok [ 64s] test schedule_counter ... ok [ 64s] test waker ... ok [ 64s] [ 64s] test result: ok. 11 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.02s [ 64s] [ 64s] + for unit_test in '"basic"' '"cancel"' '"join"' [ 64s] + ./cancel [ 64s] [ 64s] running 3 tests [ 64s] test run_and_cancel ... ok [ 64s] test cancel_during_run ... ok [ 64s] test cancel_and_run ... ok [ 64s] [ 64s] test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.62s [ 64s] [ 64s] + for unit_test in '"basic"' '"cancel"' '"join"' [ 64s] + ./join [ 64s] [ 64s] running 10 tests [ 64s] test detach_and_run ... ok [ 64s] test await_output ... ok [ 64s] test drop_and_join ... ok [ 64s] test join_twice ... ok [ 64s] test run_and_join ... ok [ 64s] test try_join_and_cancel_and_run ... ok [ 65s] test try_join_and_run_and_cancel ... ok [ 65s] test join_and_cancel ... ok [ 65s] test join_and_run ... ok [ 65s] test try_join_and_run_and_join ... ok [ 65s] [ 65s] test result: ok. 10 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.63s
-rw-r--r--packaging/rust-async-task.spec29
1 files changed, 26 insertions, 3 deletions
diff --git a/packaging/rust-async-task.spec b/packaging/rust-async-task.spec
index 44ed162..f014520 100644
--- a/packaging/rust-async-task.spec
+++ b/packaging/rust-async-task.spec
@@ -25,12 +25,14 @@ BuildRequires: rust
# ==========================================================
# dev-dependencies
# ==========================================================
+%if 0%{?run_tests}
# BuildRequires: rust-atomic-waker
-# BuildRequires: rust-easy-parallel
# BuildRequires: rust-flaky_test
-# BuildRequires: rust-flume
# BuildRequires: rust-once_cell
-# BuildRequires: rust-smol
+BuildRequires: rust-easy-parallel
+BuildRequires: rust-flume
+BuildRequires: rust-smol
+%endif
%description
@@ -58,6 +60,27 @@ 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}
+for unit_test in "basic" "cancel" "join"
+do
+%{rustc_std_build} --test \
+ --crate-name=${unit_test} \
+ %{?rustc_edition:--edition=%{rustc_edition}} \
+ --cfg='feature="std"' \
+ --extern %{real_crate_name}=./lib%{real_crate_name}.so \
+ %rust_dylib_extern easy_parallel \
+ %rust_dylib_extern flume \
+ %rust_dylib_extern smol \
+ ./tests/${unit_test}.rs
+done
+
+for unit_test in "basic" "cancel" "join"
+do
+./${unit_test}
+done
+
+%endif
%clean
%post -p /sbin/ldconfig