From 1373d5beed3e5b25f29c6b7a1caf8bc98102b0bd Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Fri, 18 Jun 2021 05:25:28 +0900 Subject: [PATCH] Document how to run unit tests (#1141) --- src/tests/running.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/tests/running.md b/src/tests/running.md index 874ef827..34a44f9c 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