|
16 | 16 | GenerateFlowTestCase.py specsToTest.csv projectPom.xml outdir [--force]
|
17 | 17 |
|
18 | 18 | This generates test cases exercising function model specifications found in specsToTest.csv
|
19 |
| -producing files Test.java, test.ql and test.expected in outdir. |
| 19 | +producing files Test.java, test.ql, test.ext.yml and test.expected in outdir. |
20 | 20 |
|
21 | 21 | projectPom.xml should be a Maven pom sufficient to resolve the classes named in specsToTest.csv.
|
22 | 22 | Typically this means supplying a skeleton POM <dependencies> section that retrieves whatever jars
|
|
54 | 54 |
|
55 | 55 | resultJava = os.path.join(sys.argv[3], "Test.java")
|
56 | 56 | resultQl = os.path.join(sys.argv[3], "test.ql")
|
57 |
| -resultYml = os.path.join(sys.argv[3], "test.model.yml") |
58 |
| -resultPack = os.path.join(sys.argv[3], "qlpack.yml") |
| 57 | +resultYml = os.path.join(sys.argv[3], "test.ext.yml") |
59 | 58 |
|
60 |
| -if not force and (os.path.exists(resultJava) or os.path.exists(resultQl) or os.path.exists(resultYml) or os.path.exists(resultPack)): |
61 |
| - print("Won't overwrite existing files '%s', '%s', '%s' or '%s'." % |
62 |
| - (resultJava, resultQl, resultYml, resultPack), file=sys.stderr) |
| 59 | +if not force and (os.path.exists(resultJava) or os.path.exists(resultQl) or os.path.exists(resultYml)): |
| 60 | + print("Won't overwrite existing files '%s', '%s' or '%s'." % |
| 61 | + (resultJava, resultQl, resultYml), file=sys.stderr) |
63 | 62 | sys.exit(1)
|
64 | 63 |
|
65 | 64 | workDir = tempfile.mkdtemp()
|
@@ -231,18 +230,6 @@ def copyfile(fromName, toFileHandle):
|
231 | 230 | {models}
|
232 | 231 | """
|
233 | 232 | f.write(dataextensions)
|
234 |
| - # Make a qlpack file such that the extension will be picked up |
235 |
| - with open(resultPack, "w") as f: |
236 |
| - f.write("""name: example-test-pack |
237 |
| -version: 0.0.0 |
238 |
| -extractor: java |
239 |
| -dependencies: |
240 |
| - codeql/java-all: '*' |
241 |
| - codeql/java-queries: '*' |
242 |
| - codeql/java-tests: '*' |
243 |
| -dataExtensions: |
244 |
| - - test.model.yml |
245 |
| -""") |
246 | 233 |
|
247 | 234 | # Make an empty .expected file, since this is an inline-exectations test
|
248 | 235 | with open(os.path.join(sys.argv[3], "test.expected"), "w"):
|
|
0 commit comments