Skip to content

Commit

Permalink
cmake, lint: Adjust lint_includes_build_config
Browse files Browse the repository at this point in the history
  • Loading branch information
hebasto committed May 7, 2024
1 parent 760bcba commit e881caa
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions test/lint/test_runner/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,21 +177,15 @@ Please add any false positives, such as subtrees, or externally sourced files to
}

fn lint_includes_build_config() -> LintResult {
let config_path = "./src/config/bitcoin-config.h.in";
let config_path = "./cmake/bitcoin-config.h.in";
let include_directive = "#include <config/bitcoin-config.h>";
if !Path::new(config_path).is_file() {
assert!(Command::new("./autogen.sh")
.status()
.expect("command error")
.success());
}
let defines_regex = format!(
r"^\s*(?!//).*({})",
check_output(Command::new("grep").args(["undef ", "--", config_path]))
check_output(Command::new("grep").args(["define", "--", config_path]))
.expect("grep failed")
.lines()
.map(|line| {
line.split("undef ")
line.split_whitespace()
.nth(1)
.unwrap_or_else(|| panic!("Could not extract name in line: {line}"))
})
Expand Down

0 comments on commit e881caa

Please sign in to comment.