summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Arteaga <andyspiros@gmail.com>2012-03-30 09:53:21 +0200
committerAndrea Arteaga <andyspiros@gmail.com>2012-03-30 09:53:21 +0200
commit1c12401d70b92dcbbe034c8b0c81ab276525e728 (patch)
tree7ea1b2b3ab0eebec622981f6578f711e88dae195
parentRewritten man page. (diff)
downloadauto-numerical-bench-1c12401d70b92dcbbe034c8b0c81ab276525e728.tar.gz
auto-numerical-bench-1c12401d70b92dcbbe034c8b0c81ab276525e728.tar.bz2
auto-numerical-bench-1c12401d70b92dcbbe034c8b0c81ab276525e728.zip
Added exception handling for starting BTL. Solved portage exception handling.
-rw-r--r--numbench/utils/btl.py12
-rw-r--r--numbench/utils/portageutils.py2
2 files changed, 10 insertions, 4 deletions
diff --git a/numbench/utils/btl.py b/numbench/utils/btl.py
index d464d38..c081ef4 100644
--- a/numbench/utils/btl.py
+++ b/numbench/utils/btl.py
@@ -187,9 +187,15 @@ def runTest(test, btlconfig):
logfs.flush()
# Open pipe
- proc = sp.Popen(args, bufsize=1, stdout=sp.PIPE, stderr=sp.PIPE, \
- env=runenv, cwd=btlconfig['testdir'])
- benchchildren.append(proc)
+ try:
+ proc = sp.Popen(args, bufsize=1, stdout=sp.PIPE, stderr=sp.PIPE, \
+ env=runenv, cwd=btlconfig['testdir'])
+ benchchildren.append(proc)
+ except OSError:
+ Print('Execution failed to start')
+ Print('Command line: ' + ' '.join(args))
+ return -1, None
+
result = {}
diff --git a/numbench/utils/portageutils.py b/numbench/utils/portageutils.py
index f58bb2b..6fa864a 100644
--- a/numbench/utils/portageutils.py
+++ b/numbench/utils/portageutils.py
@@ -158,7 +158,7 @@ def installPackage(test, package=None, env=None, logfile=None):
if p.returncode != 0:
# In case of error, print the whole emerge command
- raise InstallException(p, ' '.join(cmd), logfile)
+ raise InstallException(pkg, ' '.join(cmd), logfile)
fout.write('\n\n' + 80*'#' + '\n\n')