]> git.proxmox.com Git - rustc.git/blob - src/vendor/regex/ci/script.sh
New upstream version 1.30.0~beta.7+dfsg1
[rustc.git] / src / vendor / regex / ci / script.sh
1 #!/bin/sh
2
3 # This is the main CI script for testing the regex crate and its sub-crates.
4
5 set -ex
6
7 # Builds the regex crate and runs tests.
8 cargo build --verbose
9 cargo doc --verbose
10
11 # If we're testing on an older version of Rust, then only check that we
12 # can build the crate. This is because the dev dependencies might be updated
13 # more frequently, and therefore might require a newer version of Rust.
14 #
15 # This isn't ideal. It's a compromise.
16 if [ "$TRAVIS_RUST_VERSION" = "1.20.0" ]; then
17 exit
18 fi
19
20 # Run tests. If we have nightly, then enable our nightly features.
21 # Right now there are no nightly features, but that may change in the
22 # future.
23 CARGO_TEST_EXTRA_FLAGS=""
24 if [ "$TRAVIS_RUST_VERSION" = "nightly" ]; then
25 CARGO_TEST_EXTRA_FLAGS=""
26 fi
27 cargo test --verbose ${CARGO_TEST_EXTRA_FLAGS}
28
29 # Run the random tests in release mode, as this is faster.
30 RUST_REGEX_RANDOM_TEST=1 \
31 cargo test --release --verbose \
32 ${CARGO_TEST_EXTRA_FLAGS} --test crates-regex
33
34 # Run a test that confirms the shootout benchmarks are correct.
35 ci/run-shootout-test
36
37 # Run tests on regex-syntax crate.
38 cargo test --verbose --manifest-path regex-syntax/Cargo.toml
39 cargo doc --verbose --manifest-path regex-syntax/Cargo.toml
40
41 # Run tests on regex-capi crate.
42 ci/test-regex-capi
43
44 # Make sure benchmarks compile. Don't run them though because they take a
45 # very long time. Also, check that we can build the regex-debug tool.
46 if [ "$TRAVIS_RUST_VERSION" = "nightly" ]; then
47 cargo build --verbose --manifest-path regex-debug/Cargo.toml
48 for x in rust rust-bytes pcre1 onig; do
49 (cd bench && ./run $x --no-run --verbose)
50 done
51
52 # Test minimal versions.
53 cargo +nightly generate-lockfile -Z minimal-versions
54 cargo build --verbose
55 cargo test --verbose
56 fi