Skip to content

Commit b1af909

Browse files
committed
Add help text to GenerateFlowTestCase.py
1 parent 5f1a491 commit b1af909

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

java/ql/src/utils/GenerateFlowTestCase.py

100644100755
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/python3
2+
13
import errno
24
import json
35
import os
@@ -9,6 +11,24 @@
911
import sys
1012
import tempfile
1113

14+
if any(s == "--help" for s in sys.argv):
15+
print("""Usage:
16+
GenerateFlowTestCase.py specsToTest.ssv projectPom.xml outdir
17+
18+
This generates test cases exercising taint flow specifications found in specsToTest.ssv
19+
producing files Test.java, test.ql and test.expected in outdir.
20+
21+
projectPom.xml should be a Maven pom sufficient to resolve the classes named in specsToTest.ssv.
22+
Typically this means supplying a skeleton POM <dependencies> section that retrieves whatever jars
23+
contain the needed classes.
24+
25+
Requirements: `mvn` and `codeql` should both appear on your path.
26+
27+
After test generation completes, any lines in specsToTest.ssv that didn't produce tests are output.
28+
If this happens, check the spelling of class and method names, and the syntax of input and output specifications.
29+
""")
30+
sys.exit(0)
31+
1232
if len(sys.argv) != 4:
1333
print("Usage: GenerateFlowTestCase.py specsToTest.ssv projectPom.xml outdir", file=sys.stderr)
1434
print("specsToTest.ssv should contain SSV rows describing method taint-propagation specifications to test", file=sys.stderr)

0 commit comments

Comments
 (0)