mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Add help text to GenerateFlowTestCase.py
This commit is contained in:
20
java/ql/src/utils/GenerateFlowTestCase.py
Normal file → Executable file
20
java/ql/src/utils/GenerateFlowTestCase.py
Normal file → Executable file
@@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/python3
|
||||||
|
|
||||||
import errno
|
import errno
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
@@ -9,6 +11,24 @@ import subprocess
|
|||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
|
if any(s == "--help" for s in sys.argv):
|
||||||
|
print("""Usage:
|
||||||
|
GenerateFlowTestCase.py specsToTest.ssv projectPom.xml outdir
|
||||||
|
|
||||||
|
This generates test cases exercising taint flow specifications found in specsToTest.ssv
|
||||||
|
producing files Test.java, test.ql and test.expected in outdir.
|
||||||
|
|
||||||
|
projectPom.xml should be a Maven pom sufficient to resolve the classes named in specsToTest.ssv.
|
||||||
|
Typically this means supplying a skeleton POM <dependencies> section that retrieves whatever jars
|
||||||
|
contain the needed classes.
|
||||||
|
|
||||||
|
Requirements: `mvn` and `codeql` should both appear on your path.
|
||||||
|
|
||||||
|
After test generation completes, any lines in specsToTest.ssv that didn't produce tests are output.
|
||||||
|
If this happens, check the spelling of class and method names, and the syntax of input and output specifications.
|
||||||
|
""")
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
if len(sys.argv) != 4:
|
if len(sys.argv) != 4:
|
||||||
print("Usage: GenerateFlowTestCase.py specsToTest.ssv projectPom.xml outdir", file=sys.stderr)
|
print("Usage: GenerateFlowTestCase.py specsToTest.ssv projectPom.xml outdir", file=sys.stderr)
|
||||||
print("specsToTest.ssv should contain SSV rows describing method taint-propagation specifications to test", file=sys.stderr)
|
print("specsToTest.ssv should contain SSV rows describing method taint-propagation specifications to test", file=sys.stderr)
|
||||||
|
|||||||
Reference in New Issue
Block a user