/[ascend]/branches/relerrorlist/test.py
ViewVC logotype

Diff of /branches/relerrorlist/test.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3213 by jpye, Sun Sep 17 05:20:45 2017 UTC revision 3214 by jpye, Sun Sep 17 12:36:16 2017 UTC
# Line 1574  class TestErrorTree(AscendSelfTester): Line 1574  class TestErrorTree(AscendSelfTester):
1574          super(TestErrorTree,self).setUp();          super(TestErrorTree,self).setUp();
1575          self.reporter = ascpy.getReporter()          self.reporter = ascpy.getReporter()
1576          self.reporter.setPythonErrorCallback(self.error_callback)          self.reporter.setPythonErrorCallback(self.error_callback)
1577    
1578            self.errors = []
1579            
1580      def tearDown(self):      def tearDown(self):
1581          super(TestErrorTree,self).tearDown();          super(TestErrorTree,self).tearDown();
# Line 1583  class TestErrorTree(AscendSelfTester): Line 1585  class TestErrorTree(AscendSelfTester):
1585    
1586      def error_callback(self,sev,filename,line,msg):      def error_callback(self,sev,filename,line,msg):
1587          print "PYTHON ERROR CALLBACK: %s:%d: %s [sev=%d]" % (filename,line,msg,sev)          print "PYTHON ERROR CALLBACK: %s:%d: %s [sev=%d]" % (filename,line,msg,sev)
1588            self.errors.append((filename,line,msg,sev))
1589          return 0          return 0
1590    
1591      def test1(self):      def test1(self):
1592          self.L.load('test/compiler/stop.a4c')          self.L.load('test/compiler/badassign.a4c')
1593          T = self.L.findType('stop')          T = self.L.findType('badassign')
1594          M = T.getSimulation('sim',True)          try:
1595                M = T.getSimulation('sim',True)
1596            except RuntimeError,e:
1597                print self.errors
1598    
1599  # move code above down here if you want to temporarily avoid testing it  # move code above down here if you want to temporarily avoid testing it
1600  class NotToBeTested:  class NotToBeTested:

Legend:
Removed from v.3213  
changed lines
  Added in v.3214

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22