CI: run test suite in Miri (#456)

This commit is contained in:
Ralf Jung
2020-12-29 22:54:48 +01:00
committed by GitHub
parent ab9d9aa32c
commit c061be06e7
4 changed files with 24 additions and 3 deletions
+7
View File
@@ -123,6 +123,13 @@ jobs:
run: rustup component add rust-src
- name: ASAN / TSAN
run: . ci/tsan.sh
miri:
name: miri
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Miri
run: ci/miri.sh
# Loom
loom:
Executable
+11
View File
@@ -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
+4 -3
View File
@@ -461,6 +461,7 @@ fn reserve_allocates_at_least_original_capacity() {
}
#[test]
#[cfg_attr(miri, ignore)] // Miri is too slow
fn reserve_max_original_capacity_value() {
const SIZE: usize = 128 * 1024;
@@ -608,15 +609,15 @@ fn advance_past_len() {
#[test]
// Only run these tests on little endian systems. CI uses qemu for testing
// little endian... and qemu doesn't really support threading all that well.
#[cfg(target_endian = "little")]
// big endian... and qemu doesn't really support threading all that well.
#[cfg(any(miri, target_endian = "little"))]
fn stress() {
// Tests promoting a buffer from a vec -> shared in a concurrent situation
use std::sync::{Arc, Barrier};
use std::thread;
const THREADS: usize = 8;
const ITERS: usize = 1_000;
const ITERS: usize = if cfg!(miri) { 100 } else { 1_000 };
for i in 0..ITERS {
let data = [i as u8; 256];
+2
View File
@@ -1,6 +1,8 @@
//! Test using `Bytes` with an allocator that hands out "odd" pointers for
//! vectors (pointers where the LSB is set).
#![cfg(not(miri))] // Miri does not support custom allocators (also, Miri is "odd" by default with 50% chance)
use std::alloc::{GlobalAlloc, Layout, System};
use std::ptr;