Doctest core feature matrix with '--no-run'.

Previously, we ran each doctest in core many times, once for each
individually enabled feature. This took a long time and consumed an
inordinate amount of resources for no gain: we already run each test
when we enable all features. Instead, emulate a 'cargo check' for
doctests by passing '--no-run' to rustdoc via an environment variable.
This commit is contained in:
Sergio Benitez 2021-06-30 20:44:58 -07:00
parent be933ce398
commit c2d8f11ffe
1 changed files with 6 additions and 4 deletions

View File

@ -107,11 +107,13 @@ function test_core() {
uuid uuid
) )
echo ":: Building and testing core [no features]..." echo ":: Building and checking core [no features]..."
RUSTDOCFLAGS="-Zunstable-options --no-run" \
indir "${CORE_LIB_ROOT}" $CARGO test --no-default-features $@ indir "${CORE_LIB_ROOT}" $CARGO test --no-default-features $@
for feature in "${FEATURES[@]}"; do for feature in "${FEATURES[@]}"; do
echo ":: Building and testing core [${feature}]..." echo ":: Building and checking core [${feature}]..."
RUSTDOCFLAGS="-Zunstable-options --no-run" \
indir "${CORE_LIB_ROOT}" $CARGO test --no-default-features --features "${feature}" $@ indir "${CORE_LIB_ROOT}" $CARGO test --no-default-features --features "${feature}" $@
done done
} }