Mercurial > lcfOS
diff python/testc3.py @ 220:3f6c30a5d234
Major change in expression parsing to enable pointers and structs
author | Windel Bouwman |
---|---|
date | Sat, 06 Jul 2013 21:32:20 +0200 |
parents | 8b2e5f3cd579 |
children | 848c4b15fd0b |
line wrap: on
line diff
--- a/python/testc3.py Sat Jul 06 12:38:09 2013 +0200 +++ b/python/testc3.py Sat Jul 06 21:32:20 2013 +0200 @@ -1,6 +1,7 @@ import c3 import time, ppci, x86, ir import unittest +import glob testsrc = """package test; @@ -205,13 +206,14 @@ """ self.expectOK(snippet) - @unittest.skip def testPointerType(self): snippet = """ package testpointer; var int* pa; function void t(int a, double b) { + pa = 2; + pa = &a; *pa = 22; } """ @@ -248,6 +250,14 @@ """ self.expectOK(snippet) + def testExamples(self): + """ Test all examples in the c3/examples directory """ + example_filenames = glob.glob('./c3/examples/*.c3') + for filename in example_filenames: + with open(filename, 'r') as f: + src = f.read() + self.expectOK(src) + def test2(self): # testsrc2 is valid code: snippet = """