Skip to content

Commit 39d4d66

Browse files
committed
ensure tool is downloaded by using the min support clang version
1 parent 4a40481 commit 39d4d66

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

clang-installer/src/version.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,14 +289,19 @@ mod tests {
289289
assert!(result.is_none());
290290
}
291291

292+
/// The idea for this test is to make sure the desired clang-tool is downloaded and
293+
/// the download path can be used to identify the location of the clang tool.
292294
#[tokio::test]
293295
async fn eval_download_path() {
294296
let tmp_cache_dir = TempDir::new().unwrap();
295297
unsafe {
296298
std::env::set_var("CPP_LINTER_CACHE", tmp_cache_dir.path());
297299
}
298300
let tool = ClangTool::ClangFormat;
299-
let version_req = VersionReq::parse("17").unwrap();
301+
// for this test we should use the oldest supported clang version
302+
// because that would be most likely to require downloading.
303+
let version_req =
304+
VersionReq::parse(option_env!("MIN_CLANG_TOOLS_VERSION").unwrap_or("11")).unwrap();
300305
let downloaded_clang = RequestedVersion::Requirement(version_req.clone())
301306
.eval_tool(&tool, false)
302307
.await

0 commit comments

Comments
 (0)