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

Move to libtest #162

Merged
merged 1 commit into from
Mar 19, 2019
Merged

Move to libtest #162

merged 1 commit into from
Mar 19, 2019

Conversation

Manishearth
Copy link
Owner

No description provided.

Copy link
Contributor

@oli-obk oli-obk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me

@Manishearth
Copy link
Owner Author

(I will merge and publish once travis passes and once I'm sure that it's working in clippy)

@Manishearth
Copy link
Owner Author

Nope, this is more complex, since libtest itself doesn't work on stable, and there's no way to pull in a dependency when a feature is turned off when that feature does other things too. Hmm.

@Manishearth
Copy link
Owner Author

@gnzlbg I'm not sure what's going on here, can you take a look? I can't get rid of feature(test) when using the libtest crate.

@gnzlbg
Copy link

gnzlbg commented Mar 19, 2019

@Manishearth the libtest crate is not really ready for general use from crates.io yet. It works for the compiler, but further refactorings will be necessary to get there.

@Manishearth
Copy link
Owner Author

@gnzlbg well in the meantime this has broken clippy :|

@gnzlbg
Copy link

gnzlbg commented Mar 19, 2019

Ehm, that shouldn't have happened. The shipped test crate should still be "the same" (export the same API). Do you have a link to an error message?

@Manishearth
Copy link
Owner Author

[15:17:46] मanishearth@noether ~/mozilla/Wall/compiletest-rs ^_^ 
$ cargo +master build 
   Compiling compiletest_rs v0.3.19 (/home/manishearth/mozilla/Wall/compiletest-rs)
error[E0432]: unresolved import `test::ColorConfig`
  --> src/common.rs:20:5
   |
20 | use test::ColorConfig;
   |     ^^^^^^^^^^^^^^^^^ no `ColorConfig` in the root

error[E0433]: failed to resolve: could not find `OutputFormat` in `test`
   --> src/lib.rs:104:41
    |
104 |         format: if config.quiet { test::OutputFormat::Terse } else { test::OutputFormat::Pretty },
    |                                         ^^^^^^^^^^^^ could not find `OutputFormat` in `test`

error[E0433]: failed to resolve: could not find `OutputFormat` in `test`
   --> src/lib.rs:104:76
    |
104 |         format: if config.quiet { test::OutputFormat::Terse } else { test::OutputFormat::Pretty },
    |                                                                            ^^^^^^^^^^^^ could not find `OutputFormat` in `test`

error[E0425]: cannot find function `run_tests_console` in module `test`
  --> src/lib.rs:87:21
   |
87 |     let res = test::run_tests_console(&opts, tests.into_iter().collect());
   |                     ^^^^^^^^^^^^^^^^^ not found in `test`

error[E0425]: cannot find value `AutoColor` in module `test`
   --> src/lib.rs:112:22
    |
112 |         color: test::AutoColor,
    |                      ^^^^^^^^^ not found in `test`

error[E0412]: cannot find type `TestFn` in module `test`
   --> src/lib.rs:274:75
    |
274 | pub fn make_test_closure(config: &Config, testpaths: &TestPaths) -> test::TestFn {
    |                                                                           ^^^^^^ not found in `test`

error: aborting due to 6 previous errors

Some errors occurred: E0412, E0425, E0432, E0433.
For more information about an error, try `rustc --explain E0412`.
error: Could not compile `compiletest_rs`.

To learn more, run the command again with --verbose.

@Manishearth
Copy link
Owner Author

Ah, you're missing some reexports

@Manishearth
Copy link
Owner Author

Clippy itself additionally needs run_tests_console

@gnzlbg
Copy link

gnzlbg commented Mar 19, 2019

@Manishearth yeah, I remember we decided to try to minimize what's being re-exported. I argued that it might break stuff, and here we are.

I think using libtest and enabling the test feature is the best short term fix. The first refactor to do will be to make the crate work without the feature(test).

@Manishearth
Copy link
Owner Author

We can't, this crate is used by stable users too, who don't use the libtest bits, and cargo features aren't powerful enough to do this correctly.

@gnzlbg
Copy link

gnzlbg commented Mar 19, 2019

Ok, I'll speed up libtest refactors, and will send here a PR fixing things.

@Manishearth Manishearth merged commit 3e99253 into master Mar 19, 2019
@Manishearth
Copy link
Owner Author

This crate is already broken on stable, it seems.

@Manishearth Manishearth deleted the rustup branch March 19, 2019 22:49
@dtolnay
Copy link
Contributor

dtolnay commented Mar 20, 2019

This crate is already broken on stable, it seems.

This crate worked fine for me on stable before this change. Reported as #164.

@@ -20,7 +20,7 @@ extern crate rustc;

#[cfg(unix)]
extern crate libc;
extern crate test;
extern crate libtest as test;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which test did this link against before? Clearly something that worked on stable, whereas libtest does not compile on stable because it depends on rustc_term.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rustc ships with a libtest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants