Skip to content
Snippets Groups Projects
Commit 54fcbf7a authored by jugglinmike's avatar jugglinmike Committed by Leo Balter
Browse files

[generation] Support changing to existing files (#583)

When inspecting previously-generated files, a new `Test` instance should
be used. This avoids over-writing the in-memory representation of the
latest test, and allows previously-existing test files to be partially
updated according to subsequent changes in their respective source/case
files.
parent bc0a40c5
No related branches found
No related tags found
No related merge requests found
......@@ -43,14 +43,15 @@ def create(args):
for test in exp.expand('utf-8', caseFile):
if args.out:
try:
test.load(args.out)
existing = Test(test.file_name)
existing.load(args.out)
if args.no_clobber:
print_error(
'Refusing to overwrite file: ' + test.file_name)
exit(1)
if not test.is_generated():
if not existing.is_generated():
print_error(
'Refusing to overwrite non-generated file: ' +
test.file_name)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment