From b5a04264bfbbb8ef6f5f6eb14b175bf4d209c2c7 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 29 Aug 2020 12:51:22 +0200 Subject: [PATCH] CI: run tests in Miri --- .travis.yml | 7 +++++++ ci/miri.sh | 14 ++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 ci/miri.sh diff --git a/.travis.yml b/.travis.yml index e890f9b..c76cca1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,3 +8,10 @@ env: script: - cargo test --verbose --features 'less-slow-kanji-encode less-slow-big5-hanzi-encode less-slow-gb-hanzi-encode serde' - cargo test --verbose + +matrix: + include: + - name: miri + rust: nightly + script: + - sh ci/miri.sh diff --git a/ci/miri.sh b/ci/miri.sh new file mode 100644 index 0000000..ff588d6 --- /dev/null +++ b/ci/miri.sh @@ -0,0 +1,14 @@ +set -ex + +# Install Miri. +MIRI_NIGHTLY=nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri) +echo "Installing latest nightly with Miri: $MIRI_NIGHTLY" +rustup default "$MIRI_NIGHTLY" +rustup component add miri + +# Run tests. +# Stacked Borrows is disabled as it costs too much RAM (due to our large tables). +cargo miri test -- -Zmiri-disable-stacked-borrows + +# Restore old state in case Travis uses this cache for other jobs. +rustup default nightly