Skip to content

Commit 2fbb875

Browse files
committed
[incrParse] Minor improvements to the test utility
1 parent 2c02b1e commit 2fbb875

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

utils/incrparse_test_util.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ def main():
158158
test_case = args.test_case
159159
print_visual_reuse_info = args.print_visual_reuse_info
160160

161+
if not os.path.exists(temp_dir):
162+
os.makedirs(temp_dir)
163+
161164
# Generate pre-edit and post-edit files
162165
pre_edit_file = open(temp_dir + '/' + test_file_name + '.' + test_case +
163166
'.pre.swift', mode='w+')
@@ -261,7 +264,8 @@ def main():
261264
serialized_incr_filename
262265
])
263266
except subprocess.CalledProcessError as e:
264-
print('Test case %s failed' % (test_case), file=sys.stderr)
267+
print('Test case "%s" of %s failed' % (test_case, test_file.name),
268+
file=sys.stderr)
265269
print('Syntax tree of incremental parsing does not match '
266270
'from-scratch parsing of post-edit file:\n\n', file=sys.stderr)
267271
print(e.output, file=sys.stderr)

0 commit comments

Comments
 (0)