Mercurial > lcfOS
diff test/testzcc.py @ 338:8eb4a6fe8fc8
Added testcase with emulator
author | Windel Bouwman |
---|---|
date | Fri, 21 Feb 2014 13:31:29 +0100 |
parents | b00219172a42 |
children | 4d204f6f7d4e |
line wrap: on
line diff
--- a/test/testzcc.py Thu Feb 20 20:04:52 2014 +0100 +++ b/test/testzcc.py Fri Feb 21 13:31:29 2014 +0100 @@ -12,7 +12,19 @@ testdir = os.path.dirname(os.path.abspath(__file__)) -class ZccTestCase(unittest.TestCase): +class ZccBaseTestCase(unittest.TestCase): + def callZcc(self, arg_list): + parser = zcc.make_parser() + arg_list = ['--log', 'warn'] + arg_list + args = parser.parse_args(arg_list) + self.assertEqual(0, zcc.main(args)) + + def buildRecipe(self, recipe): + arg_list = ['recipe', recipe] + self.callZcc(arg_list) + + +class ZccTestCase(ZccBaseTestCase): """ Tests the compiler driver """ def setUp(self): os.chdir(testdir) @@ -32,15 +44,6 @@ arg_list += extra_args self.callZcc(arg_list) - def callZcc(self, arg_list): - parser = zcc.make_parser() - arg_list = ['--log', 'warn'] + arg_list - args = parser.parse_args(arg_list) - self.assertEqual(0, zcc.main(args)) - - def buildRecipe(self, recipe): - arg_list = ['recipe', recipe] - self.callZcc(arg_list) def testDumpIr(self): basedir = os.path.join('..', 'examples', 'c3', 'comments.c3')