processTests.py 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import argparse
  2. import TestScripts.NewParser as parse
  3. import TestScripts.CodeGen
  4. import TestScripts.Deprecate as d
  5. parser = argparse.ArgumentParser(description='Parse test description')
  6. parser.add_argument('-f', nargs='?',type = str, default="Output.pickle", help="File path")
  7. parser.add_argument('-p', nargs='?',type = str, default="Patterns", help="Pattern dir path")
  8. parser.add_argument('-d', nargs='?',type = str, default="Parameters", help="Parameter dir path")
  9. # -e true when no semihosting
  10. # Input is include files
  11. # Output is only one stdout
  12. # So the .h for include files need to be generated.
  13. parser.add_argument('-e', action='store_true', help="Embedded test")
  14. parser.add_argument('others', nargs=argparse.REMAINDER)
  15. args = parser.parse_args()
  16. if args.f is not None:
  17. # Create a treeelemt object
  18. #p = parse.Parser()
  19. # Create a codegen object
  20. c = TestScripts.CodeGen.CodeGen(args.p,args.d, args.e)
  21. # Parse the test description.
  22. #root = p.parse(args.f)
  23. root=parse.loadRoot(args.f)
  24. d.deprecate(root,args.others)
  25. #print(root)
  26. # Generate code with the tree of tests
  27. c.genCodeForTree(root)
  28. else:
  29. parser.print_help()