|
13 | 13 |
|
14 | 14 | if any(s == "--help" for s in sys.argv):
|
15 | 15 | print("""Usage:
|
16 |
| -GenerateFlowTestCase.py specsToTest.csv projectPom.xml outdir [--force] |
| 16 | +GenerateFlowTestCase.py specsToTest projectPom.xml outdir [--force] |
17 | 17 |
|
18 |
| -This generates test cases exercising function model specifications found in specsToTest.csv |
| 18 | +This generates test cases exercising function model specifications found in specsToTest |
19 | 19 | producing files Test.java, test.ql, test.ext.yml and test.expected in outdir.
|
20 | 20 |
|
| 21 | +specsToTest should either be a .csv file, a .yml file, or a directory of .yml files, containing the |
| 22 | +model specifications to test. |
| 23 | +
|
21 | 24 | projectPom.xml should be a Maven pom sufficient to resolve the classes named in specsToTest.csv.
|
22 | 25 | Typically this means supplying a skeleton POM <dependencies> section that retrieves whatever jars
|
23 | 26 | contain the needed classes.
|
|
40 | 43 |
|
41 | 44 | if len(sys.argv) != 4:
|
42 | 45 | print(
|
43 |
| - "Usage: GenerateFlowTestCase.py specsToTest.csv projectPom.xml outdir [--force]", file=sys.stderr) |
44 |
| - print("specsToTest.csv should contain CSV rows describing method taint-propagation specifications to test", file=sys.stderr) |
45 |
| - print("projectPom.xml should import dependencies sufficient to resolve the types used in specsToTest.csv", file=sys.stderr) |
| 46 | + "Usage: GenerateFlowTestCase.py specsToTest projectPom.xml outdir [--force]", file=sys.stderr) |
| 47 | + print("specsToTest should contain CSV rows or YAML models describing method taint-propagation specifications to test", file=sys.stderr) |
| 48 | + print("projectPom.xml should import dependencies sufficient to resolve the types used in specsToTest", file=sys.stderr) |
| 49 | + print("\nRun with --help for more details.", file=sys.stderr) |
46 | 50 | sys.exit(1)
|
47 | 51 |
|
48 | 52 | try:
|
@@ -85,7 +89,7 @@ def isComment(s):
|
85 | 89 | def readCsv(file):
|
86 | 90 | try:
|
87 | 91 | with open(file, "r") as f:
|
88 |
| - specs = [l for l in f if not isComment(l)] |
| 92 | + specs = [l.strip() for l in f if not isComment(l)] |
89 | 93 | except Exception as e:
|
90 | 94 | print("Failed to open %s: %s\n" % (file, e))
|
91 | 95 | sys.exit(1)
|
|
0 commit comments