]> begriffs open source - cmsis/blob - CMSIS/CoreValidation/Tests/buildutils/uv4cmd.py
CoreValidation: Test projects.
[cmsis] / CMSIS / CoreValidation / Tests / buildutils / uv4cmd.py
1 #! python
2
3 from buildcmd import BuildCmd
4 from string import maketrans
5 from datetime import datetime
6 import mmap
7
8 class Uv4Cmd(BuildCmd):
9
10   def __init__(self, project, config):
11     BuildCmd.__init__(self)
12     self._project = project
13     self._config = config
14     self._log = "UV4_{0}_{1}.log".format(self._config.translate(maketrans(" ", "_"), "()[],"), datetime.now().strftime("%Y%m%d%H%M%S"))
15     
16   def getCommand(self):
17     return "UV4.exe"
18     
19   def getArguments(self):
20     return [ "-t", self._config, "-cr", self._project, "-j0", "-o", self._log ]
21   
22   def isSuccess(self):
23     return self._result <= 1
24
25   def getLog(self):
26     try:
27       return open(self._log, "r")
28     except:
29       return None