diff options
author | Andrea Arteaga <andyspiros@gmail.com> | 2012-08-08 12:53:50 +0200 |
---|---|---|
committer | Andrea Arteaga <andyspiros@gmail.com> | 2012-08-08 12:53:50 +0200 |
commit | 9422e49b0e4cf7950d3e8bf75a9e28372b8f6a6e (patch) | |
tree | 52045956f548aff20e799f7895e27c1fb27f6014 | |
parent | Input parser, initializations, code cleanup. (diff) | |
download | auto-numerical-bench-9422e49b0e4cf7950d3e8bf75a9e28372b8f6a6e.tar.gz auto-numerical-bench-9422e49b0e4cf7950d3e8bf75a9e28372b8f6a6e.tar.bz2 auto-numerical-bench-9422e49b0e4cf7950d3e8bf75a9e28372b8f6a6e.zip |
Solved two important issues.
* In benchconfig curdir was not set up, blocking --directory.
* In case of void "operations" tag, xmlinput crashed.
-rw-r--r-- | numbench/benchconfig.py | 2 | ||||
-rw-r--r-- | numbench/xmlinput.py | 12 |
2 files changed, 11 insertions, 3 deletions
diff --git a/numbench/benchconfig.py b/numbench/benchconfig.py index dc6e9b4..56ef304 100644 --- a/numbench/benchconfig.py +++ b/numbench/benchconfig.py @@ -56,6 +56,8 @@ def parseArguments(): clean = False imageformat = 'svg' + # Directories have not yet been set up + curdir = os.path.abspath('.') skipargs = 0 for i, a in enumerate(sys.argv[1:], 1): diff --git a/numbench/xmlinput.py b/numbench/xmlinput.py index 62f8289..87d9824 100644 --- a/numbench/xmlinput.py +++ b/numbench/xmlinput.py @@ -15,7 +15,11 @@ class Parser: def getModuleArguments(self): opTag = self._dom.getElementsByTagName('operations')[0] - return shlex.split(opTag.firstChild.data) + try: + args = shlex.split(opTag.firstChild.data) + except AttributeError: + args = () + return args def getTestCases(self): testNodes = self._dom.getElementsByTagName('case') @@ -50,7 +54,8 @@ class Parser: # Requirements requires = {} for i in t.getElementsByTagName('required'): - requires[i.getAttribute('name').strip()] = i.firstChild.data.strip() + requires[i.getAttribute('name').strip()] = \ + i.firstChild.data.strip() # Environments dependenv = self._getEnvFromNode(t, 'dependenv') @@ -131,7 +136,8 @@ class Parser: # Check number of envs if len(envs) > 1: - errstr = "Error: no more than one " + envName + " element is allowed!" + errstr = "Error: no more than one " + envName + " element " \ + "is allowed!" raise Exception(errstr) elif len(envs) < 1: return {} |