Skip to content

Commit

Permalink
integration: run git checkout in git repo!
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskrgr committed Jul 26, 2023
1 parent 0a79d65 commit 5d0403c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,18 +175,20 @@ fn integration_test_rustc() {
.strip_prefix("commit-hash: ")
.expect("failed parsing commit line");

dbg!(&commit);
// check out the commit in the rustc repo to ensure clippy is compatible

let st_git_checkout = Command::new("git")
.arg("checkout")
.arg(commit)
.current_dir("rust")
.status()
.expect("git failed to check out commit");
assert!(st_git_checkout.success());

let root_dir = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"));
let target_dir = std::path::Path::new(&root_dir).join("target");
let clippy_binary = target_dir.join(env!("PROFILE")).join(CARGO_CLIPPY);
// let clippy_binary = target_dir.join(env!("PROFILE")).join(CARGO_CLIPPY);

// we need to make sure that `x.py clippy` picks up our self-built clippy
// try to make the target dir discoverable as PATH
Expand Down

0 comments on commit 5d0403c

Please sign in to comment.