Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
d-e-s-o committed Oct 18, 2024
1 parent 388f207 commit 802a2b7
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ jobs:
rust: stable
profile: release
args: "--lib --no-default-features"
- runs-on: windows-latest
rust: stable
profile: dev
args: "--tests --features=blazesym-dev/dont-generate-unit-test-files"
- runs-on: macos-latest
rust: stable
profile: release
Expand Down
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,15 @@ blazesym = {path = ".", features = ["apk", "bpf", "breakpad", "gsym", "tracing"]
blazesym-dev = {path = "dev", features = ["generate-unit-test-files"]}
# TODO: Use 0.5.2 once released.
criterion = {git = "https://github.com/bheisler/criterion.rs.git", rev = "b913e232edd98780961ecfbae836ec77ede49259", default-features = false, features = ["rayon", "cargo_bench_support"]}
libbpf-rs = "0.24"
scopeguard = "1.2"
stats_alloc = {version = "0.1.1", features = ["nightly"]}
tempfile = "3.4"
test-log = {version = "0.2.14", default-features = false, features = ["trace"]}
test-tag = "0.1.3"

[target.'cfg(target_os = "linux")'.dev-dependencies]
libbpf-rs = "0.24"

# A set of unused dependencies that we require to force correct minimum versions
# of transitive dependencies, for cases where our dependencies have incorrect
# dependency specifications themselves.
Expand Down
4 changes: 3 additions & 1 deletion dev/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ dont-generate-unit-test-files = []

[build-dependencies]
dump_syms = {version = "2.3", optional = true, default-features = false}
libbpf-sys = {version = "1.4.1", default-features = false, optional = true}
libc = "0.2.137"
reqwest = {version = "0.12.0", optional = true, features = ["blocking"]}
tempfile = {version = "3.3", optional = true}
vmlinux = {git = "https://github.com/libbpf/vmlinux.h.git", rev = "a9c092aa771310bf8b00b5018f7d40a1fdb6ec82"}
xz2 = {version = "0.1.7", optional = true}
zip = {version = "2.0.0", optional = true, default-features = false}
zstd = {version = "0.13.1", default-features = false, optional = true}

[target.'cfg(target_os = "linux")'.build-dependencies]
libbpf-sys = {version = "1.4.1", default-features = false, optional = true}
15 changes: 12 additions & 3 deletions dev/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,10 @@ fn prepare_test_files() {


/// Extract vendored libbpf header files into a directory.
#[cfg(feature = "generate-unit-test-files")]
#[cfg(all(
feature = "generate-unit-test-files",
not(feature = "dont-generate-unit-test-files")
))]
fn extract_libbpf_headers(target_dir: &Path) {
use std::fs;
use std::fs::OpenOptions;
Expand All @@ -616,7 +619,10 @@ fn extract_libbpf_headers(target_dir: &Path) {
}


#[cfg(feature = "generate-unit-test-files")]
#[cfg(all(
feature = "generate-unit-test-files",
not(feature = "dont-generate-unit-test-files")
))]
fn with_bpf_headers<F>(f: F)
where
F: FnOnce(&Path),
Expand All @@ -628,7 +634,10 @@ where
let () = f(header_parent_dir.path());
}

#[cfg(not(feature = "generate-unit-test-files"))]
#[cfg(any(
not(feature = "generate-unit-test-files"),
feature = "dont-generate-unit-test-files"
))]
fn with_bpf_headers<F>(_f: F)
where
F: FnOnce(&Path),
Expand Down

0 comments on commit 802a2b7

Please sign in to comment.