Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: tests/bitmaps/TestBmpBlock.py

Issue 6533012: Write images to the bmpblock in the order they appear in the yaml. (Closed) Base URL: http://git.chromium.org/git/vboot_reference.git@master
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/bitmaps/case_order1.yaml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python -tt 1 #!/usr/bin/python -tt
2 # 2 #
3 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved. 3 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """Unit tests for bmpblk_utility. 7 """Unit tests for bmpblk_utility.
8 """ 8 """
9 9
10 import os 10 import os
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 self.assertEqual(0, rc) 100 self.assertEqual(0, rc)
101 rc, out, err = runprog('/usr/bin/cmp', '../FOO', 'BAR') 101 rc, out, err = runprog('/usr/bin/cmp', '../FOO', 'BAR')
102 self.assertEqual(0, rc) 102 self.assertEqual(0, rc)
103 os.chdir('..') 103 os.chdir('..')
104 104
105 def tearDown(self): 105 def tearDown(self):
106 rc, out, err = runprog('/bin/rm', '-rf', './FOO_DIR', 'FOO') 106 rc, out, err = runprog('/bin/rm', '-rf', './FOO_DIR', 'FOO')
107 self.assertEqual(0, rc) 107 self.assertEqual(0, rc)
108 108
109 109
110 class TestReproducable(unittest.TestCase):
111
112 def setUp(self):
113 rc, out, err = runprog('/bin/rm', '-f', 'ORDER1', 'ORDER2')
114 self.assertEqual(0, rc)
115
116 def testReproduce(self):
117 """equivalent yaml files should produce identical bmpblocks"""
118 rc, out, err = runprog(prog, '-c', 'case_order1.yaml', 'ORDER1')
119 self.assertEqual(0, rc)
120 rc, out, err = runprog(prog, '-c', 'case_order2.yaml', 'ORDER2')
121 self.assertEqual(0, rc)
122 rc, out, err = runprog('/usr/bin/cmp', 'ORDER1', 'ORDER2')
123 self.assertEqual(0, rc)
124
125 def tearDown(self):
126 rc, out, err = runprog('/bin/rm', '-f', 'ORDER1', 'ORDER2')
127 self.assertEqual(0, rc)
128
129
110 # Run these tests 130 # Run these tests
111 if __name__ == '__main__': 131 if __name__ == '__main__':
112 varname = 'BMPBLK' 132 varname = 'BMPBLK'
113 if varname not in os.environ: 133 if varname not in os.environ:
114 print('You must specify the path to bmpblk_utility in the $%s ' 134 print('You must specify the path to bmpblk_utility in the $%s '
115 'environment variable.' % varname) 135 'environment variable.' % varname)
116 sys.exit(1) 136 sys.exit(1)
117 prog = os.environ[varname] 137 prog = os.environ[varname]
118 print "Testing prog...", prog 138 print "Testing prog...", prog
119 unittest.main() 139 unittest.main()
120 140
OLDNEW
« no previous file with comments | « no previous file | tests/bitmaps/case_order1.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698