summaryrefslogtreecommitdiffstats
path: root/vendor/bytes/ci
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/bytes/ci')
-rwxr-xr-xvendor/bytes/ci/miri.sh11
-rw-r--r--vendor/bytes/ci/test-stable.sh27
-rw-r--r--vendor/bytes/ci/tsan.sh13
3 files changed, 51 insertions, 0 deletions
diff --git a/vendor/bytes/ci/miri.sh b/vendor/bytes/ci/miri.sh
new file mode 100755
index 000000000..88d2b6a8c
--- /dev/null
+++ b/vendor/bytes/ci/miri.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+set -e
+
+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 set profile minimal
+rustup default "$MIRI_NIGHTLY"
+rustup component add miri
+
+cargo miri test
+cargo miri test --target mips64-unknown-linux-gnuabi64
diff --git a/vendor/bytes/ci/test-stable.sh b/vendor/bytes/ci/test-stable.sh
new file mode 100644
index 000000000..01a32f5a6
--- /dev/null
+++ b/vendor/bytes/ci/test-stable.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+set -ex
+
+cmd="${1:-test}"
+
+# Install cargo-hack for feature flag test
+cargo install cargo-hack
+
+# Run with each feature
+# * --each-feature includes both default/no-default features
+# * --optional-deps is needed for serde feature
+cargo hack "${cmd}" --each-feature --optional-deps
+# Run with all features
+cargo "${cmd}" --all-features
+
+cargo doc --no-deps --all-features
+
+if [[ "${RUST_VERSION}" == "nightly"* ]]; then
+ # Check benchmarks
+ cargo check --benches
+
+ # Check minimal versions
+ cargo clean
+ cargo update -Zminimal-versions
+ cargo check --all-features
+fi
diff --git a/vendor/bytes/ci/tsan.sh b/vendor/bytes/ci/tsan.sh
new file mode 100644
index 000000000..ca520bd7f
--- /dev/null
+++ b/vendor/bytes/ci/tsan.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+set -ex
+
+export ASAN_OPTIONS="detect_odr_violation=0 detect_leaks=0"
+
+# Run address sanitizer
+RUSTFLAGS="-Z sanitizer=address" \
+cargo test --target x86_64-unknown-linux-gnu --test test_bytes --test test_buf --test test_buf_mut
+
+# Run thread sanitizer
+RUSTFLAGS="-Z sanitizer=thread" \
+cargo -Zbuild-std test --target x86_64-unknown-linux-gnu --test test_bytes --test test_buf --test test_buf_mut