Skip to content

Commit 0e9b3e1

Browse files
committed
Clean up tests
1 parent 684facf commit 0e9b3e1

File tree

10 files changed

+461
-308
lines changed

10 files changed

+461
-308
lines changed

.cirrus.yml

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,21 @@ test_task:
1616
setup_script:
1717
- rustup toolchain add nightly --component rust-src && rustup default nightly
1818
test_script:
19-
- cargo test -vv --workspace --all-features
20-
- cargo test -vv --workspace --all-features --release
19+
# all features
20+
- cargo test -vv --workspace --all-features -- -Z unstable-options --report-time
21+
- cargo test -vv --workspace --all-features --release -- -Z unstable-options --report-time
2122
# Use -Z build-std because the prebuilt libtest seems to be incompatible with LTO, causing miscompilation: https://gist.github.com/taiki-e/9713f8e02e8f9f852ccee8d6f089ec24
22-
- CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1 CARGO_PROFILE_RELEASE_LTO=fat cargo -Z build-std test -vv --workspace --all-features --release --tests --target $TARGET
23-
- cargo test -vv --workspace --features float,std,serde
24-
- cargo test -vv --workspace --features float,std,serde --release
23+
- CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1 CARGO_PROFILE_RELEASE_LTO=fat cargo -Z build-std test -vv --workspace --all-features --release --tests --target $TARGET -- -Z unstable-options --report-time
24+
# no outline-atomics, no parking_lot
25+
- cargo test -vv --workspace --features float,std,serde -- -Z unstable-options --report-time
26+
- cargo test -vv --workspace --features float,std,serde --release -- -Z unstable-options --report-time
2527
# Use -Z build-std because the prebuilt libtest seems to be incompatible with LTO, causing miscompilation: https://gist.github.com/taiki-e/9713f8e02e8f9f852ccee8d6f089ec24
26-
- CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1 CARGO_PROFILE_RELEASE_LTO=fat cargo -Z build-std test -vv --workspace --features float,std,serde --release --tests --target $TARGET
27-
- RUSTFLAGS="$RUSTFLAGS -C target-feature=+lse" RUSTDOCFLAGS="$RUSTDOCFLAGS -C target-feature=+lse" cargo test -vv --workspace --all-features
28-
- RUSTFLAGS="$RUSTFLAGS -C target-feature=+lse" RUSTDOCFLAGS="$RUSTDOCFLAGS -C target-feature=+lse" cargo test -vv --workspace --all-features --release
28+
- CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1 CARGO_PROFILE_RELEASE_LTO=fat cargo -Z build-std test -vv --workspace --features float,std,serde --release --tests --target $TARGET -- -Z unstable-options --report-time
29+
# +lse
30+
- RUSTFLAGS="$RUSTFLAGS -C target-feature=+lse" RUSTDOCFLAGS="$RUSTDOCFLAGS -C target-feature=+lse" cargo test -vv --workspace --all-features -- -Z unstable-options --report-time
31+
- RUSTFLAGS="$RUSTFLAGS -C target-feature=+lse" RUSTDOCFLAGS="$RUSTDOCFLAGS -C target-feature=+lse" cargo test -vv --workspace --all-features --release -- -Z unstable-options --report-time
2932
# Use -Z build-std because the prebuilt libtest seems to be incompatible with LTO, causing miscompilation: https://gist.github.com/taiki-e/9713f8e02e8f9f852ccee8d6f089ec24
30-
- RUSTFLAGS="$RUSTFLAGS -C target-feature=+lse" RUSTDOCFLAGS="$RUSTDOCFLAGS -C target-feature=+lse" CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1 CARGO_PROFILE_RELEASE_LTO=fat cargo -Z build-std test -vv --workspace --all-features --release --tests --target $TARGET
33+
- RUSTFLAGS="$RUSTFLAGS -C target-feature=+lse" RUSTDOCFLAGS="$RUSTDOCFLAGS -C target-feature=+lse" CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1 CARGO_PROFILE_RELEASE_LTO=fat cargo -Z build-std test -vv --workspace --all-features --release --tests --target $TARGET -- -Z unstable-options --report-time
3134

3235
valgrind_task:
3336
env:
@@ -52,15 +55,18 @@ valgrind_task:
5255
cd ..
5356
rm -rf valgrind
5457
test_script:
55-
- cargo test -vv --workspace --all-features -Z doctest-xcompile
56-
- cargo test -vv --workspace --all-features --release -Z doctest-xcompile
58+
# all features
59+
- cargo test -vv --workspace --all-features -Z doctest-xcompile -- -Z unstable-options --report-time
60+
- cargo test -vv --workspace --all-features --release -Z doctest-xcompile -- -Z unstable-options --report-time
5761
# Use -Z build-std because the prebuilt libtest seems to be incompatible with LTO, causing miscompilation: https://gist.github.com/taiki-e/9713f8e02e8f9f852ccee8d6f089ec24
58-
- CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1 CARGO_PROFILE_RELEASE_LTO=fat cargo -Z build-std test -vv --workspace --all-features --release --tests --target $TARGET
59-
- cargo test -vv --workspace --features float,std,serde
60-
- cargo test -vv --workspace --features float,std,serde --release
62+
- CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1 CARGO_PROFILE_RELEASE_LTO=fat cargo -Z build-std test -vv --workspace --all-features --release --tests --target $TARGET -- -Z unstable-options --report-time
63+
# no outline-atomics, no parking_lot
64+
- cargo test -vv --workspace --features float,std,serde -- -Z unstable-options --report-time
65+
- cargo test -vv --workspace --features float,std,serde --release -- -Z unstable-options --report-time
6166
# Use -Z build-std because the prebuilt libtest seems to be incompatible with LTO, causing miscompilation: https://gist.github.com/taiki-e/9713f8e02e8f9f852ccee8d6f089ec24
62-
- CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1 CARGO_PROFILE_RELEASE_LTO=fat cargo -Z build-std test -vv --workspace --features float,std,serde --release --tests --target $TARGET
63-
- RUSTFLAGS="$RUSTFLAGS -C target-feature=+lse" RUSTDOCFLAGS="$RUSTDOCFLAGS -C target-feature=+lse" cargo test -vv --workspace --all-features -Z doctest-xcompile
64-
- RUSTFLAGS="$RUSTFLAGS -C target-feature=+lse" RUSTDOCFLAGS="$RUSTDOCFLAGS -C target-feature=+lse" cargo test -vv --workspace --all-features --release -Z doctest-xcompile
67+
- CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1 CARGO_PROFILE_RELEASE_LTO=fat cargo -Z build-std test -vv --workspace --features float,std,serde --release --tests --target $TARGET -- -Z unstable-options --report-time
68+
# +cmpxchg16b
69+
- RUSTFLAGS="$RUSTFLAGS -C target-feature=+lse" RUSTDOCFLAGS="$RUSTDOCFLAGS -C target-feature=+lse" cargo test -vv --workspace --all-features -Z doctest-xcompile -- -Z unstable-options --report-time
70+
- RUSTFLAGS="$RUSTFLAGS -C target-feature=+lse" RUSTDOCFLAGS="$RUSTDOCFLAGS -C target-feature=+lse" cargo test -vv --workspace --all-features --release -Z doctest-xcompile -- -Z unstable-options --report-time
6571
# Use -Z build-std because the prebuilt libtest seems to be incompatible with LTO, causing miscompilation: https://gist.github.com/taiki-e/9713f8e02e8f9f852ccee8d6f089ec24
66-
- RUSTFLAGS="$RUSTFLAGS -C target-feature=+lse" RUSTDOCFLAGS="$RUSTDOCFLAGS -C target-feature=+lse" CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1 CARGO_PROFILE_RELEASE_LTO=fat cargo -Z build-std test -vv --workspace --all-features --release --tests --target $TARGET
72+
- RUSTFLAGS="$RUSTFLAGS -C target-feature=+lse" RUSTDOCFLAGS="$RUSTDOCFLAGS -C target-feature=+lse" CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1 CARGO_PROFILE_RELEASE_LTO=fat cargo -Z build-std test -vv --workspace --all-features --release --tests --target $TARGET -- -Z unstable-options --report-time

.github/workflows/ci.yml

Lines changed: 62 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -100,50 +100,59 @@ jobs:
100100
with:
101101
target: ${{ matrix.target }}
102102
if: matrix.target != ''
103-
104-
- run: cargo test -vv --workspace --exclude asm-test --exclude bench --all-features $DOCTEST_XCOMPILE
105-
- run: cargo test -vv --workspace --exclude asm-test --exclude bench --all-features --release $DOCTEST_XCOMPILE
106-
- run: cargo test -vv --workspace --exclude asm-test --exclude bench --all-features --release $DOCTEST_XCOMPILE
103+
- run: |
104+
echo "REPORT_TIME=-Z unstable-options --report-time" >>"${GITHUB_ENV}"
105+
if: startsWith(matrix.rust, 'nightly')
106+
# all features
107+
- run: cargo test -vv --workspace --exclude asm-test --exclude bench --all-features $DOCTEST_XCOMPILE -- $REPORT_TIME
108+
- run: cargo test -vv --workspace --exclude asm-test --exclude bench --all-features --release $DOCTEST_XCOMPILE -- $REPORT_TIME
109+
- run: cargo test -vv --workspace --exclude asm-test --exclude bench --all-features --release $DOCTEST_XCOMPILE -- $REPORT_TIME
107110
env:
108111
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 1
109112
CARGO_PROFILE_RELEASE_LTO: fat
110-
- run: cargo test -vv --features float,std,serde $DOCTEST_XCOMPILE
111-
- run: cargo test -vv --features float,std,serde --release $DOCTEST_XCOMPILE
112-
- run: cargo test -vv --features float,std,serde --release $DOCTEST_XCOMPILE
113+
# no outline-atomics, no parking_lot
114+
- run: cargo test -vv --features float,std,serde $DOCTEST_XCOMPILE -- $REPORT_TIME
115+
- run: cargo test -vv --features float,std,serde --release $DOCTEST_XCOMPILE -- $REPORT_TIME
116+
- run: cargo test -vv --features float,std,serde --release $DOCTEST_XCOMPILE -- $REPORT_TIME
113117
env:
114118
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 1
115119
CARGO_PROFILE_RELEASE_LTO: fat
116-
117-
- run: cargo test -vv --workspace --exclude asm-test --exclude bench --all-features
120+
# +cmpxchg16b
121+
- run: cargo test -vv --workspace --exclude asm-test --exclude bench --all-features -- $REPORT_TIME
118122
env:
123+
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+cmpxchg16b
119124
RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+cmpxchg16b
120125
if: matrix.target == '' || startsWith(matrix.target, 'x86_64')
121-
- run: cargo test -vv --workspace --exclude asm-test --exclude bench --all-features --release
126+
- run: cargo test -vv --workspace --exclude asm-test --exclude bench --all-features --release -- $REPORT_TIME
122127
env:
128+
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+cmpxchg16b
123129
RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+cmpxchg16b
124130
if: matrix.target == '' || startsWith(matrix.target, 'x86_64')
125-
- run: cargo test -vv --workspace --exclude asm-test --exclude bench --all-features --release
131+
- run: cargo test -vv --workspace --exclude asm-test --exclude bench --all-features --release -- $REPORT_TIME
126132
env:
127133
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 1
128134
CARGO_PROFILE_RELEASE_LTO: fat
135+
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+cmpxchg16b
129136
RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+cmpxchg16b
130137
if: matrix.target == '' || startsWith(matrix.target, 'x86_64')
131-
132-
- run: cargo test -vv --workspace --exclude asm-test --exclude bench --all-features
138+
# +lse
139+
- run: cargo test -vv --workspace --exclude asm-test --exclude bench --all-features -- $REPORT_TIME
133140
env:
141+
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+lse
134142
RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+lse
135143
if: startsWith(matrix.target, 'aarch64')
136-
- run: cargo test -vv --workspace --exclude asm-test --exclude bench --all-features --release
144+
- run: cargo test -vv --workspace --exclude asm-test --exclude bench --all-features --release -- $REPORT_TIME
137145
env:
146+
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+lse
138147
RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+lse
139148
if: startsWith(matrix.target, 'aarch64')
140-
- run: cargo test -vv --workspace --exclude asm-test --exclude bench --all-features --release
149+
- run: cargo test -vv --workspace --exclude asm-test --exclude bench --all-features --release -- $REPORT_TIME
141150
env:
142151
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 1
143152
CARGO_PROFILE_RELEASE_LTO: fat
153+
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+lse
144154
RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+lse
145155
if: startsWith(matrix.target, 'aarch64')
146-
147156
- run: cargo minimal-versions build -vvv --workspace --all-features --ignore-private
148157
if: startsWith(matrix.rust, 'nightly')
149158

@@ -203,7 +212,7 @@ jobs:
203212
- uses: taiki-e/github-actions/install-rust@main
204213
with:
205214
component: miri
206-
- run: cargo miri test --workspace --exclude asm-test --exclude bench --all-features
215+
- run: cargo miri test --workspace --exclude asm-test --exclude bench --all-features -- -Z unstable-options --report-time
207216
env:
208217
MIRIFLAGS: -Zmiri-check-number-validity -Zmiri-symbolic-alignment-check -Zmiri-tag-raw-pointers -Zmiri-disable-isolation
209218
RUSTFLAGS: ${{ env.RUSTFLAGS }} -Z randomize-layout
@@ -238,27 +247,39 @@ jobs:
238247
echo "RUSTFLAGS=${RUSTFLAGS} -Z sanitizer=thread" >>"${GITHUB_ENV}"
239248
echo "RUSTDOCFLAGS=${RUSTDOCFLAGS} -Z sanitizer=thread" >>"${GITHUB_ENV}"
240249
if: matrix.sanitizer == 'thread'
250+
# all features
251+
- run: |
252+
cargo -Z build-std test -vv --workspace --exclude asm-test --exclude bench --all-features --target "$(rustc -Vv | grep host | sed 's/host: //')" -- -Z unstable-options --report-time
253+
- run: |
254+
cargo -Z build-std test -vv --workspace --exclude asm-test --exclude bench --all-features --release --target "$(rustc -Vv | grep host | sed 's/host: //')" -- -Z unstable-options --report-time
255+
- run: |
256+
cargo -Z build-std test -vv --workspace --exclude asm-test --exclude bench --all-features --release --target "$(rustc -Vv | grep host | sed 's/host: //')" -- -Z unstable-options --report-time
257+
env:
258+
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 1
259+
CARGO_PROFILE_RELEASE_LTO: fat
260+
# no outline-atomics, no parking_lot
241261
- run: |
242-
cargo -Z build-std test -vv --workspace --exclude asm-test --exclude bench --all-features --target "$(rustc -Vv | grep host | sed 's/host: //')"
262+
cargo -Z build-std test -vv --features float,std,serde --target "$(rustc -Vv | grep host | sed 's/host: //')" -- -Z unstable-options --report-time
243263
- run: |
244-
cargo -Z build-std test -vv --workspace --exclude asm-test --exclude bench --all-features --release --target "$(rustc -Vv | grep host | sed 's/host: //')"
264+
cargo -Z build-std test -vv --features float,std,serde --release --target "$(rustc -Vv | grep host | sed 's/host: //')" -- -Z unstable-options --report-time
245265
- run: |
246-
cargo -Z build-std test -vv --workspace --exclude asm-test --exclude bench --all-features --release --target "$(rustc -Vv | grep host | sed 's/host: //')"
266+
cargo -Z build-std test -vv --features float,std,serde --release --target "$(rustc -Vv | grep host | sed 's/host: //')" -- -Z unstable-options --report-time
247267
env:
248268
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 1
249269
CARGO_PROFILE_RELEASE_LTO: fat
270+
# +cmpxchg16b
250271
- run: |
251-
cargo -Z build-std test -vv --workspace --exclude asm-test --exclude bench --all-features --target "$(rustc -Vv | grep host | sed 's/host: //')"
272+
cargo -Z build-std test -vv --workspace --exclude asm-test --exclude bench --all-features --target "$(rustc -Vv | grep host | sed 's/host: //')" -- -Z unstable-options --report-time
252273
env:
253274
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+cmpxchg16b
254275
RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+cmpxchg16b
255276
- run: |
256-
cargo -Z build-std test -vv --workspace --exclude asm-test --exclude bench --all-features --release --target "$(rustc -Vv | grep host | sed 's/host: //')"
277+
cargo -Z build-std test -vv --workspace --exclude asm-test --exclude bench --all-features --release --target "$(rustc -Vv | grep host | sed 's/host: //')" -- -Z unstable-options --report-time
257278
env:
258279
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+cmpxchg16b
259280
RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+cmpxchg16b
260281
- run: |
261-
cargo -Z build-std test -vv --workspace --exclude asm-test --exclude bench --all-features --release --target "$(rustc -Vv | grep host | sed 's/host: //')"
282+
cargo -Z build-std test -vv --workspace --exclude asm-test --exclude bench --all-features --release --target "$(rustc -Vv | grep host | sed 's/host: //')" -- -Z unstable-options --report-time
262283
env:
263284
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 1
264285
CARGO_PROFILE_RELEASE_LTO: fat
@@ -277,38 +298,36 @@ jobs:
277298
with:
278299
component: rust-src
279300
- uses: taiki-e/install-action@valgrind
280-
- run: cargo test -vv --workspace --exclude asm-test --exclude bench --all-features -Z doctest-xcompile
281-
- run: cargo test -vv --workspace --exclude asm-test --exclude bench --all-features --release -Z doctest-xcompile
282-
- run: cargo test -vv --workspace --exclude asm-test --exclude bench --all-features --release -Z doctest-xcompile
301+
# all features
302+
- run: cargo test -vv --workspace --exclude asm-test --exclude bench --all-features -Z doctest-xcompile -- -Z unstable-options --report-time
303+
- run: cargo test -vv --workspace --exclude asm-test --exclude bench --all-features --release -Z doctest-xcompile -- -Z unstable-options --report-time
304+
- run: cargo test -vv --workspace --exclude asm-test --exclude bench --all-features --release -Z doctest-xcompile -- -Z unstable-options --report-time
283305
env:
284306
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 1
285307
CARGO_PROFILE_RELEASE_LTO: fat
286-
- run: cargo test -vv --workspace --exclude asm-test --exclude bench --all-features -Z doctest-xcompile
308+
# no outline-atomics, no parking_lot
309+
- run: cargo test -vv --features float,std,serde -Z doctest-xcompile -- -Z unstable-options --report-time
310+
- run: cargo test -vv --features float,std,serde --release -Z doctest-xcompile -- -Z unstable-options --report-time
311+
- run: cargo test -vv --features float,std,serde --release -Z doctest-xcompile -- -Z unstable-options --report-time
287312
env:
313+
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 1
314+
CARGO_PROFILE_RELEASE_LTO: fat
315+
# +cmpxchg16b
316+
- run: cargo test -vv --workspace --exclude asm-test --exclude bench --all-features -Z doctest-xcompile -- -Z unstable-options --report-time
317+
env:
318+
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+cmpxchg16b
288319
RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+cmpxchg16b
289-
- run: cargo test -vv --workspace --exclude asm-test --exclude bench --all-features --release -Z doctest-xcompile
320+
- run: cargo test -vv --workspace --exclude asm-test --exclude bench --all-features --release -Z doctest-xcompile -- -Z unstable-options --report-time
290321
env:
322+
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+cmpxchg16b
291323
RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+cmpxchg16b
292-
- run: cargo test -vv --workspace --exclude asm-test --exclude bench --all-features --release -Z doctest-xcompile
324+
- run: cargo test -vv --workspace --exclude asm-test --exclude bench --all-features --release -Z doctest-xcompile -- -Z unstable-options --report-time
293325
env:
294326
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 1
295327
CARGO_PROFILE_RELEASE_LTO: fat
328+
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+cmpxchg16b
296329
RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+cmpxchg16b
297330

298-
cov:
299-
runs-on: ubuntu-latest
300-
steps:
301-
- uses: actions/checkout@v3
302-
with:
303-
persist-credentials: false
304-
- uses: taiki-e/github-actions/install-rust@main
305-
with:
306-
component: llvm-tools-preview
307-
- uses: taiki-e/install-action@cargo-llvm-cov
308-
- run: cargo llvm-cov --workspace --exclude asm-test --exclude bench --all-features
309-
- run: cargo llvm-cov --workspace --exclude asm-test --exclude bench --all-features --text --no-run --hide-instantiations
310-
- run: cargo llvm-cov --workspace --exclude asm-test --exclude bench --all-features --text --no-run
311-
312331
codegen:
313332
runs-on: ubuntu-latest
314333
permissions:
@@ -389,7 +408,6 @@ jobs:
389408
- miri
390409
- san
391410
- valgrind
392-
- cov
393411
- codegen
394412
- tidy
395413
- docs

bench/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ fallback = []
1010
std = []
1111
outline-atomics = []
1212

13+
[dependencies]
14+
parking_lot = { version = ">=0.11, <=0.12", optional = true }
15+
1316
[dev-dependencies]
1417
atomic = "0.5"
1518
criterion = { default-features = false, git = "https://github.com/taiki-e/criterion.rs.git", branch = "dev" } # https://github.com/bheisler/criterion.rs/pull/496 + patches to reduce deps more

0 commit comments

Comments
 (0)