From ea4850870349fc981a3c76e74fe073fc098de881 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Sat, 12 Jun 2021 06:32:47 +0900 Subject: [PATCH] Document how to run unit tests --- src/tests/running.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/tests/running.md b/src/tests/running.md index 874ef8274..34a44f9c2 100644 --- a/src/tests/running.md +++ b/src/tests/running.md @@ -92,6 +92,20 @@ tests for components you did not change at all. build; therefore, while the tests **usually** work fine with stage 1, there are some limitations. +## Run unit tests on the compiler/library + +You may want to run unit tests on a specific file with following: + +```bash +./x.py test compiler/rustc_data_structures/src/thin_vec/tests.rs +``` + +But unfortunately, it's impossible. You should invoke following instead: + +```bash +./x.py test compiler/rustc_data_structures/ --test-args thin_vec +``` + ## Running an individual test Another common thing that people want to do is to run an **individual