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

Side by Side Diff: build/android/gyp/java_cpp_enum_tests.py

Issue 1428173002: GN: Remove "outputs" parameter for java_cpp_enum() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « build/android/gyp/java_cpp_enum.py ('k') | build/android/gyp/util/build_utils.py » ('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/env python 1 #!/usr/bin/env python
2 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 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 """Tests for enum_preprocess.py. 6 """Tests for enum_preprocess.py.
7 7
8 This test suite containss various tests for the C++ -> Java enum generator. 8 This test suite containss various tests for the C++ -> Java enum generator.
9 """ 9 """
10 10
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 definition.AppendEntry('B', None) 411 definition.AppendEntry('B', None)
412 definition.AppendEntry('NAME_LAST', None) 412 definition.AppendEntry('NAME_LAST', None)
413 definition.Finalize() 413 definition.Finalize()
414 self.assertEqual(['A', 'B', 'NAME_LAST'], definition.entries.keys()) 414 self.assertEqual(['A', 'B', 'NAME_LAST'], definition.entries.keys())
415 415
416 def testGenerateThrowsOnEmptyInput(self): 416 def testGenerateThrowsOnEmptyInput(self):
417 with self.assertRaises(Exception): 417 with self.assertRaises(Exception):
418 original_do_parse = java_cpp_enum.DoParseHeaderFile 418 original_do_parse = java_cpp_enum.DoParseHeaderFile
419 try: 419 try:
420 java_cpp_enum.DoParseHeaderFile = lambda _: [] 420 java_cpp_enum.DoParseHeaderFile = lambda _: []
421 java_cpp_enum.DoGenerate('dir', ['file']) 421 for _ in java_cpp_enum.DoGenerate(['file']):
422 pass
422 finally: 423 finally:
423 java_cpp_enum.DoParseHeaderFile = original_do_parse 424 java_cpp_enum.DoParseHeaderFile = original_do_parse
424 425
425 def main(argv): 426 def main(argv):
426 parser = optparse.OptionParser() 427 parser = optparse.OptionParser()
427 parser.add_option("--stamp", help="File to touch on success.") 428 parser.add_option("--stamp", help="File to touch on success.")
428 options, _ = parser.parse_args(argv) 429 options, _ = parser.parse_args(argv)
429 430
430 suite = unittest.TestLoader().loadTestsFromTestCase(TestPreprocess) 431 suite = unittest.TestLoader().loadTestsFromTestCase(TestPreprocess)
431 unittest.TextTestRunner(verbosity=0).run(suite) 432 unittest.TextTestRunner(verbosity=0).run(suite)
432 433
433 if options.stamp: 434 if options.stamp:
434 build_utils.Touch(options.stamp) 435 build_utils.Touch(options.stamp)
435 436
436 if __name__ == '__main__': 437 if __name__ == '__main__':
437 main(sys.argv[1:]) 438 main(sys.argv[1:])
OLDNEW
« no previous file with comments | « build/android/gyp/java_cpp_enum.py ('k') | build/android/gyp/util/build_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698