Create parent directories for output file of runexec if necessary
This is relevant if --output is used to specify a nonexistent directory.
benchexec already did create such directories, so lets do the same for
runexec.
@@ -550,6 +550,9 @@ class RunExecutor(containerexecutor.ContainerExecutor):
# write command line into outputFile
# (without environment variables, they are documented by benchexec)
try:
+ parent_dir = os.path.dirname(output_filename)
+ if parent_dir:
+ util.makedirs(parent_dir, exist_ok=True)
output_file = open(output_filename, "w") # override existing file
except IOError as e:
sys.exit(e)
