From 4c59015a787105dee95df9ece1f2927ad1cf6333 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 15 Feb 2012 20:54:14 +0000 Subject: [PATCH] further simplified creation of tests by moving the option parsing to the general test class --- lib/damask/test/test.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/damask/test/test.py b/lib/damask/test/test.py index fe0f80e58..d5f6313ef 100644 --- a/lib/damask/test/test.py +++ b/lib/damask/test/test.py @@ -2,8 +2,9 @@ # $Id$ import os, sys -import subprocess,shutil +import subprocess,shutil,string import damask +from optparse import OptionParser class Test(): ''' @@ -13,9 +14,20 @@ class Test(): variants = [] - def __init__(self): + def __init__(self,test_description): + print '\n'+test_description self.dirBase = os.path.dirname(os.path.realpath(sys.argv[0])) + self.parser = OptionParser( + description = 'Using: $Id run_test.py 1285 2012-02-09 08:54:09Z MPIE\m.diehl $', + usage='run_test.py [options]') + self.parser.add_option("-u", "--update", action="store_true",\ + dest="update",\ + help="use current test results as new reference") + self.parser.set_defaults(update = False) + + (self.options, self.args) = self.parser.parse_args() + def execute(self,variants = [],update = []): '''