Christophe Favergeon | 6f8eee9 | 2019-10-09 12:21:27 +0100 | [diff] [blame^] | 1 | import argparse
|
| 2 | import TestScripts.NewParser as parse
|
| 3 | import pickle
|
| 4 |
|
| 5 | parser = argparse.ArgumentParser(description='Parse test description')
|
| 6 |
|
| 7 | parser.add_argument('-f', nargs='?',type = str, default=None, help="Test description file path")
|
| 8 |
|
| 9 | parser.add_argument('-o', nargs='?',type = str, default="Output.pickle", help="output file for parsed description")
|
| 10 |
|
| 11 | args = parser.parse_args()
|
| 12 |
|
| 13 | if args.f is not None:
|
| 14 | p = parse.Parser()
|
| 15 | # Parse the test description file
|
| 16 | root = p.parse(args.f)
|
| 17 | with open(args.o,"wb") as output:
|
| 18 | pickle.dump(root, output)
|