summaryrefslogtreecommitdiff
path: root/csmith-fuzzing/predicate.py
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2019-02-03 14:33:16 +0100
committerEmilio Cobos Álvarez <emilio@crisal.io>2019-02-03 14:39:15 +0100
commit892e2ec117f817d5a439dfb39104b2be4678cd0b (patch)
tree460eaf90396731abadf2bd03cc184daef063e231 /csmith-fuzzing/predicate.py
parent86eff214bf29dc1545bfa7fd44ab2df20048e62b (diff)
fuzzing: Add a --release flag to the predicate script.
When you're not testing for debug assertions this is much faster.
Diffstat (limited to 'csmith-fuzzing/predicate.py')
-rwxr-xr-xcsmith-fuzzing/predicate.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/csmith-fuzzing/predicate.py b/csmith-fuzzing/predicate.py
index 4909b4f6..043a9935 100755
--- a/csmith-fuzzing/predicate.py
+++ b/csmith-fuzzing/predicate.py
@@ -66,6 +66,10 @@ equivalent-but-smaller test cases that exhibit the same bug with `creduce`.
reducing = parser.add_argument_group("reducing arguments", REDUCING_DESC.strip())
reducing.add_argument(
+ "--release",
+ action="store_true",
+ help="Use a release instead of a debug build.")
+reducing.add_argument(
"--expect-bindgen-fail",
action="store_true",
help="Exit non-zero if `bindgen` successfully emits bindings.")
@@ -194,13 +198,13 @@ def run_bindgen(args, bindings):
manifest_path = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]),
"..",
"Cargo.toml"))
- child = run(
- ["cargo", "run",
- "--manifest-path", manifest_path,
- "--",
- args.input, "-o", bindings] + shlex.split(args.bindgen_args),
- stderr=subprocess.PIPE,
- stdout=subprocess.PIPE)
+ command = ["cargo", "run", "--manifest-path", manifest_path]
+ if args.release:
+ command += ["--release"]
+ command += ["--", args.input, "-o", bindings]
+ command += shlex.split(args.bindgen_args)
+
+ child = run(command, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
if args.bindgen_grep:
pattern = regexp(args.bindgen_grep)