summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Fitzgerald <fitzgen@gmail.com>2017-12-08 14:36:52 -0800
committerNick Fitzgerald <fitzgen@gmail.com>2017-12-08 14:36:52 -0800
commitd9950d4f1c23c4eb5c6e07cab855c2bd985a6ed3 (patch)
treedf4b6f90a6b5507d9891e883e1e44e2f6195b0ec
parentd4829d3bb33ffe411fcc67c273be7643017aae38 (diff)
predicate.py: Add an option to not delete temp files
Useful when debugging.
-rwxr-xr-xcsmith-fuzzing/predicate.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/csmith-fuzzing/predicate.py b/csmith-fuzzing/predicate.py
index 2f561148..3bf452ef 100755
--- a/csmith-fuzzing/predicate.py
+++ b/csmith-fuzzing/predicate.py
@@ -46,6 +46,11 @@ parser.add_argument(
help="An argument string that `bindgen` should be invoked with. By default, all traits are derived. Note that the input header and output bindings file will automatically be provided by this script, and you should not manually specify them.")
parser.add_argument(
+ "--save-temp-files",
+ action="store_true",
+ help="Do not delete temporary files.")
+
+parser.add_argument(
"input",
type=str,
default="input.h",
@@ -144,11 +149,12 @@ def main():
exit_code = 2
print("Unexpected exception:", e)
- for path in TEMP_FILES:
- try:
- os.remove(path)
- except Exception as e:
- print("Unexpected exception:", e)
+ if not args.save_temp_files:
+ for path in TEMP_FILES:
+ try:
+ os.remove(path)
+ except Exception as e:
+ print("Unexpected exception:", e)
sys.exit(exit_code)