예제 #1
0
파일: tests.py 프로젝트: tovrstra/cpqa
 def log_html(self, f):
     if self.different is True:
         print >> f, '<table>'
         print >> f, '<tr><th>tst</th><td>% .15e</td></tr>' % self.tst.value
         if self.ref.value == 0.0:
             print >> f, '<tr><th>ref</th><td>% .15e</td>' % self.ref.value
             print >> f, '<th>abs err</th><td>% .15e</td></tr>' % self.ref_error
         else:
             print >> f, '<tr><th>ref</th><td>% .15e</td>' % self.ref.value
             print >> f, '<th>abs err</th><td>% .15e</td>' % self.ref_error
             print >> f, '<th>rel err</th><td>% .15e</td></tr>' % (self.ref_error/abs(self.ref.value))
         print >> f, '</table>'
         diff_html(f, self.ref.lines, self.tst.lines, 'ref', 'tst')
     if self.wrong is True:
         print >> f, '<table>'
         print >> f, '<tr><th>tst</th><td>% .15e</td></tr>' % self.tst.value
         if self.exp_value == 0.0:
             print >> f, '<tr><th>exp</th><td>% .15e</td>' % self.exp_value
             print >> f, '<th>abs err</th><td>% .15e</td></tr>' % self.exp_error
         else:
             print >> f, '<tr><th>exp</th><td>% .15e</td>' % self.exp_value
             print >> f, '<th>abs err</th><td>% .15e</td>' % self.exp_error
             print >> f, '<th>rel err</th><td>% .15e</td></tr>' % (self.exp_error/abs(self.exp_value))
         print >> f, '</table>'
예제 #2
0
파일: tests.py 프로젝트: tovrstra/cpqa
 def log_html(self, f):
     ScalarTest.log_html(self, f)
     if self.wrong is True:
         diff_html(f, self.exp.lines, self.tst.lines, 'exp', 'tst')