OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 """Generate and process code coverage. | 6 """Generate and process code coverage. |
7 | 7 |
8 TODO(jrg): rename this from coverage_posix.py to coverage_all.py! | 8 TODO(jrg): rename this from coverage_posix.py to coverage_all.py! |
9 | 9 |
10 Written for and tested on Mac, Linux, and Windows. To use this script | 10 Written for and tested on Mac, Linux, and Windows. To use this script |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
511 # We need 'pyautolib' to run pyauto tests and 'pyautolib' itself is not an | 511 # We need 'pyautolib' to run pyauto tests and 'pyautolib' itself is not an |
512 # executable. So skip this test from adding into coverage_bundles.py. | 512 # executable. So skip this test from adding into coverage_bundles.py. |
513 if testname == 'pyautolib': | 513 if testname == 'pyautolib': |
514 continue | 514 continue |
515 self.tests += [os.path.join(self.directory, testname)] | 515 self.tests += [os.path.join(self.directory, testname)] |
516 if gtest_filter: | 516 if gtest_filter: |
517 self.test_filters[testname] = gtest_filter | 517 self.test_filters[testname] = gtest_filter |
518 | 518 |
519 # Add 'src/test/functional/pyauto_functional.py' to self.tests. | 519 # Add 'src/test/functional/pyauto_functional.py' to self.tests. |
520 # This file with '-v --suite=CODE_COVERAGE' arguments runs all pyauto tests. | 520 # This file with '-v --suite=CODE_COVERAGE' arguments runs all pyauto tests. |
521 self.tests += [['src/chrome/test/functional/pyauto_functional.py', | 521 # Pyauto tests are failing randomly on coverage bots. So excluding it. |
Nirnimesh
2012/08/09 17:37:38
it -> them.
pshenoy
2012/08/09 17:44:03
Done.
| |
522 '-v', | 522 # self.tests += [['src/chrome/test/functional/pyauto_functional.py', |
523 '--suite=CODE_COVERAGE']] | 523 # '-v', |
524 # '--suite=CODE_COVERAGE']] | |
524 | 525 |
525 # Medium tests? | 526 # Medium tests? |
526 # Not sure all of these work yet (e.g. page_cycler_tests) | 527 # Not sure all of these work yet (e.g. page_cycler_tests) |
527 # self.tests += glob.glob(os.path.join(self.directory, '*_tests')) | 528 # self.tests += glob.glob(os.path.join(self.directory, '*_tests')) |
528 | 529 |
529 # If needed, append .exe to tests since vsinstr.exe likes it that | 530 # If needed, append .exe to tests since vsinstr.exe likes it that |
530 # way. | 531 # way. |
531 if self.IsWindows(): | 532 if self.IsWindows(): |
532 for ind in range(len(self.tests)): | 533 for ind in range(len(self.tests)): |
533 test = self.tests[ind] | 534 test = self.tests[ind] |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1005 if options.trim: | 1006 if options.trim: |
1006 coverage.TrimTests() | 1007 coverage.TrimTests() |
1007 coverage.RunTests() | 1008 coverage.RunTests() |
1008 if options.genhtml: | 1009 if options.genhtml: |
1009 coverage.GenerateHtml() | 1010 coverage.GenerateHtml() |
1010 return 0 | 1011 return 0 |
1011 | 1012 |
1012 | 1013 |
1013 if __name__ == '__main__': | 1014 if __name__ == '__main__': |
1014 sys.exit(main()) | 1015 sys.exit(main()) |
OLD | NEW |