cargo-fuzztest: Add initial cargo-fuzztest tool for running Rust fuzz tests in smoke-test mode. Introduce cargo-fuzztest under third_party/googlefuzztest/rust/cargo_fuzztest. Currently, cargo-fuzztest only supports compiling and running Rust fuzz tests in smoke-test (standalone validation) mode for single --lib targets: - Target Triple & Instrumentation: Queries cargo -vV for host triple discovery and injects target-specific sancov instrumentation flags (CARGO_TARGET_<TRIPLE>_RUSTFLAGS) so host tools and proc-macros are not accidentally instrumented or linked against fuzzer runtime symbols. - Compilation & Binary Extraction: Runs cargo test --no-run --message-format=json --target <host_triple> --lib and parses compiler JSON messages to locate the test binary. - Smoke-Test Execution: Executes the test binary filtering on __fuzztest_mod__ with --test-threads=1 to run fuzz target smoke tests. Future CLs will add support for multiple test executables (e.g., --bins targets), full fuzzing workflows integrated with Centipede, and additional CLI arguments. PiperOrigin-RevId: 964162574
diff --git a/BUILD b/BUILD index 7627798..17cbe3f 100644 --- a/BUILD +++ b/BUILD
@@ -1 +1,15 @@ +# Copyright 2026 The Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + exports_files(["MODULE.bazel"])
diff --git a/Cargo.Bazel.lock b/Cargo.Bazel.lock index f6ba62b..984cf1e 100644 --- a/Cargo.Bazel.lock +++ b/Cargo.Bazel.lock
@@ -1,5 +1,5 @@ { - "checksum": "7fe8e06bf5d789f55dfeac6f39f71119f0acdbe34a8356c5c3d64f9ffb0e9d1e", + "checksum": "5b55260ef0981505928ed761a9e3b4b8e936cc7c394b7949e825dd69b4aca89e", "crates": { "aho-corasick 1.1.4": { "name": "aho-corasick", @@ -625,6 +625,58 @@ ], "license_file": "LICENSE-MIT" }, + "cargo-fuzztest 0.1.0": { + "name": "cargo-fuzztest", + "version": "0.1.0", + "package_url": null, + "repository": null, + "targets": [ + { + "Library": { + "crate_name": "cargo_fuzztest", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "cargo_fuzztest", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "deps": { + "common": [ + { + "id": "anyhow 1.0.104", + "target": "anyhow" + }, + { + "id": "clap 4.6.4", + "target": "clap" + }, + { + "id": "serde 1.0.229", + "target": "serde" + }, + { + "id": "serde_json 1.0.151", + "target": "serde_json" + } + ], + "selects": {} + }, + "edition": "2024", + "version": "0.1.0" + }, + "license": null, + "license_ids": [], + "license_file": null + }, "cfg-if 1.0.4": { "name": "cfg-if", "version": "1.0.4", @@ -1413,8 +1465,7 @@ ], "data_glob": [ "**" - ], - "links": "centipede_engine_static" + ] }, "license": null, "license_ids": [], @@ -1734,6 +1785,63 @@ "license_ids": [], "license_file": null }, + "fuzztest-options 0.1.0": { + "name": "fuzztest-options", + "version": "0.1.0", + "package_url": null, + "repository": null, + "targets": [ + { + "Library": { + "crate_name": "fuzztest_options", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "fuzztest_options", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "deps": { + "common": [ + { + "id": "anyhow 1.0.104", + "target": "anyhow" + }, + { + "id": "clap 4.6.4", + "target": "clap" + }, + { + "id": "humantime 2.4.0", + "target": "humantime" + } + ], + "selects": {} + }, + "deps_dev": { + "common": [ + { + "id": "googletest 0.14.3", + "target": "googletest" + } + ], + "selects": {} + }, + "edition": "2024", + "version": "0.1.0" + }, + "license": null, + "license_ids": [], + "license_file": null + }, "getrandom 0.4.3": { "name": "getrandom", "version": "0.4.3", @@ -5769,10 +5877,12 @@ }, "binary_crates": [], "workspace_members": { + "cargo-fuzztest 0.1.0": "rust/cargo_fuzztest", "coverage 0.1.0": "rust/coverage", "engine-ffi 0.1.0": "rust/engine", "fuzztest 0.1.0": "rust", - "fuzztest-macro 0.1.0": "rust/fuzztest_macro" + "fuzztest-macro 0.1.0": "rust/fuzztest_macro", + "fuzztest-options 0.1.0": "rust/options" }, "conditions": { "aarch64-apple-darwin": [ @@ -5883,6 +5993,7 @@ "quote 1.0.47", "rand 0.10.2", "serde 1.0.229", + "serde_json 1.0.151", "spin 0.10.1", "syn 2.0.119", "tempfile 3.27.0"
diff --git a/Cargo.lock b/Cargo.lock index 3d7faa8..01dc9bf 100644 --- a/Cargo.lock +++ b/Cargo.lock
@@ -95,6 +95,18 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] +name = "cargo-fuzztest" +version = "0.1.0" +dependencies = [ + "anyhow", + "clap", + "fuzztest-options", + "googletest", + "serde", + "serde_json", +] + +[[package]] name = "cfg-if" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/Cargo.toml b/Cargo.toml index 9ea0da4..10cb755 100644 --- a/Cargo.toml +++ b/Cargo.toml
@@ -1,5 +1,19 @@ +# Copyright 2026 The Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + [workspace] -members = ["rust", "rust/engine", "rust/fuzztest_macro"] +members = ["rust", "rust/engine", "rust/fuzztest_macro", "rust/cargo_fuzztest"] resolver = "2" [workspace.dependencies] @@ -15,7 +29,8 @@ proc-macro2 = "1.0.106" quote = "1.0.45" rand = { version = "0.10.1", features = ["std_rng"] } -serde = { version = "1.0", features = ["derive"] } +serde = { version = "1.0.228", features = ["derive"] } +serde_json = "1.0.150" spin = "0.10.0" syn = { version = "2.0.117", features = ["extra-traits", "full", "parsing", "printing", "visit-mut"] } tempfile = "3.27.0"
diff --git a/rust/BUILD b/rust/BUILD index ef68440..eb43c11 100644 --- a/rust/BUILD +++ b/rust/BUILD
@@ -1,3 +1,17 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test") licenses(["notice"])
diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 8a414e0..2a7116c 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml
@@ -1,3 +1,17 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + [package] name = "fuzztest" version = "0.1.0"
diff --git a/rust/cargo_fuzztest/BUILD b/rust/cargo_fuzztest/BUILD new file mode 100644 index 0000000..b7c52f1 --- /dev/null +++ b/rust/cargo_fuzztest/BUILD
@@ -0,0 +1,59 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_clippy", "rust_library", "rust_test") + +licenses(["notice"]) + +rust_library( + name = "cargo_fuzztest", + srcs = ["src/lib.rs"], + edition = "2024", + visibility = ["@com_google_fuzztest//rust:__subpackages__"], + deps = [ + "@crate_index//:anyhow", # v1 + "@crate_index//:clap", # v4 + "@crate_index//:serde", # v1 + "@crate_index//:serde_json", # v1 + ], +) + +rust_binary( + name = "cargo_fuzztest_bin", + srcs = ["src/main.rs"], + edition = "2024", + visibility = ["@com_google_fuzztest//rust:__subpackages__"], + deps = [ + ":cargo_fuzztest", + "@crate_index//:anyhow", # v1 + "@crate_index//:clap", # v4 + ], +) + +rust_test( + name = "cargo_fuzztest_lib_test", + crate = ":cargo_fuzztest", + edition = "2024", + deps = [ + "@crate_index//:googletest", + ], +) + +rust_clippy( + name = "cargo_fuzztest_clippy", + deps = [ + ":cargo_fuzztest", + ":cargo_fuzztest_bin", + ], +)
diff --git a/rust/cargo_fuzztest/Cargo.toml b/rust/cargo_fuzztest/Cargo.toml new file mode 100644 index 0000000..9111901 --- /dev/null +++ b/rust/cargo_fuzztest/Cargo.toml
@@ -0,0 +1,28 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +[package] +name = "cargo-fuzztest" +version = "0.1.0" +edition = "2024" + +[dependencies] +anyhow.workspace = true +clap.workspace = true +fuzztest-options = { path = "../options" } +serde.workspace = true +serde_json.workspace = true + +[dev-dependencies] +googletest.workspace = true
diff --git a/rust/cargo_fuzztest/src/lib.rs b/rust/cargo_fuzztest/src/lib.rs new file mode 100644 index 0000000..cee0743 --- /dev/null +++ b/rust/cargo_fuzztest/src/lib.rs
@@ -0,0 +1,211 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#![deny(clippy::absolute_paths)] +#![deny(unused_imports)] + +use anyhow::{Context, Result}; +use clap::Parser; +use std::env; +use std::ffi::OsString; +use std::path::{Path, PathBuf}; +use std::process::Command; + +#[derive(Parser, Debug, Clone, Default)] +pub struct CargoFuzzTestOptions {} + +fn get_cargo_bin() -> String { + env::var("CARGO").unwrap_or_else(|_| "cargo".to_string()) +} + +/// Queries Cargo via `cargo -vV` to discover the default host target triple (e.g. `x86_64-unknown-linux-gnu`). +pub fn get_host_target_triple() -> anyhow::Result<String> { + let cargo_bin = get_cargo_bin(); + let output = Command::new(&cargo_bin) + .arg("-vV") + .output() + .context("while attempting to run `cargo -vV` to determine host target triple")?; + + if !output.status.success() { + anyhow::bail!("cargo -vV exited with status: {:?}", output.status); + } + + let stdout_str = String::from_utf8(output.stdout) + .context("while attempting to parse stdout of cargo -vV as UTF-8")?; + parse_host_triple(&stdout_str) +} + +/// Parses the output of `cargo -vV` to extract the host target triple. +/// +/// Cargo's verbose version output contains lines of key-value metadata, including +/// a `host: <triple>` line representing the host build architecture. +fn parse_host_triple(stdout: &str) -> anyhow::Result<String> { + for line in stdout.lines() { + if let Some(triple) = line.strip_prefix("host: ") { + return Ok(triple.trim().to_string()); + } + } + anyhow::bail!("Failed to find 'host: ' line in cargo -vV output") +} + +/// Parses CLI options for the `cargo-fuzztest` binary. +/// +/// When invoked via `cargo fuzztest ...`, Cargo passes `"fuzztest"` as `argv[1]`. +/// We strip `"fuzztest"` if present so `clap` can parse options cleanly. +pub fn parse_cli_options() -> CargoFuzzTestOptions { + let mut args: Vec<OsString> = env::args_os().collect(); + if args.len() > 1 && args[1] == "fuzztest" { + args.remove(1); + } + CargoFuzzTestOptions::parse_from(args) +} + +pub struct FuzztestRunner { + pub host_triple: String, + pub options: CargoFuzzTestOptions, +} + +impl FuzztestRunner { + pub fn new(host_triple: String, options: CargoFuzzTestOptions) -> Self { + Self { host_triple, options } + } + + /// Constructs `cargo test --no-run --message-format=json --target <host_triple> --lib`. + pub fn build_compile_command(&self) -> Command { + let cargo_bin = get_cargo_bin(); + let mut cmd = Command::new(&cargo_bin); + cmd.args([ + "test", + "--no-run", + "--message-format=json", + "--target", + &self.host_triple, + "--lib", + ]); + + // set flags for sancov instrumentation + let mut rustflags = env::var("RUSTFLAGS").unwrap_or_default(); + rustflags.push_str( + " -Cpasses=sancov-module \ + -Cllvm-args=-sanitizer-coverage-level=4 \ + -Cllvm-args=-sanitizer-coverage-trace-pc-guard \ + -Cllvm-args=-sanitizer-coverage-pc-table \ + -Cllvm-args=-sanitizer-coverage-trace-compares", + ); + cmd.env("RUSTFLAGS", rustflags); + + cmd + } + + /// Parses the JSON stream emitted by `cargo test --message-format=json` to extract the compiled test executable. + pub fn parse_compiler_messages(json_output: &str) -> Result<PathBuf> { + let mut executables = Vec::new(); + + for line in json_output.lines() { + let trimmed = line.trim(); + if trimmed.is_empty() { + continue; + } + if let Ok(val) = serde_json::from_str::<serde_json::Value>(trimmed) { + let is_compiler_artifact = val["reason"] == "compiler-artifact"; + let is_test_profile = val["profile"]["test"].as_bool().unwrap_or(false); + + if is_compiler_artifact + && is_test_profile + && let Some(exe) = val["executable"].as_str() + { + executables.push(PathBuf::from(exe)); + } + } + } + + match executables.len() { + 1 => Ok(executables.remove(0)), + 0 => anyhow::bail!("no test executable found in Cargo compiler JSON output"), + // TODO(the-shank): support multiple test executables, for example from --lib and + // --bins targets. + _ => anyhow::bail!( + "multiple test executables found in Cargo compiler output: {:?}. Expected exactly one.", + executables + ), + } + } + + /// Construct the direct binary invocation command. + pub fn build_run_command(&self, test_binary: &Path) -> Command { + let mut cmd = Command::new(test_binary); + cmd.arg("__fuzztest_mod__"); + cmd.arg("--test-threads=1"); + cmd + } + + /// Runs the tool in two steps: + /// 1. build the test binary + /// 2. run the test binary + pub fn run(&self) -> Result<i32> { + // 1. build the test binary + let compile_output = self + .build_compile_command() + .output() + .context("while attempting to execute `cargo test --no-run` compilation command")?; + + if !compile_output.status.success() { + // print compiler's stderr to help the user diagnose compilation errors. + eprintln!("{}", String::from_utf8_lossy(&compile_output.stderr)); + anyhow::bail!( + "cargo compilation failed with exit code: {:?}", + compile_output.status.code() + ); + } + + let json_stdout = String::from_utf8(compile_output.stdout) + .context("while attempting to parse compilation JSON output as UTF-8")?; + let test_binary = Self::parse_compiler_messages(&json_stdout)?; + + // 2. run the test binary + let mut run_cmd = self.build_run_command(&test_binary); + let status = + run_cmd.status().context("while attempting to execute compiled test binary")?; + + Ok(status.code().unwrap_or(1)) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use googletest::prelude::*; + + #[gtest] + fn test_parse_host_triple_valid() { + let stdout = "rustc 1.75.0 (82e5872f3 2023-12-21)\n\ + binary: rustc\n\ + commit-hash: 82e5872f3d693c9d7d4c2c56a8fb7f59d47c4058\n\ + commit-date: 2023-12-21\n\ + host: x86_64-unknown-linux-gnu\n\ + release: 1.75.0\n\ + LLVM version: 17.0.6\n"; + let result = parse_host_triple(stdout).expect("valid stdout parsing should succeed"); + assert_eq!(result, "x86_64-unknown-linux-gnu"); + } + + #[gtest] + fn test_parse_host_triple_missing_host() { + let stdout = "rustc 1.75.0 (82e5872f3 2023-12-21)\n\ + binary: rustc\n"; + let result = parse_host_triple(stdout); + assert!(result.is_err()); + assert!(result.unwrap_err().to_string().contains("Failed to find 'host: '")); + } +}
diff --git a/rust/cargo_fuzztest/src/main.rs b/rust/cargo_fuzztest/src/main.rs new file mode 100644 index 0000000..b6af086 --- /dev/null +++ b/rust/cargo_fuzztest/src/main.rs
@@ -0,0 +1,29 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#![deny(unused_imports)] +#![deny(clippy::absolute_paths)] + +use cargo_fuzztest::FuzztestRunner; +use std::process; + +fn main() -> anyhow::Result<()> { + let host_triple = cargo_fuzztest::get_host_target_triple()?; + let options = cargo_fuzztest::parse_cli_options(); + + let runner = FuzztestRunner::new(host_triple, options); + let exit_code = runner.run()?; + + process::exit(exit_code); +}
diff --git a/rust/coverage/BUILD b/rust/coverage/BUILD index 1f26ba7..38f65f7 100644 --- a/rust/coverage/BUILD +++ b/rust/coverage/BUILD
@@ -1,3 +1,17 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test") licenses(["notice"])
diff --git a/rust/coverage/Cargo.toml b/rust/coverage/Cargo.toml index 550a6c2..f3091fe 100644 --- a/rust/coverage/Cargo.toml +++ b/rust/coverage/Cargo.toml
@@ -1,3 +1,17 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + [package] name = "coverage" version = "0.1.0"
diff --git a/rust/coverage/src/coverage.rs b/rust/coverage/src/coverage.rs index 258987e..bdfb374 100644 --- a/rust/coverage/src/coverage.rs +++ b/rust/coverage/src/coverage.rs
@@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::slice; #[repr(C)]
diff --git a/rust/coverage/src/lib.rs b/rust/coverage/src/lib.rs index 16eca13..def9c03 100644 --- a/rust/coverage/src/lib.rs +++ b/rust/coverage/src/lib.rs
@@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + mod coverage; pub use coverage::SanCovRuntimeRawFeatureParts;
diff --git a/rust/e2e_tests/BUILD b/rust/e2e_tests/BUILD index 9ebb21b..95e9f58 100644 --- a/rust/e2e_tests/BUILD +++ b/rust/e2e_tests/BUILD
@@ -1,3 +1,17 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test") licenses(["notice"])
diff --git a/rust/e2e_tests/gtest_registration_test.rs b/rust/e2e_tests/gtest_registration_test.rs index 382a6ab..fa6142a 100644 --- a/rust/e2e_tests/gtest_registration_test.rs +++ b/rust/e2e_tests/gtest_registration_test.rs
@@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use googletest::matchers; use googletest::prelude::*; use std::env;
diff --git a/rust/e2e_tests/replay_test.rs b/rust/e2e_tests/replay_test.rs index ca65490..767038a 100644 --- a/rust/e2e_tests/replay_test.rs +++ b/rust/e2e_tests/replay_test.rs
@@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use googletest::matchers; use googletest::prelude::*; use std::fs; @@ -102,7 +116,6 @@ let test_name = "__fuzztest_mod__find_two_bugs_fuzz_test::find_two_bugs_fuzz_test"; let target_binary_path = get_target_binary_path(fixture); - let target_binary_str = target_binary_path.to_str().expect("valid path string"); let db_dir = fixture.tmp_dir_path.join("replay_all_reproduces_all_failures").join("corpus_db_all");
diff --git a/rust/e2e_tests/standalone_mode_test.rs b/rust/e2e_tests/standalone_mode_test.rs index 20ba005..53adb48 100644 --- a/rust/e2e_tests/standalone_mode_test.rs +++ b/rust/e2e_tests/standalone_mode_test.rs
@@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use googletest::matchers; use googletest::prelude::*; use std::process::Command;
diff --git a/rust/e2e_tests/test_utils.rs b/rust/e2e_tests/test_utils.rs index 62ce48e..5ba278b 100644 --- a/rust/e2e_tests/test_utils.rs +++ b/rust/e2e_tests/test_utils.rs
@@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use googletest::fixtures::Fixture; use std::env; use std::path::PathBuf;
diff --git a/rust/e2e_tests/testdata/BUILD b/rust/e2e_tests/testdata/BUILD index 7e47d9d..fe2e4a7 100644 --- a/rust/e2e_tests/testdata/BUILD +++ b/rust/e2e_tests/testdata/BUILD
@@ -1,3 +1,17 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + load("@rules_rust//rust:defs.bzl", "rust_test") package(default_visibility = ["@com_google_fuzztest//rust/e2e_tests:__subpackages__"])
diff --git a/rust/e2e_tests/testdata/fuzz_tests.rs b/rust/e2e_tests/testdata/fuzz_tests.rs index 1a5e874..9b827a9 100644 --- a/rust/e2e_tests/testdata/fuzz_tests.rs +++ b/rust/e2e_tests/testdata/fuzz_tests.rs
@@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use fuzztest::domains::arbitrary::Arbitrary; use fuzztest::domains::range::InRange; use fuzztest::domains::Domain;
diff --git a/rust/e2e_tests/testdata/fuzz_tests_as_gtests.rs b/rust/e2e_tests/testdata/fuzz_tests_as_gtests.rs index 4e2ed7b..d50cf14 100644 --- a/rust/e2e_tests/testdata/fuzz_tests_as_gtests.rs +++ b/rust/e2e_tests/testdata/fuzz_tests_as_gtests.rs
@@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use fuzztest::domains::arbitrary::Arbitrary; use fuzztest::fuzztest; use std::sync::Once;
diff --git a/rust/e2e_tests/testdata/replay_fuzz_tests.rs b/rust/e2e_tests/testdata/replay_fuzz_tests.rs index b4a1027..961b5ce 100644 --- a/rust/e2e_tests/testdata/replay_fuzz_tests.rs +++ b/rust/e2e_tests/testdata/replay_fuzz_tests.rs
@@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use fuzztest::domains::arbitrary::Arbitrary; use fuzztest::fuzztest;
diff --git a/rust/e2e_tests/testdata/standalone_fuzz_tests.rs b/rust/e2e_tests/testdata/standalone_fuzz_tests.rs index e8d7d53..26188a5 100644 --- a/rust/e2e_tests/testdata/standalone_fuzz_tests.rs +++ b/rust/e2e_tests/testdata/standalone_fuzz_tests.rs
@@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use fuzztest::domains::arbitrary::Arbitrary; use fuzztest::fuzztest;
diff --git a/rust/e2e_tests/worker_test.rs b/rust/e2e_tests/worker_test.rs index 7676af5..60d55e9 100644 --- a/rust/e2e_tests/worker_test.rs +++ b/rust/e2e_tests/worker_test.rs
@@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use googletest::matchers; use googletest::prelude::*; use std::fs;
diff --git a/rust/e2e_tests/worker_with_centipede_sanitizer_test.rs b/rust/e2e_tests/worker_with_centipede_sanitizer_test.rs index f4c1221..b38196c 100644 --- a/rust/e2e_tests/worker_with_centipede_sanitizer_test.rs +++ b/rust/e2e_tests/worker_with_centipede_sanitizer_test.rs
@@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #![feature(cfg_sanitize)] #[cfg(any(sanitize = "address", sanitize = "memory"))]
diff --git a/rust/e2e_tests/worker_with_centipede_test.rs b/rust/e2e_tests/worker_with_centipede_test.rs index 4a16a7f..d76f4f9 100644 --- a/rust/e2e_tests/worker_with_centipede_test.rs +++ b/rust/e2e_tests/worker_with_centipede_test.rs
@@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use googletest::matchers; use googletest::prelude::*; use rand::RngExt;
diff --git a/rust/engine/BUILD b/rust/engine/BUILD index 074ae6a..8603658 100644 --- a/rust/engine/BUILD +++ b/rust/engine/BUILD
@@ -1,3 +1,17 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + load("@rules_rust//rust:defs.bzl", "rust_library") licenses(["notice"])
diff --git a/rust/engine/Cargo.toml b/rust/engine/Cargo.toml index 5f3c5c2..d92f6c9 100644 --- a/rust/engine/Cargo.toml +++ b/rust/engine/Cargo.toml
@@ -1,3 +1,17 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + [package] name = "engine-ffi" version = "0.1.0"
diff --git a/rust/engine/build.rs b/rust/engine/build.rs index a1984ff..4057282 100644 --- a/rust/engine/build.rs +++ b/rust/engine/build.rs
@@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Build script for the `engine-ffi` crate. //! //! ## Prerequisites
diff --git a/rust/engine/src/engine_ffi.rs b/rust/engine/src/engine_ffi.rs index 0d63ae9..74badf4 100644 --- a/rust/engine/src/engine_ffi.rs +++ b/rust/engine/src/engine_ffi.rs
@@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + // The source of truth for the FFI definitions in this file are these C++ header files: // - engine_abi.h // - engine_worker_abi.h
diff --git a/rust/engine/src/lib.rs b/rust/engine/src/lib.rs index 7594c50..58f9be3 100644 --- a/rust/engine/src/lib.rs +++ b/rust/engine/src/lib.rs
@@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod engine_ffi; use std::marker::PhantomData;
diff --git a/rust/fuzztest_macro/BUILD b/rust/fuzztest_macro/BUILD index 159657b..378b193 100644 --- a/rust/fuzztest_macro/BUILD +++ b/rust/fuzztest_macro/BUILD
@@ -1,3 +1,17 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + load("@rules_rust//rust:defs.bzl", "rust_proc_macro", "rust_test") licenses(["notice"])
diff --git a/rust/fuzztest_macro/Cargo.toml b/rust/fuzztest_macro/Cargo.toml index 4dfad0e..22da973 100644 --- a/rust/fuzztest_macro/Cargo.toml +++ b/rust/fuzztest_macro/Cargo.toml
@@ -1,3 +1,17 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + [package] name = "fuzztest-macro" version = "0.1.0"
diff --git a/rust/fuzztest_macro/src/helpers.rs b/rust/fuzztest_macro/src/helpers.rs index 14578c9..f18accd 100644 --- a/rust/fuzztest_macro/src/helpers.rs +++ b/rust/fuzztest_macro/src/helpers.rs
@@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use proc_macro2::Span; use proc_macro2::TokenStream; use proc_macro_crate::FoundCrate;
diff --git a/rust/fuzztest_macro/src/helpers/fn_item_utils.rs b/rust/fuzztest_macro/src/helpers/fn_item_utils.rs index 0fd0f2c..40ca8a7 100644 --- a/rust/fuzztest_macro/src/helpers/fn_item_utils.rs +++ b/rust/fuzztest_macro/src/helpers/fn_item_utils.rs
@@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use syn::parse_quote; use syn::visit_mut::{self, VisitMut}; use syn::BareFnArg;
diff --git a/rust/fuzztest_macro/src/helpers/fuzztest_domain.rs b/rust/fuzztest_macro/src/helpers/fuzztest_domain.rs index 31e334d..6cb6b58 100644 --- a/rust/fuzztest_macro/src/helpers/fuzztest_domain.rs +++ b/rust/fuzztest_macro/src/helpers/fuzztest_domain.rs
@@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use proc_macro2::TokenStream; use quote::quote; use syn::parse_quote;
diff --git a/rust/fuzztest_macro/src/helpers/test_registration.rs b/rust/fuzztest_macro/src/helpers/test_registration.rs index d44614c..3806469 100644 --- a/rust/fuzztest_macro/src/helpers/test_registration.rs +++ b/rust/fuzztest_macro/src/helpers/test_registration.rs
@@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use convert_case::Case; use convert_case::Casing; use proc_macro2::Span;
diff --git a/rust/fuzztest_macro/src/lib.rs b/rust/fuzztest_macro/src/lib.rs index 19450ea..12f164e 100644 --- a/rust/fuzztest_macro/src/lib.rs +++ b/rust/fuzztest_macro/src/lib.rs
@@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + /// Modules here cannot be public (ie: `pub`) because a proc-macro crate cannot export anything else /// other than a proc-macro. That is to say, a function tagged with `#[proc_macro]`, /// `#[proc_macro_attribute]`, `#[proc_macro_derive]`
diff --git a/rust/fuzztest_macro/src/test_main.rs b/rust/fuzztest_macro/src/test_main.rs index f01ede3..aa93924 100644 --- a/rust/fuzztest_macro/src/test_main.rs +++ b/rust/fuzztest_macro/src/test_main.rs
@@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + // This file exists only as a workaround. It serves as the crate root for the `fuzztest_macro_test` // BUILD target. // This file should not be included in the `fuzztest_macro` crate.
diff --git a/rust/options/BUILD b/rust/options/BUILD index b85746a..2fc95f3 100644 --- a/rust/options/BUILD +++ b/rust/options/BUILD
@@ -1,3 +1,17 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test") licenses(["notice"])
diff --git a/rust/options/Cargo.toml b/rust/options/Cargo.toml index 2fa2ff4..29975b2 100644 --- a/rust/options/Cargo.toml +++ b/rust/options/Cargo.toml
@@ -1,3 +1,17 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + [package] name = "fuzztest-options" version = "0.1.0"
diff --git a/rust/options/src/lib.rs b/rust/options/src/lib.rs index 1e72d34..2e49538 100644 --- a/rust/options/src/lib.rs +++ b/rust/options/src/lib.rs
@@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + // This module provides the core command-line flag and environment variable options // structure (`FuzzTestOptions`) and domain execution modes (`ExecutionMode`).
diff --git a/rust/src/crash_handler.rs b/rust/src/crash_handler.rs index 5dddf70..db3ede0 100644 --- a/rust/src/crash_handler.rs +++ b/rust/src/crash_handler.rs
@@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[cfg(any(sanitize = "address", sanitize = "memory"))] mod callbacks { use std::ffi::{c_char, CStr};
diff --git a/rust/src/domains.rs b/rust/src/domains.rs index 9180d03..a4bcd2c 100644 --- a/rust/src/domains.rs +++ b/rust/src/domains.rs
@@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod arbitrary; pub mod range; pub mod tuple_of;
diff --git a/rust/src/domains/arbitrary.rs b/rust/src/domains/arbitrary.rs index 07d7db5..99e0f41 100644 --- a/rust/src/domains/arbitrary.rs +++ b/rust/src/domains/arbitrary.rs
@@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use super::utility::choose_value; use super::utility::mutate_integer; use super::utility::shrink_towards;
diff --git a/rust/src/domains/range.rs b/rust/src/domains/range.rs index fd44e20..3bf413b 100644 --- a/rust/src/domains/range.rs +++ b/rust/src/domains/range.rs
@@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use super::Domain; use anyhow;
diff --git a/rust/src/domains/tuple_of.rs b/rust/src/domains/tuple_of.rs index ac63964..4db94f8 100644 --- a/rust/src/domains/tuple_of.rs +++ b/rust/src/domains/tuple_of.rs
@@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + // TODO(yamilmorales, tinmar, mathuxny-73): Replace generated wrapper domain (to deduplicate // implementations for tests with the same number of parameters) with these, meaning we should // `impl Domain` on these tuples.
diff --git a/rust/src/domains/utility.rs b/rust/src/domains/utility.rs index e312f20..2ce15fa 100644 --- a/rust/src/domains/utility.rs +++ b/rust/src/domains/utility.rs
@@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::cmp::Ordering; use num_traits::PrimInt;
diff --git a/rust/src/internal.rs b/rust/src/internal.rs index d440b68..c83c157 100644 --- a/rust/src/internal.rs +++ b/rust/src/internal.rs
@@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use super::domains::GenericCorpusValue; use super::domains::GenericDomain; use std::collections::HashMap;
diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 82ee073..6a8d7a1 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs
@@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #![feature(cfg_sanitize)] mod crash_handler;
diff --git a/rust/src/options.rs b/rust/src/options.rs index 210a535..053cd81 100644 --- a/rust/src/options.rs +++ b/rust/src/options.rs
@@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use crate::internal::FuzzTestRegistration; use ::engine::engine_ffi; use anyhow::Context;
diff --git a/rust/src/worker.rs b/rust/src/worker.rs index a8ea1ea..20ac83f 100644 --- a/rust/src/worker.rs +++ b/rust/src/worker.rs
@@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use super::domains::GenericCorpusValue; use super::internal::{BoxedFuzzTest, FuzzTest}; use super::options::{self, CentipedeArgs, ExecutionAction};
diff --git a/rust/tests/macro_compiles.rs b/rust/tests/macro_compiles.rs index a294458..2c1506d 100644 --- a/rust/tests/macro_compiles.rs +++ b/rust/tests/macro_compiles.rs
@@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use fuzztest::domains::arbitrary::Arbitrary; use fuzztest::fuzztest;
diff --git a/rust/tests/trybuild.rs b/rust/tests/trybuild.rs index c2d9ebd..b9a81e9 100644 --- a/rust/tests/trybuild.rs +++ b/rust/tests/trybuild.rs
@@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[test] fn fuzztest() { let t = trybuild::TestCases::new();