Skip to content

Commit

Permalink
Factored out test program and fuzzing features; core crate now only d…
Browse files Browse the repository at this point in the history
…epends on smallvec and log.
  • Loading branch information
cfallin committed Apr 18, 2021
1 parent 34ab744 commit 520d7d7
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 10 deletions.
17 changes: 10 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@ version = "0.0.1"
authors = ["Chris Fallin <chris@cfallin.org>", "Mozilla SpiderMonkey Developers"]
edition = "2018"
license = "Apache-2.0 WITH LLVM-exception AND MPL-2.0"
description = "Backtracking register allocator ported from IonMonkey"
repository = "https://github.com/cfallin/regalloc2"
description = "Backtracking register allocator inspired from IonMonkey"
repository = "https://github.com/bytecodealliance/regalloc2"

[dependencies]
log = { version = "0.4.8", default-features = false }
smallvec = "1.6.1"
# keep this in sync with libfuzzer_sys's crate version:
arbitrary = "^0.4.6"
rand = "0.8"
rand_chacha = "0.3"
env_logger = "*"

# The below are only needed for fuzzing.
# Keep this in sync with libfuzzer_sys's crate version:
arbitrary = { version = "^0.4.6", optional = true }

[dev-dependencies]
criterion = "0.3"
Expand All @@ -25,3 +24,7 @@ debug = true
[[bench]]
name = "regalloc"
harness = false

[features]
default = []
fuzzing = ["arbitrary"]
4 changes: 1 addition & 3 deletions fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@ edition = "2018"
cargo-fuzz = true

[dependencies]
regalloc2 = { path = "../", features = ["fuzzing"] }
libfuzzer-sys = "0.3"
arbitrary = { version = "^0.4.6", features = ["derive"] }
log = { version = "0.4.8", default-features = false }
env_logger = "0.8.3"

[dependencies.regalloc2]
path = ".."

# Prevent this from interfering with workspaces
[workspace]
members = ["."]
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ pub mod index;
pub use index::{Block, Inst, InstRange, InstRangeIter};

pub mod checker;

#[cfg(feature = "fuzzing")]
pub mod fuzzing;

/// Register classes.
Expand Down
20 changes: 20 additions & 0 deletions test/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[package]
name = "regalloc2-test"
version = "0.0.1"
authors = ["Chris Fallin <chris@cfallin.org>", "Mozilla SpiderMonkey Developers"]
edition = "2018"
license = "Apache-2.0 WITH LLVM-exception AND MPL-2.0"
description = "small test driver for benchmarking regalloc2"
repository = "https://github.com/bytecodealliance/regalloc2"

[dependencies]
regalloc2 = { version = "*", path = "../", features = ["fuzzing"] }

# Keep this in sync with libfuzzer_sys's crate version:
arbitrary = { version = "^0.4.6" }
rand = { version = "0.8" }
rand_chacha = { version = "0.3" }
env_logger = { version = "*" }

[profile.release]
debug = true
File renamed without changes.

0 comments on commit 520d7d7

Please sign in to comment.