Skip to content

Commit

Permalink
Fewer features
Browse files Browse the repository at this point in the history
  • Loading branch information
d-e-s-o committed Oct 16, 2024
1 parent f1e6435 commit 20f6519
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- runs-on: windows-latest
rust: stable
profile: dev
args: "--tests --features=dont-generate-unit-test-files"
args: "--tests --features=blazesym-dev/dont-generate-unit-test-files"
- runs-on: ubuntu-latest
rust: stable
profile: dev
Expand Down Expand Up @@ -261,7 +261,7 @@ jobs:
path: data/
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo test --tests --release --features=dont-generate-unit-test-files -- ':windows:'
- run: cargo test --tests --release --features=blazesym-dev/dont-generate-unit-test-files -- ':windows:'
test-sanitizers:
name: Test with ${{ matrix.sanitizer }} sanitizer
strategy:
Expand Down
13 changes: 2 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,6 @@ zstd = ["dep:zstd"]
# Below here are dev-mostly features that should not be needed by
# regular users.

# Enable this feature to opt in to the generation of unit test files.
# Having these test files created is necessary for running tests.
generate-unit-test-files = ["blazesym-dev/generate-unit-test-files"]
# Enable this feature to opt in to the generation of large benchmark
# files (also used for regression testing).
generate-large-test-files = ["blazesym-dev/generate-large-test-files"]
# Disable generation of test files. This feature takes preference over
# `generate-unit-test-files`.
dont-generate-unit-test-files = ["blazesym-dev/dont-generate-unit-test-files"]
# Enable code paths requiring a nightly toolchain. This feature is only meant to
# be used for testing and benchmarking purposes, not for the core library, which
# is expected to work on stable.
Expand All @@ -101,7 +92,7 @@ name = "normalize-virt-offset"

[[example]]
name = "inspect-mangled"
required-features = ["demangle", "generate-unit-test-files"]
required-features = ["demangle", "blazesym-dev/generate-unit-test-files"]

[[bench]]
name = "main"
Expand Down Expand Up @@ -138,7 +129,7 @@ anyhow = "1.0.71"
# TODO: Enable `zstd` feature once toolchain support for it is more
# widespread (enabled by default in `ld`). Remove conditionals in
# test code alongside.
blazesym = {path = ".", features = ["generate-unit-test-files", "apk", "breakpad", "gsym", "tracing"]}
blazesym = {path = ".", features = ["apk", "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"]}
Expand Down
7 changes: 4 additions & 3 deletions README-devel.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ $ cargo test --workspace
```
runs the vast majority of tests. Tests require `sudo` to be set up properly, as
some of the functionality we rely on is privileged. Test artifacts are
transparently created as long as the `generate-unit-test-files` feature is
active, which is enabled by default for testing.
transparently created as long as the `generate-unit-test-files` feature for the
`blazesym-dev` package is active, which is enabled by default for
testing.

### Running Miri
[Miri][miri] is used for testing the crate for any undefined behavior.
Expand All @@ -47,7 +48,7 @@ based][libtest] unit-test style ones.
To run the benchmark suite, use:
```sh
# Perform one-time setup of required data.
$ cargo check --features=generate-large-test-files
$ cargo check --package blazesym-dev --features=generate-large-test-files
$ cargo bench --features=nightly
```

Expand Down
2 changes: 1 addition & 1 deletion examples/gsym-in-apk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ path = "main.rs"
blazesym = {version = "=0.2.0-rc.1", path = "../..", default-features = false, features = [
"apk",
"gsym",
"generate-unit-test-files",
]}
blazesym-dev = {path = "../../dev", features = ["generate-unit-test-files"]}
goblin = {version = "0.8.0", default-features = false, features = ["elf32", "elf64", "std"]}
zip = {version = "2.0.0", default-features = false}
2 changes: 1 addition & 1 deletion tests/blazesym.rs
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ fn symbolize_breakpad_inlined() {
/// ```
/// In the past we were unable to handle this case properly.
#[test]
#[cfg_attr(not(feature = "generate-large-test-files"), ignore)]
#[cfg_attr(not(feature = "blazesym-dev/generate-large-test-files"), ignore)]
fn symbolize_dwarf_complex() {
let test_dwarf = Path::new(&env!("CARGO_MANIFEST_DIR"))
.join("data")
Expand Down

0 comments on commit 20f6519

Please sign in to comment.