OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2009 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Unittest for the generate_stubs.py. | 6 """Unittest for the generate_stubs.py. |
7 | 7 |
8 Since generate_stubs.py is a code generator, it is hard to do a very good | 8 Since generate_stubs.py is a code generator, it is hard to do a very good |
9 test. Instead of creating a golden-file test, which might be flakey, this | 9 test. Instead of creating a golden-file test, which might be flakey, this |
10 test elects instead to verify that various components "exist" within the | 10 test elects instead to verify that various components "exist" within the |
11 generated file as a sanity check. In particular, there is a simple hit | 11 generated file as a sanity check. In particular, there is a simple hit |
12 test to make sure that umbrella functions, etc., do try and include every | 12 test to make sure that umbrella functions, etc., do try and include every |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 msg='Expected "%s" in %s' % (decl, contents)) | 274 msg='Expected "%s" in %s' % (decl, contents)) |
275 decl = gs.PosixStubWriter.InitializeModuleName(name) | 275 decl = gs.PosixStubWriter.InitializeModuleName(name) |
276 self.assertTrue(contents.find(decl) != -1, | 276 self.assertTrue(contents.find(decl) != -1, |
277 msg='Expected "%s" in %s' % (decl, contents)) | 277 msg='Expected "%s" in %s' % (decl, contents)) |
278 decl = gs.PosixStubWriter.UninitializeModuleName(name) | 278 decl = gs.PosixStubWriter.UninitializeModuleName(name) |
279 self.assertTrue(contents.find(decl) != -1, | 279 self.assertTrue(contents.find(decl) != -1, |
280 msg='Expected "%s" in %s' % (decl, contents)) | 280 msg='Expected "%s" in %s' % (decl, contents)) |
281 | 281 |
282 if __name__ == '__main__': | 282 if __name__ == '__main__': |
283 unittest.main() | 283 unittest.main() |
OLD | NEW |