]> begriffs open source - cmsis/blob - CMSIS/CoreValidation/Tests/lint.py
CoreValidation: Added basic lint configuration for validation tests.
[cmsis] / CMSIS / CoreValidation / Tests / lint.py
1 import sys
2 import os.path
3 from argparse import ArgumentParser
4
5 sys.path.append('buildutils') 
6
7 from rtecmd import RteCmd 
8
9 def main(argv):
10   parser = ArgumentParser()
11   parser.add_argument('-d', '--device', required=True, help = 'Device to be considered.')
12   parser.add_argument('-c', '--compiler', required=True, help = 'Compiler to be considered.')
13   parser.add_argument('-t', '--target', nargs='?', default="default", help = 'Target to be considered.')
14   args = parser.parse_args()
15   
16   rtebuild = os.path.join(args.device, args.compiler, "default.rtebuild")
17   
18   if not os.path.isfile(rtebuild):
19     raise IOError("rtebuild project not available:'"+rtebuild+"'")
20     
21   cmd = RteCmd(rtebuild, args.target, "lint")
22   cmd.run()
23   
24 if __name__ == "__main__":
25   try:
26     main(sys.argv[1:])
27   except Exception as e:
28     print(e)