project_note
Clone
https://git.tahinli.com/Tahinli/project_note.git
0 watching0 forksRust3.6 MiBc49f5e7Tahinli1 month ago2 commits
| 1 | import * as path from "https://deno.land/std@0.105.0/path/mod.ts"; |
| 2 | const __dirname = path.dirname(path.fromFileUrl(import.meta.url)); |
| 3 | import { resolve } from "https://deno.land/std@0.198.0/path/mod.ts"; |
| 4 | |
| 5 | const validTargets = Array.from( |
| 6 | Deno.readDirSync(resolve(__dirname, "../fuzz/fuzz_targets")), |
| 7 | ).map((x) => x.name.replace(/.rs$/, "")); |
| 8 | |
| 9 | const targets = |
| 10 | Deno.args.length === 0 |
| 11 | ? validTargets |
| 12 | : Deno.args.filter((x) => validTargets.includes(x)); |
| 13 | |
| 14 | const promises = []; |
| 15 | for (const target of targets) { |
| 16 | const cmd = [ |
| 17 | "cargo", |
| 18 | "+nightly", |
| 19 | "fuzz", |
| 20 | "run", |
| 21 | target, |
| 22 | "--", |
| 23 | "-max_total_time=1", |
| 24 | ]; |
| 25 | console.log("🔨" + cmd.join(" ")); |
| 26 | promises.push( |
| 27 | Deno.run({ |
| 28 | cmd, |
| 29 | stdout: "inherit", |
| 30 | stderr: "inherit", |
| 31 | cwd: resolve(__dirname, ".."), |
| 32 | }).status(), |
| 33 | ); |
| 34 | } |
| 35 | |
| 36 | await Promise.allSettled(promises); |