Skip to content

Commit 264ae3b

Browse files
authored
sync: move CancellationToken tests (#2477)
In preparation of work on `CancellationToken` internals, the tests are moved into `tests/` and are updated to not depend on internals.
1 parent 187af2e commit 264ae3b

File tree

9 files changed

+294
-363
lines changed

9 files changed

+294
-363
lines changed

ci/azure-check-features.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,9 @@ jobs:
3030
# tracking-issue: https://github.com/rust-lang/cargo/issues/5133
3131
- script: cargo hack check --all --each-feature -Z avoid-dev-deps
3232
displayName: cargo hack check --all --each-feature
33+
34+
# Try with unstable feature flags
35+
- script: cargo hack check --all --each-feature -Z avoid-dev-deps
36+
displayName: cargo hack check --all --each-feature
37+
env:
38+
RUSTFLAGS: '--cfg tokio_unstable'

ci/azure-loom.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
parameters:
2222
rust_version: ${{ parameters.rust }}
2323

24-
- script: RUSTFLAGS="--cfg loom" cargo test --lib --release --features "full" -- --nocapture $(scope)
24+
- script: RUSTFLAGS="--cfg loom --cfg tokio_unstable" cargo test --lib --release --features "full" -- --nocapture $(scope)
2525
env:
2626
LOOM_MAX_PREEMPTIONS: 2
2727
CI: 'True'

ci/azure-test-stable.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,23 @@ jobs:
2121

2222
- template: azure-is-release.yml
2323

24+
# Run `tokio` with only `full`
25+
- script: cargo test --features full
26+
env:
27+
RUST_BACKTRACE: 1
28+
CI: 'True'
29+
displayName: tokio - cargo test --features full
30+
workingDirectory: $(Build.SourcesDirectory)/tokio
31+
32+
# Run `tokio` with "unstable" cfg flag
33+
- script: cargo test --all-features
34+
env:
35+
RUSTFLAGS: '--cfg tokio_unstable'
36+
RUST_BACKTRACE: 1
37+
CI: 'True'
38+
displayName: tokio - cargo test --features full
39+
workingDirectory: $(Build.SourcesDirectory)/tokio
40+
2441
- ${{ each crate in parameters.crates }}:
2542
# Run with all crate features
2643
- script: cargo test --all-features

tokio/src/macros/cfg.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,3 +353,13 @@ macro_rules! cfg_uds {
353353
)*
354354
}
355355
}
356+
357+
macro_rules! cfg_unstable {
358+
($($item:item)*) => {
359+
$(
360+
#[cfg(tokio_unstable)]
361+
#[cfg_attr(docsrs, doc(cfg(tokio_unstable)))]
362+
$item
363+
)*
364+
}
365+
}

0 commit comments

Comments
 (0)