Mercurial > lcfOS
diff python/testc3.py @ 272:e64bae57cda8
refactor ir
author | Windel Bouwman |
---|---|
date | Sat, 31 Aug 2013 17:58:54 +0200 |
parents | 5ec7580976d9 |
children | 02385f62f250 |
line wrap: on
line diff
--- a/python/testc3.py Tue Aug 20 18:56:02 2013 +0200 +++ b/python/testc3.py Sat Aug 31 17:58:54 2013 +0200 @@ -105,23 +105,13 @@ self.assertSequenceEqual(rows, actualErrors) self.assertFalse(ircode) - def expectOK(self, snippet): - ircode = self.builder.build(snippet) + def expectOK(self, snippet, pack_dir=None): + ircode = self.builder.build(snippet, pack_dir=pack_dir) if not ircode: self.diag.printErrors(snippet) self.assertTrue(ircode) return ircode - def expectIR(self, snippet, ir_out): - ircode = self.builder.build(snippet) - if not ircode: - self.diag.printErrors(snippet) - self.assertTrue(ircode) - actual_ins = [str(i) for i in ircode.Instructions] - expected_ins = [i.strip() for i in ir_out.split('\n')] - self.assertSequenceEqual(expected_ins, actual_ins) - return ircode - def testPackage(self): p1 = """package p1; type int A; @@ -408,7 +398,7 @@ for filename in example_filenames: with open(filename, 'r') as f: src = f.read() - self.expectOK(src) + self.expectOK(src, pack_dir='./c3/examples') def test2(self): # testsrc2 is valid code: