summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Arteaga <andyspiros@gmail.com>2012-09-27 13:18:48 +0200
committerAndrea Arteaga <andyspiros@gmail.com>2012-09-27 13:18:48 +0200
commit9cab8166f1276536155f96fb66b8d362ab1d85aa (patch)
tree9c9b4373cd79f97ed4d5490c492cb561664c4540
parentSolve bug with void result. (diff)
downloadauto-numerical-bench-9cab8166f1276536155f96fb66b8d362ab1d85aa.tar.gz
auto-numerical-bench-9cab8166f1276536155f96fb66b8d362ab1d85aa.tar.bz2
auto-numerical-bench-9cab8166f1276536155f96fb66b8d362ab1d85aa.zip
Added initial support for copying the reports at the end (working for
local copy).
-rw-r--r--numbench/benchconfig.py8
-rw-r--r--numbench/main.py16
2 files changed, 18 insertions, 6 deletions
diff --git a/numbench/benchconfig.py b/numbench/benchconfig.py
index 56ef304..ffdedba 100644
--- a/numbench/benchconfig.py
+++ b/numbench/benchconfig.py
@@ -38,6 +38,7 @@ rootsdir = None
pkgsdir = None
reportdir = None
logdir = None
+copyreport = None
# Module
module = None
@@ -50,7 +51,7 @@ tests = None
def parseArguments():
- global arguments, inputfile, clean, imageformat, basedir
+ global arguments, inputfile, clean, imageformat, basedir, copyreport
arguments = []
clean = False
@@ -82,6 +83,11 @@ def parseArguments():
imageformat = sys.argv[i + 1]
skipargs += 1
continue
+
+ if a in ('-r', '--copy-report'):
+ copyreport = sys.argv[i + 1]
+ skipargs += 1
+ continue
arguments.append(a)
diff --git a/numbench/main.py b/numbench/main.py
index cfeece5..cd0d3d7 100644
--- a/numbench/main.py
+++ b/numbench/main.py
@@ -39,14 +39,16 @@ Usage: numbench conffile [options]
numbench [ -h | --help ]
Options:
- - h, - -help Displays an help message.
- - d, - -directory < dir > Stores the data in the given directory. If
+ -h, --help Displays an help message.
+ -d, --directory <dir> Store the data in the given directory. If
not given, a directory in ~/.numbench
is chosen.
- - c, - -clean Removes the temporary data at the end.
- - i, - -imageformat < format > Selects the given format for the resulting
+ -c, --clean Remove the temporary data at the end.
+ -i, --imageformat <format> Select the given format for the resulting
images. Available are png, svg, eps, ps,
pdf. Default is svg.
+ -r, --copy-report <URI> Transfer the report directory to the given
+ path. Local paths are currently supported.
"""
modnames = modules.getModulesNames()
@@ -71,7 +73,7 @@ if len(sys.argv) < 2 or sys.argv[1] in ('-h', '--help'):
## BEGIN THE TRUE SCRIPT
# Import the packages
-import re
+import re, shutil
from fnmatch import fnmatch
from os.path import join as pjoin
@@ -251,6 +253,10 @@ report.saveReport()
if cfg.clean:
bu.rmdir(cfg.testsdir)
bu.rmdir(cfg.rootsdir)
+
+# Copy results
+if cfg.copyreport:
+ shutil.copytree(cfg.reportdir, cfg.copyreport, True)
# TODO: reintroduce the instructions feature (and remove "exit)