Fix test case generation when no auxiliary support functions are required

This commit is contained in:
Chris Smowton
2021-06-21 19:43:14 +01:00
parent c49d5253f0
commit dff9c717bc
5 changed files with 18 additions and 14 deletions

View File

@@ -161,12 +161,17 @@ with open(resultJava, "w") as f:
scriptPath = os.path.dirname(sys.argv[0])
def copyfile(fromName, toFileHandle):
with open(os.path.join(scriptPath, fromName), "r") as fromFileHandle:
shutil.copyfileobj(fromFileHandle, toFileHandle)
with open(resultQl, "w") as f:
with open(os.path.join(scriptPath, "testHeader.qlfrag"), "r") as header:
shutil.copyfileobj(header, f)
f.write(", ".join('"%s"' % modelSpecRow[0].strip() for modelSpecRow in supportModelRows))
with open(os.path.join(scriptPath, "testFooter.qlfrag"), "r") as header:
shutil.copyfileobj(header, f)
copyfile("testHeader.qlfrag", f)
if len(supportModelRows) != 0:
copyfile("testModelsHeader.qlfrag", f)
f.write(", ".join('"%s"' % modelSpecRow[0].strip() for modelSpecRow in supportModelRows))
copyfile("testModelsFooter.qlfrag", f)
copyfile("testFooter.qlfrag", f)
# Make an empty .expected file, since this is an inline-exectations test
with open(os.path.join(sys.argv[3], "test.expected"), "w"):

View File

@@ -1,6 +1,3 @@
]
}
}
class ValueFlowConf extends DataFlow::Configuration {
ValueFlowConf() { this = "qltest:valueFlowConf" }

View File

@@ -3,9 +3,3 @@ import semmle.code.java.dataflow.DataFlow
import semmle.code.java.dataflow.ExternalFlow
import semmle.code.java.dataflow.TaintTracking
import TestUtilities.InlineExpectationsTest
class SummaryModelTest extends SummaryModelCsv {
override predicate row(string row) {
row =
[
//"package;type;overrides;name;signature;ext;inputspec;outputspec;kind",

View File

@@ -0,0 +1,3 @@
]
}
}

View File

@@ -0,0 +1,5 @@
class SummaryModelTest extends SummaryModelCsv {
override predicate row(string row) {
row =
[
//"package;type;overrides;name;signature;ext;inputspec;outputspec;kind",