Skip to content

Add an option to extend the compiled code after each reducing step #1327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 3, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions csmith-fuzzing/predicate.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@
action="store_false",
dest="rustc",
help="Do not attempt to compile the emitted bindings with `rustc`.")
reducing.add_argument(
"--extra-compile-file",
type=str,
help="")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe worth writing a comment here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, I'd forgotten about that.

reducing.add_argument(
"--expect-compile-fail",
action="store_true",
Expand Down Expand Up @@ -221,6 +225,10 @@ def run_bindgen(args, bindings):
raise ExitOne()

def run_rustc(args, bindings, test_exe):
if args.extra_compile_file:
with open(bindings, mode="a") as outfile:
with open(args.extra_compile_file, mode="r") as infile:
outfile.write(infile.read())
child = run(
["rustc", "--crate-type", "lib", "--test", "-o", test_exe, bindings],
stdout=subprocess.PIPE,
Expand Down