Skip to content

Commit 892e2ec

Browse files
committed
fuzzing: Add a --release flag to the predicate script.
When you're not testing for debug assertions this is much faster.
1 parent 86eff21 commit 892e2ec

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

Cargo.lock

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

csmith-fuzzing/predicate.py

+11-7
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@
6565

6666
reducing = parser.add_argument_group("reducing arguments", REDUCING_DESC.strip())
6767

68+
reducing.add_argument(
69+
"--release",
70+
action="store_true",
71+
help="Use a release instead of a debug build.")
6872
reducing.add_argument(
6973
"--expect-bindgen-fail",
7074
action="store_true",
@@ -194,13 +198,13 @@ def run_bindgen(args, bindings):
194198
manifest_path = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]),
195199
"..",
196200
"Cargo.toml"))
197-
child = run(
198-
["cargo", "run",
199-
"--manifest-path", manifest_path,
200-
"--",
201-
args.input, "-o", bindings] + shlex.split(args.bindgen_args),
202-
stderr=subprocess.PIPE,
203-
stdout=subprocess.PIPE)
201+
command = ["cargo", "run", "--manifest-path", manifest_path]
202+
if args.release:
203+
command += ["--release"]
204+
command += ["--", args.input, "-o", bindings]
205+
command += shlex.split(args.bindgen_args)
206+
207+
child = run(command, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
204208

205209
if args.bindgen_grep:
206210
pattern = regexp(args.bindgen_grep)

0 commit comments

Comments
 (0)