Factored out test program and fuzzing features; core crate now only depends on smallvec and log.

This commit is contained in:
Chris Fallin
2021-04-18 13:38:05 -07:00
parent 34ab744f4f
commit 414f3f828d
6 changed files with 39 additions and 15 deletions

View File

@@ -4,24 +4,20 @@ 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 = "*"
[dev-dependencies]
criterion = "0.3"
# The below are only needed for fuzzing.
# Keep this in sync with libfuzzer_sys's crate version:
arbitrary = { version = "^0.4.6", optional = true }
[profile.release]
debug = true
[[bench]]
name = "regalloc"
harness = false
[features]
default = []
fuzzing = ["arbitrary"]

View File

@@ -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 = ["."]

View File

@@ -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.

28
test/Cargo.toml Normal file
View File

@@ -0,0 +1,28 @@
[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 = "*" }
[dev-dependencies]
criterion = "0.3"
[profile.release]
debug = true
[[bench]]
name = "regalloc"
harness = false