processTests.py 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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="Pickle 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('-b', action='store_true', help="Benchmark mode to use different generated folders")
  15. parser.add_argument('others', nargs=argparse.REMAINDER)
  16. args = parser.parse_args()
  17. if args.f is not None:
  18. # Create a treeelemt object
  19. #p = parse.Parser()
  20. # Create a codegen object
  21. c = TestScripts.CodeGen.CodeGen(args.p,args.d, args.e)
  22. # Parse the test description.
  23. #root = p.parse(args.f)
  24. root=parse.loadRoot(args.f)
  25. d.deprecate(root,args.others)
  26. #print(root)
  27. # Generate code with the tree of tests
  28. c.genCodeForTree(root,args.b)
  29. else:
  30. parser.print_help()