comparison test/testzcc.py @ 336:d1ecc493384e

Added spiffy armtoken class for bit fiddeling. Added cool test that checks for build repeatability
author Windel Bouwman
date Wed, 19 Feb 2014 22:32:15 +0100
parents 582a1aaa3983
children b00219172a42
comparison
equal deleted inserted replaced
335:582a1aaa3983 336:d1ecc493384e
32 arg_list += extra_args 32 arg_list += extra_args
33 self.callZcc(arg_list) 33 self.callZcc(arg_list)
34 34
35 def callZcc(self, arg_list): 35 def callZcc(self, arg_list):
36 parser = zcc.make_parser() 36 parser = zcc.make_parser()
37 arg_list = ['--log', 'warn'] + arg_list
37 args = parser.parse_args(arg_list) 38 args = parser.parse_args(arg_list)
38 self.assertEqual(0, zcc.main(args)) 39 self.assertEqual(0, zcc.main(args))
39 40
40 def buildRecipe(self, recipe): 41 def buildRecipe(self, recipe):
41 arg_list = ['recipe', recipe] 42 arg_list = ['recipe', recipe]
50 51
51 def testKernel(self): 52 def testKernel(self):
52 """ Build kernel using zcc: """ 53 """ Build kernel using zcc: """
53 recipe = os.path.join(testdir, '..', 'kernel', 'recipe.yaml') 54 recipe = os.path.join(testdir, '..', 'kernel', 'recipe.yaml')
54 self.buildRecipe(recipe) 55 self.buildRecipe(recipe)
56
57 def testKernelBuildsEqualTwice(self):
58 """ Build kernel two times and check the output is equal """
59 recipe = os.path.join(testdir, '..', 'kernel', 'recipe.yaml')
60 bin_filename = os.path.join(testdir, '..', 'kernel', 'kernel.bin')
61 self.buildRecipe(recipe)
62 with open(bin_filename, 'rb') as f:
63 a = f.read()
64 self.buildRecipe(recipe)
65 with open(bin_filename, 'rb') as f:
66 b = f.read()
67 self.assertSequenceEqual(a, b)
55 68
56 def testUser(self): 69 def testUser(self):
57 """ Build userspace using zcc: """ 70 """ Build userspace using zcc: """
58 recipe = os.path.join(testdir, '..', 'user', 'recipe.yaml') 71 recipe = os.path.join(testdir, '..', 'user', 'recipe.yaml')
59 self.buildRecipe(recipe) 72 self.buildRecipe(recipe)