-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #639 from aya-rs/test-no-bpftool
Remove dependency on bpftool in integration tests
- Loading branch information
Showing
9 changed files
with
52 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,5 +12,4 @@ syn = "2" | |
quote = "1" | ||
proc-macro2 = "1" | ||
indoc = "2.0" | ||
lazy_static = "1" | ||
serde_json = "1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,15 @@ | ||
use lazy_static::lazy_static; | ||
use serde_json::Value; | ||
use std::process::Command; | ||
use std::{cell::OnceCell, process::Command}; | ||
|
||
lazy_static! { | ||
pub static ref WORKSPACE_ROOT: String = workspace_root(); | ||
} | ||
|
||
fn workspace_root() -> String { | ||
let output = Command::new("cargo").arg("metadata").output().unwrap(); | ||
if !output.status.success() { | ||
panic!("unable to run cargo metadata") | ||
} | ||
let stdout = String::from_utf8(output.stdout).unwrap(); | ||
let v: Value = serde_json::from_str(&stdout).unwrap(); | ||
v["workspace_root"].as_str().unwrap().to_string() | ||
pub fn workspace_root() -> &'static str { | ||
static mut WORKSPACE_ROOT: OnceCell<String> = OnceCell::new(); | ||
unsafe { &mut WORKSPACE_ROOT }.get_or_init(|| { | ||
let output = Command::new("cargo").arg("metadata").output().unwrap(); | ||
if !output.status.success() { | ||
panic!("unable to run cargo metadata") | ||
} | ||
let stdout = String::from_utf8(output.stdout).unwrap(); | ||
let v: Value = serde_json::from_str(&stdout).unwrap(); | ||
v["workspace_root"].as_str().unwrap().to_string() | ||
}) | ||
} |