mirror of
https://github.com/github/codeql.git
synced 2025-12-20 18:56:32 +01:00
Fix test case generation when no auxiliary support functions are required
This commit is contained in:
@@ -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"):
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
class ValueFlowConf extends DataFlow::Configuration {
|
||||
ValueFlowConf() { this = "qltest:valueFlowConf" }
|
||||
|
||||
@@ -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",
|
||||
|
||||
3
java/ql/src/utils/testModelsFooter.qlfrag
Normal file
3
java/ql/src/utils/testModelsFooter.qlfrag
Normal file
@@ -0,0 +1,3 @@
|
||||
]
|
||||
}
|
||||
}
|
||||
5
java/ql/src/utils/testModelsHeader.qlfrag
Normal file
5
java/ql/src/utils/testModelsHeader.qlfrag
Normal file
@@ -0,0 +1,5 @@
|
||||
class SummaryModelTest extends SummaryModelCsv {
|
||||
override predicate row(string row) {
|
||||
row =
|
||||
[
|
||||
//"package;type;overrides;name;signature;ext;inputspec;outputspec;kind",
|
||||
Reference in New Issue
Block a user