Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --filter-mode=run-pass,compile-pass to compiletest #61719

Closed
wants to merge 5 commits into from

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Jun 10, 2019

Add a --filter-mode option to compiletest and expose it through ./x.py.

The --filter-mode flag will take a comma separated list of modes:

  • compile-pass
  • compile-fail
  • run-pass
  • ui
  • and more:
    • run-fail
    • run-pass-valgrind
    • pretty
    • debuginfo-cdb
    • debuginfo-gdb+lldb
    • debuginfo-lldb
    • debuginfo-gdb
    • codegen
    • rustdoc
    • codegen-units
    • incremental
    • run-make
    • js-doc-test
    • mir-opt
    • assembly

When the mode is ui (e.g. src/test/ui) then:

  • // compile-pass is interpreted as provided mode compile-pass.
  • // run-pass is interpreted as provided mode run-pass.
  • Absence of those two is interpreted as mode compile-fail.

When --filter-mode is used, only tests fitting the modes included in the flag are retained. Other tests are ignored.

As an example run, you can use ./x.py -i test --stage 1 --filter-mode run-pass to execute all run-pass tests whether they are in src/test/ui or inside src/test/run-pass.

Another example is ./x.py -i test src/test/ui --stage 1 --filter-mode run-pass,compile-pass which will cover both run-pass and compile-pass tests in src/test/ui specifically.

This PR moves us towards a more systematic testing scheme in the spirit of #61712 and may enable moving src/test/run-pass altogether to src/test/ui.

r? @petrochenkov

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 10, 2019
@Centril Centril changed the title Add --filter-mode=$comma_sep_list_of_modes to compiletest Add --filter-mode=run-pass,compile-pass to compiletest Jun 10, 2019
@rust-highfive

This comment has been minimized.

@petrochenkov
Copy link
Contributor

This is a bit different from what I expected.

I'll write some more about the common use scenarios in #61712 once I get to it.

@petrochenkov
Copy link
Contributor

As implemented, --filter-mode will mostly duplicate the "primary" nameless argument of x.py test when compile-fail and run-pass directories are merged into ui (which is the desired end state).

Forcing all the ui tests to check mode (run fast, but still produce all the .stderr files) may be a more useful operation.

@Centril
Copy link
Contributor Author

Centril commented Jun 11, 2019

As implemented, --filter-mode will mostly duplicate the "primary" nameless argument of x.py test when compile-fail and run-pass directories are merged into ui (which is the desired end state).

I'm not sure I follow... what is the nameless argument?

My desired end state is to not have compile-fail and run-pass directories at all but rather that tests be organized by their semantic area (what the rfc is, what parts of the language they affect, e.g. ctfe, borrowck, typeck, parser...). This is aligned with @nikomatsakis's vision in #61526 (comment).

Forcing all the ui tests to check mode (run fast, but still produce all the .stderr files) may be a more useful operation.

I don't know which one is most useful, but I feel these are orthogonal operations that both can be supported. At least, --filter-mode can be useful in the interim to allow us to move the tests.

@petrochenkov
Copy link
Contributor

Let's close this for now and reconsider when #61755 is done and run-pass tests are merged into UI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants