Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit 490dd80

Browse files
aloucksXanewok
authored andcommitted
Allow the tooltip tests to run in isolation
Prior to this change, the tooltip tests were unknowingly dependent on the other test harness setting the `RUSTC` environment variable, which caused the hover test project build to hang. Also renamed the hover test project's `main.rs` to `lib.rs` for correctness. The test project built before, but did not build successfully due to a missing main function.
1 parent f75e68b commit 490dd80

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/actions/hover.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,6 +1157,13 @@ pub mod test {
11571157
/// Creates a new `TooltipTestHarness`. The `project_dir` must contain
11581158
/// a valid rust project with a `Cargo.toml`.
11591159
pub fn new<O: Output>(project_dir: PathBuf, output: &O) -> TooltipTestHarness {
1160+
use env_logger;
1161+
let _ = env_logger::try_init();
1162+
1163+
if env::var("RUSTC").is_err() {
1164+
env::set_var("RUSTC", "rustc");
1165+
}
1166+
11601167
let pid = process::id();
11611168
let client_caps = ClientCapabilities {
11621169
code_completion_has_snippet_support: true,
File renamed without changes.

0 commit comments

Comments
 (0)