summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2023-04-14 11:05:09 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2023-04-17 08:01:04 +0900
commitf05f6028206d0f9153ccb773786000d9170632d4 (patch)
treeff00cbe165fc6e6b13db25e51d102c3c827bc6d2
parenta130de78d1a3015c920765da3fa0dcf3510c9efb (diff)
downloadrust-async-executor-f05f6028206d0f9153ccb773786000d9170632d4.tar.gz
rust-async-executor-f05f6028206d0f9153ccb773786000d9170632d4.tar.bz2
rust-async-executor-f05f6028206d0f9153ccb773786000d9170632d4.zip
[ 20s] + ./async_executor [ 20s] [ 20s] running 5 tests [ 20s] test drop_executor_and_then_drop_finished_task ... ok [ 20s] test await_task_after_dropping_executor ... ok [ 20s] test leaked_executor_leaks_everything ... ok [ 20s] test executor_cancels_everything ... ok [ 20s] test drop_finished_task_and_then_drop_executor ... ok [ 20s] [ 20s] test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.03s
-rw-r--r--packaging/extern.patch18
-rw-r--r--packaging/rust-async-executor.spec30
2 files changed, 27 insertions, 21 deletions
diff --git a/packaging/extern.patch b/packaging/extern.patch
deleted file mode 100644
index 119357b..0000000
--- a/packaging/extern.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-diff --git a/src/lib.rs b/src/lib.rs
-index 24fbfac..29a30d4 100644
---- a/src/lib.rs
-+++ b/src/lib.rs
-@@ -20,6 +20,13 @@
-
- #![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)]
-
-+extern crate futures_lite;
-+extern crate async_lock;
-+extern crate async_task;
-+extern crate concurrent_queue;
-+extern crate slab;
-+extern crate fastrand;
-+
- use std::future::Future;
- use std::marker::PhantomData;
- use std::panic::{RefUnwindSafe, UnwindSafe};
diff --git a/packaging/rust-async-executor.spec b/packaging/rust-async-executor.spec
index def6d61..a0a6787 100644
--- a/packaging/rust-async-executor.spec
+++ b/packaging/rust-async-executor.spec
@@ -15,7 +15,6 @@ License: Apache-2.0 OR MIT
URL: https://crates.io/crates/async-executor
Source: %{crate}-%{version}.tar.gz
Source1: %{name}.manifest
-Source2: extern.patch
# ==========================================================
# BuildRequires
@@ -39,11 +38,13 @@ Requires: rust-slab
# ==========================================================
# dev-dependencies
# ==========================================================
+%if 0%{?run_tests}
# BuildRequires: rust-async-channel
# BuildRequires: rust-async-io
# BuildRequires: rust-easy-parallel
# BuildRequires: rust-num_cpus
-# BuildRequires: rust-once_cell
+BuildRequires: rust-once_cell
+%endif
%description
@@ -52,7 +53,6 @@ Async executor.
%prep
%setup -q
cp %{SOURCE1} .
-%{__patch} -p1 < %{SOURCE2}
# ==========================================================
# build section
@@ -62,6 +62,12 @@ cp %{SOURCE1} .
%{rustc_std_build} --crate-type=dylib \
--crate-name=%{real_crate_name} \
%{?rustc_edition:--edition=%{rustc_edition}} \
+ %rust_dylib_extern futures_lite \
+ %rust_dylib_extern async_lock \
+ %rust_dylib_extern async_task \
+ %rust_dylib_extern concurrent_queue \
+ %rust_dylib_extern slab \
+ %rust_dylib_extern fastrand \
./src/lib.rs
# ==========================================================
@@ -71,6 +77,24 @@ 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-type=dylib \
+ --crate-name=%{real_crate_name} \
+ %{?rustc_edition:--edition=%{rustc_edition}} \
+ --extern %{real_crate_name}=lib%{real_crate_name}.so \
+ %rust_dylib_extern futures_lite \
+ %rust_dylib_extern async_lock \
+ %rust_dylib_extern async_task \
+ %rust_dylib_extern concurrent_queue \
+ %rust_dylib_extern slab \
+ %rust_dylib_extern fastrand \
+ %rust_dylib_extern once_cell \
+ ./tests/drop.rs
+
+./%{real_crate_name}
+%endif
+
%clean
%post -p /sbin/ldconfig