aboutsummaryrefslogtreecommitdiff
path: root/src/boot/driver
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2010-09-16 00:26:19 -0700
committerGraydon Hoare <[email protected]>2010-09-16 00:26:19 -0700
commit91b4a0c9f8ba7be56fc098ffc6182a888e3970bf (patch)
tree4e56c4dc3626d03026dd32c2079d9afad8140832 /src/boot/driver
parentAdd Peter Hull's contributed translation of the fasta shootout benchmark (int... (diff)
downloadrust-91b4a0c9f8ba7be56fc098ffc6182a888e3970bf.tar.xz
rust-91b4a0c9f8ba7be56fc098ffc6182a888e3970bf.zip
Add beginnings of a fuzzer to rustboot.
Diffstat (limited to 'src/boot/driver')
-rw-r--r--src/boot/driver/main.ml10
-rw-r--r--src/boot/driver/session.ml1
2 files changed, 11 insertions, 0 deletions
diff --git a/src/boot/driver/main.ml b/src/boot/driver/main.ml
index 8f686522..32c70be6 100644
--- a/src/boot/driver/main.ml
+++ b/src/boot/driver/main.ml
@@ -60,6 +60,7 @@ let (sess:Session.sess) =
Session.sess_report_gc = false;
Session.sess_report_deps = false;
Session.sess_next_crate_id = 0;
+ Session.sess_fuzz_item_count = 5;
Session.sess_timings = Hashtbl.create 0;
Session.sess_lib_dirs = Queue.create ();
Session.sess_crate_meta = Hashtbl.create 0;
@@ -219,6 +220,15 @@ let argspecs =
(flag (fun _ -> sess.Session.sess_use_pexps <- true)
"-pexp" "use pexp portion of AST");
+ ("-zc", Arg.Int (fun i -> sess.Session.sess_fuzz_item_count <- i),
+ "count of items to generate when fuzzing");
+
+ ("-zs", Arg.Int (fun i -> Fuzz.fuzz (Some i) sess),
+ "run fuzzer with given seed");
+
+ (flag (fun _ -> Fuzz.fuzz None sess)
+ "-z" "run fuzzer with random seed")
+
] @ (Glue.alt_argspecs sess)
;;
diff --git a/src/boot/driver/session.ml b/src/boot/driver/session.ml
index f8e79fe2..beb551bb 100644
--- a/src/boot/driver/session.ml
+++ b/src/boot/driver/session.ml
@@ -45,6 +45,7 @@ type sess =
mutable sess_report_gc: bool;
mutable sess_report_deps: bool;
mutable sess_next_crate_id: int;
+ mutable sess_fuzz_item_count: int;
sess_timings: (string, float) Hashtbl.t;
sess_spans: (node_id,span) Hashtbl.t;
sess_lib_dirs: filename Queue.t;