Code Monkey home page Code Monkey logo

sanitizers-test-libstd's Introduction

This repository serves to run the libcore, liballoc, and libstd test suites in Miri. This includes unit tests, integration tests, and doc tests, but not rustc ui tests.

Every night, a CI cron job runs the tests against the latest nightly, to make sure we notice when changes in Rust or Miri break a test. (Some libstd tests are excluded since they rely on platform-specific APIs that Miri does not implement.)

Running the tests yourself

To run the tests yourself, make sure you have Miri installed (rustup component add miri) and then run:

./run-test.sh core --lib --tests
./run-test.sh alloc --lib --tests
MIRIFLAGS="-Zmiri-disable-isolation" ./run-test.sh std --lib --tests -- time::

This will run the test suite of the standard library of your current toolchain. --lib --tests means that doc tests are skipped; those should use separate Miri flags as there are some (expected) memory leaks. Use --doc to run only doc tests. For std, we cannot run all tests since they will use networking and file system APIs that we do not support.

If you are working on the standard library and want to check that the tests pass with your modifications, set MIRI_LIB_SRC to the library folder of the checkout you are working in:

MIRI_LIB_SRC=~/path/to/rustc/library ./run-test.sh core --lib --tests

Here, ~/path/to/rustc should be the directory containing x.py. Then the test suite will be compiled from the standard library in that directory. Make sure that is as close to your rustup default toolchain as possible, as the toolchain will still be used to build that standard library and its test suite. If you are getting strange build errors, cargo clean can often fix that.

run-test also accepts parameters that are passed to cargo test and the test runner, and MIRIFLAGS can be used as usual to pass parameters to Miri:

MIRIFLAGS="-Zmiri-ignore-leaks -Zmiri-disable-isolation" ./run-test.sh alloc --doc -- --skip vec

If you want to know how long each test took to execute, add 2>&1 | ts -m -i '%.s ' to the end of the command, or use the test flags -Zunstable-options --report-time (the latter option also requires -Zmiri-disable-isolation in the Miri flags).

sanitizers-test-libstd's People

Contributors

camelid avatar eduardosm avatar lukas-code avatar ralfjung avatar saethlin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.