| 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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 | 357 |
| 358 suite = unittest.TestSuite() | 358 suite = unittest.TestSuite() |
| 359 | 359 |
| 360 variable_expander = VariableExpander(mini_installer_path, | 360 variable_expander = VariableExpander(mini_installer_path, |
| 361 next_version_mini_installer_path) | 361 next_version_mini_installer_path) |
| 362 config = ParseConfigFile(args.config, variable_expander) | 362 config = ParseConfigFile(args.config, variable_expander) |
| 363 | 363 |
| 364 RunCleanCommand(args.force_clean, variable_expander) | 364 RunCleanCommand(args.force_clean, variable_expander) |
| 365 for test in config.tests: | 365 for test in config.tests: |
| 366 # If tests were specified via |tests|, their names are formatted like so: | 366 # If tests were specified via |tests|, their names are formatted like so: |
| 367 test_name = '%s/%s/%s' % (InstallerTest.__module__, | 367 test_name = '%s.%s.%s' % (InstallerTest.__module__, |
| 368 InstallerTest.__name__, | 368 InstallerTest.__name__, |
| 369 test['name']) | 369 test['name']) |
| 370 if not args.test or test_name in args.test: | 370 if not args.test or test_name in args.test: |
| 371 suite.addTest(InstallerTest(test['name'], test['traversal'], config, | 371 suite.addTest(InstallerTest(test['name'], test['traversal'], config, |
| 372 variable_expander, args.quiet)) | 372 variable_expander, args.quiet)) |
| 373 | 373 |
| 374 verbosity = 2 if not args.quiet else 1 | 374 verbosity = 2 if not args.quiet else 1 |
| 375 result = unittest.TextTestRunner(verbosity=verbosity).run(suite) | 375 result = unittest.TextTestRunner(verbosity=verbosity).run(suite) |
| 376 if args.write_full_results_to: | 376 if args.write_full_results_to: |
| 377 with open(args.write_full_results_to, 'w') as fp: | 377 with open(args.write_full_results_to, 'w') as fp: |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 trie[path] = value | 442 trie[path] = value |
| 443 return | 443 return |
| 444 directory, rest = path.split(TEST_SEPARATOR, 1) | 444 directory, rest = path.split(TEST_SEPARATOR, 1) |
| 445 if directory not in trie: | 445 if directory not in trie: |
| 446 trie[directory] = {} | 446 trie[directory] = {} |
| 447 _AddPathToTrie(trie[directory], rest, value) | 447 _AddPathToTrie(trie[directory], rest, value) |
| 448 | 448 |
| 449 | 449 |
| 450 if __name__ == '__main__': | 450 if __name__ == '__main__': |
| 451 sys.exit(main()) | 451 sys.exit(main()) |
| OLD | NEW |