| 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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 # Set the env var used by mini_installer.exe to decide to not show UI. | 277 # Set the env var used by mini_installer.exe to decide to not show UI. |
| 278 os.environ['MINI_INSTALLER_TEST'] = '1' | 278 os.environ['MINI_INSTALLER_TEST'] = '1' |
| 279 is_component_build = IsComponentBuild(mini_installer_path) | 279 is_component_build = IsComponentBuild(mini_installer_path) |
| 280 if not is_component_build: | 280 if not is_component_build: |
| 281 config = ParseConfigFile(args.config) | 281 config = ParseConfigFile(args.config) |
| 282 | 282 |
| 283 variable_expander = VariableExpander(mini_installer_path) | 283 variable_expander = VariableExpander(mini_installer_path) |
| 284 RunCleanCommand(args.force_clean, variable_expander) | 284 RunCleanCommand(args.force_clean, variable_expander) |
| 285 for test in config.tests: | 285 for test in config.tests: |
| 286 # If tests were specified via |tests|, their names are formatted like so: | 286 # If tests were specified via |tests|, their names are formatted like so: |
| 287 test_name = '%s.%s.%s' % (InstallerTest.__module__, | 287 test_name = '%s/%s/%s' % (InstallerTest.__module__, |
| 288 InstallerTest.__name__, | 288 InstallerTest.__name__, |
| 289 test['name']) | 289 test['name']) |
| 290 if not args.test or test_name in args.test: | 290 if not args.test or test_name in args.test: |
| 291 suite.addTest(InstallerTest(test['name'], test['traversal'], config, | 291 suite.addTest(InstallerTest(test['name'], test['traversal'], config, |
| 292 variable_expander)) | 292 variable_expander)) |
| 293 | 293 |
| 294 result = unittest.TextTestRunner(verbosity=(args.verbose + 1)).run(suite) | 294 result = unittest.TextTestRunner(verbosity=(args.verbose + 1)).run(suite) |
| 295 if is_component_build: | 295 if is_component_build: |
| 296 print ('Component build is currently unsupported by the mini_installer: ' | 296 print ('Component build is currently unsupported by the mini_installer: ' |
| 297 'http://crbug.com/377839') | 297 'http://crbug.com/377839') |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 trie[path] = value | 364 trie[path] = value |
| 365 return | 365 return |
| 366 directory, rest = path.split(TEST_SEPARATOR, 1) | 366 directory, rest = path.split(TEST_SEPARATOR, 1) |
| 367 if directory not in trie: | 367 if directory not in trie: |
| 368 trie[directory] = {} | 368 trie[directory] = {} |
| 369 _AddPathToTrie(trie[directory], rest, value) | 369 _AddPathToTrie(trie[directory], rest, value) |
| 370 | 370 |
| 371 | 371 |
| 372 if __name__ == '__main__': | 372 if __name__ == '__main__': |
| 373 sys.exit(main()) | 373 sys.exit(main()) |
| OLD | NEW |