| 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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 help='Name(s) of tests to run.') | 343 help='Name(s) of tests to run.') |
| 344 args = parser.parse_args() | 344 args = parser.parse_args() |
| 345 if not args.config: | 345 if not args.config: |
| 346 parser.error('missing mandatory --config FILENAME argument') | 346 parser.error('missing mandatory --config FILENAME argument') |
| 347 | 347 |
| 348 mini_installer_path = os.path.join(args.build_dir, args.target, | 348 mini_installer_path = os.path.join(args.build_dir, args.target, |
| 349 'mini_installer.exe') | 349 'mini_installer.exe') |
| 350 assert os.path.exists(mini_installer_path), ('Could not find file %s' % | 350 assert os.path.exists(mini_installer_path), ('Could not find file %s' % |
| 351 mini_installer_path) | 351 mini_installer_path) |
| 352 | 352 |
| 353 next_version_mini_installer_path = os.path.join( |
| 354 args.build_dir, args.target, 'next_version_mini_installer.exe') |
| 355 assert os.path.exists(next_version_mini_installer_path), ( |
| 356 'Could not find file %s' % next_version_mini_installer_path) |
| 357 |
| 353 suite = unittest.TestSuite() | 358 suite = unittest.TestSuite() |
| 354 | 359 |
| 355 variable_expander = VariableExpander(mini_installer_path) | 360 variable_expander = VariableExpander(mini_installer_path, |
| 361 next_version_mini_installer_path) |
| 356 config = ParseConfigFile(args.config, variable_expander) | 362 config = ParseConfigFile(args.config, variable_expander) |
| 357 | 363 |
| 358 RunCleanCommand(args.force_clean, variable_expander) | 364 RunCleanCommand(args.force_clean, variable_expander) |
| 359 for test in config.tests: | 365 for test in config.tests: |
| 360 # 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: |
| 361 test_name = '%s/%s/%s' % (InstallerTest.__module__, | 367 test_name = '%s/%s/%s' % (InstallerTest.__module__, |
| 362 InstallerTest.__name__, | 368 InstallerTest.__name__, |
| 363 test['name']) | 369 test['name']) |
| 364 if not args.test or test_name in args.test: | 370 if not args.test or test_name in args.test: |
| 365 suite.addTest(InstallerTest(test['name'], test['traversal'], config, | 371 suite.addTest(InstallerTest(test['name'], test['traversal'], config, |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 trie[path] = value | 442 trie[path] = value |
| 437 return | 443 return |
| 438 directory, rest = path.split(TEST_SEPARATOR, 1) | 444 directory, rest = path.split(TEST_SEPARATOR, 1) |
| 439 if directory not in trie: | 445 if directory not in trie: |
| 440 trie[directory] = {} | 446 trie[directory] = {} |
| 441 _AddPathToTrie(trie[directory], rest, value) | 447 _AddPathToTrie(trie[directory], rest, value) |
| 442 | 448 |
| 443 | 449 |
| 444 if __name__ == '__main__': | 450 if __name__ == '__main__': |
| 445 sys.exit(main()) | 451 sys.exit(main()) |
| OLD | NEW |