From aee8196b32134ac0d648d3fe105fef519ca252ae Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 26 Mar 2013 12:06:19 +0000 Subject: [PATCH] example test for Abaqus now takes files from examples folder, both Abaqus test take now *.env from installation/mods_abaqus --- lib/damask/test/test.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/damask/test/test.py b/lib/damask/test/test.py index 409b96a76..f6bb9d97f 100644 --- a/lib/damask/test/test.py +++ b/lib/damask/test/test.py @@ -36,8 +36,7 @@ class Test(): ''' Run all variants and report first failure. ''' - if not self.testPossible(): - return -1 + if not self.testPossible(): return -1 if len(update) == 0 and self.options.update: print ' This test has no reference to update' if len(variants) == 0: variants = xrange(len(self.variants)) # iterate over all variants self.clean() @@ -162,6 +161,17 @@ class Test(): except: print 'Reference2Current: Unable to copy file ', file + def copy_Base2Current(self,sourceDir,sourcefiles=[],targetfiles=[]): + + source=os.path.normpath(os.path.join(self.dirBase,'../../'+sourceDir)) + if len(targetfiles) == 0: targetfiles = sourcefiles + for i,file in enumerate(sourcefiles): + try: + shutil.copy2(os.path.join(source,file),self.fileInCurrent(targetfiles[i])) + except: + print os.path.join(source,file) + print 'Base2Current: Unable to copy file ', file + def copy_Current2Reference(self,sourcefiles=[],targetfiles=[]): if len(targetfiles) == 0: targetfiles = sourcefiles