OLD | NEW |
1 #!/usr/bin/python2.4 | 1 #!/usr/bin/python2.4 |
2 # | 2 # |
3 # Copyright 2008, Google Inc. | 3 # Copyright 2008, Google Inc. |
4 # All rights reserved. | 4 # All rights reserved. |
5 # | 5 # |
6 # Redistribution and use in source and binary forms, with or without | 6 # Redistribution and use in source and binary forms, with or without |
7 # modification, are permitted provided that the following conditions are | 7 # modification, are permitted provided that the following conditions are |
8 # met: | 8 # met: |
9 # | 9 # |
10 # * Redistributions of source code must retain the above copyright | 10 # * Redistributions of source code must retain the above copyright |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 | 98 |
99 Returns: | 99 Returns: |
100 Code coverage percentage on sucess. | 100 Code coverage percentage on sucess. |
101 None on failure. | 101 None on failure. |
102 """ | 102 """ |
103 # Parse the LCOV file name. | 103 # Parse the LCOV file name. |
104 filename = os.path.basename(lcov_path).split('.')[0] | 104 filename = os.path.basename(lcov_path).split('.')[0] |
105 buffer = filename.split('_') | 105 buffer = filename.split('_') |
106 dash_root = dash_root.rstrip('/') # Remove trailing '/' | 106 dash_root = dash_root.rstrip('/') # Remove trailing '/' |
107 | 107 |
108 # Set up correct folder heirarchy in the dashboard root | 108 # Set up correct folder hierarchy in the dashboard root |
109 # TODO(niranjan): Check the formatting using a regexp | 109 # TODO(niranjan): Check the formatting using a regexp |
110 if len(buffer) >= 3: # Check if filename has right formatting | 110 if len(buffer) >= 3: # Check if filename has right formatting |
111 platform = buffer[len(buffer) - 2] | 111 platform = buffer[len(buffer) - 2] |
112 revision = buffer[len(buffer) - 1] | 112 revision = buffer[len(buffer) - 1] |
113 if os.path.exists(os.path.join(dash_root, platform)) == False: | 113 if os.path.exists(os.path.join(dash_root, platform)) == False: |
114 os.mkdir(os.path.join(dash_root, platform)) | 114 os.mkdir(os.path.join(dash_root, platform)) |
115 output_dir = os.path.join(dash_root, platform, revision) | 115 output_dir = os.path.join(dash_root, platform, revision) |
116 os.mkdir(output_dir) | 116 os.mkdir(output_dir) |
117 else: | 117 else: |
118 # TODO(niranjan): Add failure logging here. | 118 # TODO(niranjan): Add failure logging here. |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 print 'Unsupported platform' | 429 print 'Unsupported platform' |
430 os.exit(1) | 430 os.exit(1) |
431 | 431 |
432 # Prep coverage results for dashboard and post new set. | 432 # Prep coverage results for dashboard and post new set. |
433 parsed_data = ParseCoverageDataForDashboard(options.lcov_path) | 433 parsed_data = ParseCoverageDataForDashboard(options.lcov_path) |
434 PostResultsToDashboard(options.lcov_path, parsed_data, options.post_url) | 434 PostResultsToDashboard(options.lcov_path, parsed_data, options.post_url) |
435 | 435 |
436 | 436 |
437 if __name__ == '__main__': | 437 if __name__ == '__main__': |
438 main() | 438 main() |
OLD | NEW |