| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """This script tests the installer with test cases specified in the config file. | 5 """This script tests the installer with test cases specified in the config file. |
| 6 | 6 |
| 7 For each test case, it checks that the machine states after the execution of | 7 For each test case, it checks that the machine states after the execution of |
| 8 each command match the expected machine states. For more details, take a look at | 8 each command match the expected machine states. For more details, take a look at |
| 9 the design documentation at http://goo.gl/Q0rGM6 | 9 the design documentation at http://goo.gl/Q0rGM6 |
| 10 """ | 10 """ |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 | 247 |
| 248 Args: | 248 Args: |
| 249 mini_installer_path: The path to mini_installer.exe. | 249 mini_installer_path: The path to mini_installer.exe. |
| 250 | 250 |
| 251 Returns: | 251 Returns: |
| 252 True if the mini_installer is a component build, False otherwise. | 252 True if the mini_installer is a component build, False otherwise. |
| 253 """ | 253 """ |
| 254 query_command = mini_installer_path + ' --query-component-build' | 254 query_command = mini_installer_path + ' --query-component-build' |
| 255 script_dir = os.path.dirname(os.path.abspath(__file__)) | 255 script_dir = os.path.dirname(os.path.abspath(__file__)) |
| 256 exit_status = subprocess.call(query_command, shell=True, cwd=script_dir) | 256 exit_status = subprocess.call(query_command, shell=True, cwd=script_dir) |
| 257 return exit_status != 0 | 257 return exit_status == 0 |
| 258 | 258 |
| 259 | 259 |
| 260 def main(): | 260 def main(): |
| 261 usage = 'usage: %prog [options] config_filename' | 261 usage = 'usage: %prog [options] config_filename' |
| 262 parser = optparse.OptionParser(usage, description='Test the installer.') | 262 parser = optparse.OptionParser(usage, description='Test the installer.') |
| 263 parser.add_option('--build-dir', default='out', | 263 parser.add_option('--build-dir', default='out', |
| 264 help='Path to main build directory (the parent of the ' | 264 help='Path to main build directory (the parent of the ' |
| 265 'Release or Debug directory)') | 265 'Release or Debug directory)') |
| 266 parser.add_option('--target', default='Release', | 266 parser.add_option('--target', default='Release', |
| 267 help='Build target (Release or Debug)') | 267 help='Build target (Release or Debug)') |
| (...skipping 17 matching lines...) Expand all Loading... |
| 285 return 0 | 285 return 0 |
| 286 | 286 |
| 287 config = ParseConfigFile(config_filename) | 287 config = ParseConfigFile(config_filename) |
| 288 if not RunTests(mini_installer_path, config, options.force_clean): | 288 if not RunTests(mini_installer_path, config, options.force_clean): |
| 289 return 1 | 289 return 1 |
| 290 return 0 | 290 return 0 |
| 291 | 291 |
| 292 | 292 |
| 293 if __name__ == '__main__': | 293 if __name__ == '__main__': |
| 294 sys.exit(main()) | 294 sys.exit(main()) |
| OLD | NEW |