some smaller improvements on the intel compilation test

This commit is contained in:
Martin Diehl 2012-05-25 15:11:00 +00:00
parent be355c8f40
commit 34777e3df8
1 changed files with 10 additions and 15 deletions

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python #!/usr/bin/env python
# $Id$ # $Id$
import os, sys import os, sys, shlex
import subprocess,shutil,string import subprocess,shutil,string
import damask import damask
from optparse import OptionParser from optparse import OptionParser
@ -29,7 +29,7 @@ class Test():
(self.options, self.args) = self.parser.parse_args() (self.options, self.args) = self.parser.parse_args()
def execute(self,variants = [],update = []): def execute(self,variants = [],update = []):
''' '''
Run all variants and report first failure. Run all variants and report first failure.
''' '''
@ -44,19 +44,10 @@ class Test():
self.update(variant) self.update(variant)
elif not self.compare(variant): elif not self.compare(variant):
return variant return variant
except: except Exception,e :
print '\nWARNING:\n %s\n'%e
return variant return variant
return -1 return -1
# for self.current_variant_index,variant in enumerate(variants):
# self.prepare(variant)
# self.run(variant)
# self.postprocess(variant)
# if self.current_variant_index in update:
# self.update(variant)
# elif not self.compare(variant):
# return variant
# return -1
def clean(self): def clean(self):
''' '''
@ -148,10 +139,14 @@ class Test():
except: except:
print 'Current2Current: Unable to copy file ', file print 'Current2Current: Unable to copy file ', file
def execute_inCurrentDir(self,cmd): def execute_inCurrentDir(self,cmd,outfile='execute_log.txt'):
os.chdir(self.dirCurrent()) os.chdir(self.dirCurrent())
file=open(outfile,'a+')
print cmd print cmd
os.system(cmd) process = subprocess.Popen(shlex.split(cmd),stdout = file,stderr = subprocess.STDOUT)
file.close()
process.wait()
def compare_Array(self,ref,cur): def compare_Array(self,ref,cur):
import numpy import numpy