Stream: t-compiler

Topic: Running unit tests for compiler crates

matklad (Jul 26 2019 at 11:36, on Zulip):

How do I run #[test] tests in various librustc_x crates? I've tried ./ --stage 1 test src/librustc_lexer, but that unfortunately compiles the whole compiler before actually running the tests.

nagisa (Jul 26 2019 at 11:57, on Zulip):

Try --stage 0?

Zoxc (Jul 26 2019 at 12:21, on Zulip):

I don't think you can pick the crates to test, nor avoid compiling the compiler

simulacrum (Jul 26 2019 at 12:37, on Zulip):

Yeah, there's an open issue about that

Eric Huss (Jul 26 2019 at 14:08, on Zulip):

Did you see ?

simulacrum (Jul 26 2019 at 14:16, on Zulip):

that helps with the reason we need to do it but I think rustbuild might still be "dumb" and not do the right thing quite yet

matklad (Jul 26 2019 at 15:22, on Zulip):

Heh, the discussion in #61097 seems interesting. Presumably, if we move forward with librarification of compiler, plain old unit tests and cargo integration tests would become more important.

Vadim Petrochenkov (Jul 26 2019 at 16:06, on Zulip):

With #61097 unit tests require building the whole compiler once, after that they can be modified and run immediately with ./ test --stage 0 src/librustc_lexer.

Last update: Jul 14 2020 at 13:35UTC