Skip to main content

turbo_tasks_fuzz/
main.rs

1#![cfg_attr(windows, feature(junction_point))]
2
3mod fs_watcher;
4mod symlink_stress;
5
6use clap::{Parser, Subcommand};
7
8/// A collection of fuzzers for `turbo-tasks`. These are not test cases as they're slow and (in many
9/// cases) non-deterministic.
10///
11/// It's recommend you build this with `--release`.
12///
13/// This is its own crate to avoid littering other crates with binary-only dependencies
14/// <https://github.com/rust-lang/cargo/issues/1982>.
15#[derive(Parser)]
16#[command()]
17struct Cli {
18    #[command(subcommand)]
19    command: Commands,
20}
21
22#[derive(Subcommand)]
23enum Commands {
24    /// Continuously fuzzes the filesystem watcher until ctrl+c'd.
25    FsWatcher(fs_watcher::FsWatcher),
26    /// Stress tests symlink/junction writes in a tight loop.
27    SymlinkStress(symlink_stress::SymlinkStress),
28}
29
30#[tokio::main]
31async fn main() -> anyhow::Result<()> {
32    let cli = Cli::parse();
33
34    match cli.command {
35        Commands::FsWatcher(args) => fs_watcher::run(args).await,
36        Commands::SymlinkStress(args) => symlink_stress::run(args).await,
37    }
38}