Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: chrome/test/mini_installer/test_installer.py

Issue 2739473004: Fix interpretation of tests specified on the command line. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698