| 1 |
#!/bin/bash |
| 2 |
|
| 3 |
set -e |
| 4 |
|
| 5 |
# cd to the directory containing this crate's Cargo.toml so that we don't need |
| 6 |
# to pass --manifest-path to every `cargo` command. |
| 7 |
cd "$(dirname "$0")" |
| 8 |
|
| 9 |
# This is a convenience script for running a broad swath of tests across |
| 10 |
# features. We don't test the complete space, since the complete space is quite |
| 11 |
# large. Hopefully once we migrate the test suite to better infrastructure |
| 12 |
# (like regex-automata), we'll be able to test more of the space. |
| 13 |
echo "===== DEFAULT FEATURES =====" |
| 14 |
cargo test |
| 15 |
|
| 16 |
# no-std mode is annoyingly difficult to test. Currently, the integration tests |
| 17 |
# don't run. So for now, we just test that library tests run. (There aren't |
| 18 |
# many because `regex` is just a wrapper crate.) |
| 19 |
cargo test --no-default-features --lib |
| 20 |
|
| 21 |
echo "===== DOC TESTS =====" |
| 22 |
cargo test --doc |
| 23 |
|
| 24 |
features=( |
| 25 |
"std" |
| 26 |
"std unicode" |
| 27 |
"std unicode-perl" |
| 28 |
"std perf" |
| 29 |
"std perf-cache" |
| 30 |
"std perf-dfa" |
| 31 |
"std perf-inline" |
| 32 |
"std perf-literal" |
| 33 |
"std perf-dfa-full" |
| 34 |
"std perf-onepass" |
| 35 |
"std perf-backtrack" |
| 36 |
) |
| 37 |
for f in "${features[@]}"; do |
| 38 |
echo "===== FEATURE: $f =====" |
| 39 |
cargo test --test integration --no-default-features --features "$f" |
| 40 |
done |
| 41 |
|
| 42 |
# And test the probably-forever-nightly-only 'pattern' feature... |
| 43 |
if rustc --version | grep -q nightly; then |
| 44 |
echo "===== FEATURE: std,pattern,unicode-perl =====" |
| 45 |
cargo test --test integration --no-default-features --features std,pattern,unicode-perl |
| 46 |
fi |