diff 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
line wrap: on
line diff
--- a/test/testzcc.py	Mon Feb 17 20:41:30 2014 +0100
+++ b/test/testzcc.py	Wed Feb 19 22:32:15 2014 +0100
@@ -34,6 +34,7 @@
 
     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))
 
@@ -53,6 +54,18 @@
         recipe = os.path.join(testdir, '..', 'kernel', 'recipe.yaml')
         self.buildRecipe(recipe)
 
+    def testKernelBuildsEqualTwice(self):
+        """ Build kernel two times and check the output is equal """
+        recipe = os.path.join(testdir, '..', 'kernel', 'recipe.yaml')
+        bin_filename = os.path.join(testdir, '..', 'kernel', 'kernel.bin')
+        self.buildRecipe(recipe)
+        with open(bin_filename, 'rb') as f:
+            a = f.read()
+        self.buildRecipe(recipe)
+        with open(bin_filename, 'rb') as f:
+            b = f.read()
+        self.assertSequenceEqual(a, b)
+
     def testUser(self):
         """ Build userspace using zcc: """
         recipe = os.path.join(testdir, '..', 'user', 'recipe.yaml')