3 # This is the main CI script for testing the regex crate and its sub-crates.
7 # Builds the regex crate and runs tests.
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.
15 # This isn't ideal. It's a compromise.
16 if [ "$TRAVIS_RUST_VERSION" = "1.20.0" ]; then
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
23 CARGO_TEST_EXTRA_FLAGS
=""
24 if [ "$TRAVIS_RUST_VERSION" = "nightly" ]; then
25 CARGO_TEST_EXTRA_FLAGS
=""
27 cargo
test --verbose ${CARGO_TEST_EXTRA_FLAGS}
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
34 # Run a test that confirms the shootout benchmarks are correct.
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
41 # Run tests on regex-capi crate.
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)
52 # Test minimal versions.
53 cargo
+nightly generate-lockfile
-Z minimal-versions