aboutsummaryrefslogtreecommitdiff
path: root/bestflags/builder_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'bestflags/builder_test.py')
-rw-r--r--bestflags/builder_test.py42
1 files changed, 42 insertions, 0 deletions
diff --git a/bestflags/builder_test.py b/bestflags/builder_test.py
new file mode 100644
index 00000000..9a636ff3
--- /dev/null
+++ b/bestflags/builder_test.py
@@ -0,0 +1,42 @@
+"""Builder unittest."""
+
+__author__ = 'yuhenglong@google.com (Yuheng Long)'
+
+import unittest
+
+import builder
+
+
+class BuilderTest(unittest.TestCase):
+ """This class test the Builder.
+
+ Given the same flags set, the image and the cost should result the same from
+ the builder.
+ """
+
+ def setUp(self):
+ """Create the Builder to be tested."""
+
+ self.builder = builder.Builder(1, None)
+
+ def testCompile(self):
+ """"Test the build method.
+
+ Call the build method twice, and test the results. The results should be the
+ same, i.e., the image, the cost and the checksum should be the same.
+ Either the compile method or the set_compile_result of the input Generation
+ for the Builder should be called, but not both.
+ """
+ self.builder.build(self)
+
+ def testInit(self):
+ """"Test the init method.
+
+ If a certain flag set has been encountered before, the builder should not
+ recompile the image with the same optimization flag set.
+ """
+
+ pass
+
+if __name__ == '__main__':
+ unittest.main()