Add flow-through test case generator

This commit is contained in:
Chris Smowton
2021-06-03 16:06:21 +01:00
parent 6fee40cfde
commit 6360e0b7c4
3 changed files with 16 additions and 8 deletions

View File

@@ -31,7 +31,7 @@ if os.path.exists(resultJava) or os.path.exists(resultQl):
workDir = tempfile.mkdtemp()
# Step 1: make a database that touches all types whose methods we want to test:
# Make a database that touches all types whose methods we want to test:
print("Creating Maven project")
projectDir = os.path.join(workDir, "mavenProject")
os.makedirs(projectDir)
@@ -138,6 +138,10 @@ with open(resultQl, "w") as f:
with open(os.path.join(scriptPath, "testFooter.qlfrag"), "r") as header:
shutil.copyfileobj(header, f)
# Make an empty .expected file, since this is an inline-exectations test
with open(os.path.join(sys.argv[3], "test.expected")):
pass
cmd = ['codeql', 'query', 'format', '-qq', '-i', resultQl]
subprocess.call(cmd)