File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,12 +44,7 @@ import {
4444 reportFinding ,
4545} from "./finding" ;
4646import { getJazzerJsGlobal , jazzerJs } from "./globals" ;
47- import {
48- buildLibAflOptions ,
49- buildLibFuzzerOptions ,
50- OptionsManager ,
51- resolveEngine ,
52- } from "./options" ;
47+ import { buildLibAflOptions , buildLibFuzzerOptions } from "./options" ;
5348import { ensureFilepath , importModule } from "./utils" ;
5449
5550// Remove temporary files on exit
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ import fs from "fs";
1818import os from "os" ;
1919import path from "path" ;
2020
21- import { OptionsManager , OptionSource } from "@jazzer.js/options" ;
21+ import { Mode , OptionsManager , OptionSource } from "@jazzer.js/options" ;
2222
2323import { buildLibAflOptions , spawnsSubprocess } from "./options" ;
2424
@@ -57,7 +57,7 @@ describe("libafl options", () => {
5757 ) ;
5858
5959 expect ( buildLibAflOptions ( manager ) ) . toEqual ( {
60- mode : "fuzzing" ,
60+ mode : Mode . Fuzzing ,
6161 runs : 99 ,
6262 seed : 1337 ,
6363 maxLen : 1024 ,
@@ -85,14 +85,14 @@ describe("libafl options", () => {
8585 const manager = new OptionsManager ( OptionSource . DefaultCLIOptions ) . merge (
8686 {
8787 engine : "libafl" ,
88- mode : "regression" ,
88+ mode : Mode . Regression ,
8989 fuzzerOptions : [ "corpus" , "-runs=1" ] ,
9090 } ,
9191 OptionSource . CommandLineArguments ,
9292 ) ;
9393
9494 expect ( buildLibAflOptions ( manager ) ) . toEqual ( {
95- mode : "regression" ,
95+ mode : Mode . Regression ,
9696 runs : 0 ,
9797 seed : 0 ,
9898 maxLen : 4096 ,
Original file line number Diff line number Diff line change @@ -19,11 +19,13 @@ import * as fs from "fs";
1919import * as os from "os" ;
2020import * as path from "path" ;
2121
22+ import { Mode } from "@jazzer.js/options" ;
23+
2224import { addon } from "./addon" ;
2325import { fuzzer } from "./fuzzer" ;
2426
2527const libAflOptions = {
26- mode : "fuzzing" as const ,
28+ mode : Mode . Fuzzing ,
2729 runs : 32 ,
2830 seed : 1234 ,
2931 maxLen : 64 ,
@@ -308,7 +310,7 @@ describe("LibAFL runtime", () => {
308310 fuzzer . tracer . tracePcIndir ( 13 , data . length ) ;
309311 } ,
310312 {
311- mode : "fuzzing" ,
313+ mode : Mode . Fuzzing ,
312314 runs : 1 ,
313315 seed : 9 ,
314316 maxLen : 16 ,
Original file line number Diff line number Diff line change 1414 * limitations under the License.
1515 */
1616
17+ const { Mode } = require ( "../../options/dist/index.js" ) ;
1718const { addon } = require ( "../dist/addon.js" ) ;
1819const { fuzzer } = require ( "../dist/fuzzer.js" ) ;
1920
@@ -28,7 +29,7 @@ const libFuzzerArgs = [
2829 `-max_len=${ maxLen } ` ,
2930] ;
3031const libAflOptions = {
31- mode : "fuzzing" ,
32+ mode : Mode . Fuzzing ,
3233 runs,
3334 seed,
3435 maxLen,
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ export const Mode = {
2323export type Mode = ( typeof Mode ) [ keyof typeof Mode ] ;
2424
2525export type LibAflOptions = {
26- mode : "fuzzing" | "regression" ;
26+ mode : Mode ;
2727 runs : number ;
2828 seed : number ;
2929 maxLen : number ;
You can’t perform that action at this time.
0 commit comments