rcl/fuzz/Cargo.rcl
Ruud van Asseldonk 94feb8cb9d Add a fuzzer to test various Decimal properties
This is only the start, but let's verify Decimal::cmp against f64::cmp.
It instantly finds an input where they disagree:

	Compare {
	    a: NormalF64(
	        -0.16406250000007813,
	    ),
	    b: NormalF64(
	        0.0,
	    ),
	}
2025-02-24 20:42:59 +01:00

53 lines
1.1 KiB
Text

let root = import "//Cargo.rcl";
{
package =
root.package
| {
name = "rcl-fuzz",
description = "Fuzz targets and helpers for testing RCL.",
publish = false,
metadata = { cargo-fuzz = true },
},
dependencies = {
arbitrary = { version = "1.3.0", features = ["derive"] },
libfuzzer-sys = "0.4.7",
rcl = { path = ".." },
serde = "1.0.114",
serde_json = "1.0.114",
tree-sitter = "0.20.10",
tree-sitter-rcl = { path = "../grammar/tree-sitter-rcl" },
toml = {
version = "0.8.10",
default-features = false,
features = ["parse"],
},
},
bin = [
// Helper binaries.
{
name = "smithctl",
path = "tools/smithctl.rs",
},
// Fuzz targets.
let fuzz_targets = [
"fuzz_cli",
"fuzz_decimal",
"fuzz_escapes",
"fuzz_is_identifier",
"fuzz_smith",
"fuzz_source",
"fuzz_string_len",
"fuzz_tree_sitter",
];
for target in fuzz_targets:
{
name = target,
path = f"fuzz_targets/{target}.rs",
test = false,
doc = false,
},
],
}