comparison python/testzcc.py @ 250:f5fba5b554d7

Removal of obsolete editor
author Windel Bouwman
date Sun, 28 Jul 2013 19:07:51 +0200
parents 81752b0f85a5
children 56d37ed4b4d2
comparison
equal deleted inserted replaced
249:e41e4109addd 250:f5fba5b554d7
1 import unittest 1 import unittest
2 import glob 2 import glob
3 import zcc 3 import zcc
4 import outstream
5 import ppci
4 6
5 class ZccTestCase(unittest.TestCase): 7 class ZccTestCase(unittest.TestCase):
6 """ Tests the compiler driver """ 8 """ Tests the compiler driver """
7 9
8 def do(self, fn): 10 def do(self, fn):
15 """ Test all examples in the c3/examples directory """ 17 """ Test all examples in the c3/examples directory """
16 example_filenames = glob.glob('./stm32f4/*.c3') 18 example_filenames = glob.glob('./stm32f4/*.c3')
17 for filename in example_filenames: 19 for filename in example_filenames:
18 self.do(filename) 20 self.do(filename)
19 21
22 def testSectionAddress(self):
23 src = "package tst; function void t2() {var int t3; t3 = 2;}"
24 diag = ppci.DiagnosticsManager()
25 outs = outstream.TextOutputStream()
26 self.assertTrue(zcc.zcc(src, outs, diag))
27 code = outs.getSection('code')
28 self.assertEqual(0x08000000, code.address)
29 data = outs.getSection('data')
30 self.assertEqual(0x20000000, data.address)
31
32
20 if __name__ == '__main__': 33 if __name__ == '__main__':
21 unittest.main() 34 unittest.main()
22 35