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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 full_results['version'] = 3 | 328 full_results['version'] = 3 |
329 full_results['seconds_since_epoch'] = time.time() | 329 full_results['seconds_since_epoch'] = time.time() |
330 for md in metadata: | 330 for md in metadata: |
331 key, val = md.split('=', 1) | 331 key, val = md.split('=', 1) |
332 full_results[key] = val | 332 full_results[key] = val |
333 | 333 |
334 all_test_names = _AllTestNames(suite) | 334 all_test_names = _AllTestNames(suite) |
335 failed_test_names = _FailedTestNames(result) | 335 failed_test_names = _FailedTestNames(result) |
336 | 336 |
337 full_results['num_failures_by_type'] = { | 337 full_results['num_failures_by_type'] = { |
338 'Failure': len(failed_test_names), | 338 'FAIL': len(failed_test_names), |
339 'Pass': len(all_test_names) - len(failed_test_names), | 339 'PASS': len(all_test_names) - len(failed_test_names), |
340 } | 340 } |
341 | 341 |
342 full_results['tests'] = {} | 342 full_results['tests'] = {} |
343 | 343 |
344 for test_name in all_test_names: | 344 for test_name in all_test_names: |
345 value = { | 345 value = { |
346 'expected': 'PASS', | 346 'expected': 'PASS', |
347 'actual': 'FAIL' if (test_name in failed_test_names) else 'PASS', | 347 'actual': 'FAIL' if (test_name in failed_test_names) else 'PASS', |
348 } | 348 } |
349 _AddPathToTrie(full_results['tests'], test_name, value) | 349 _AddPathToTrie(full_results['tests'], test_name, value) |
(...skipping 21 matching lines...) Expand all Loading... |
371 trie[path] = value | 371 trie[path] = value |
372 return | 372 return |
373 directory, rest = path.split(TEST_SEPARATOR, 1) | 373 directory, rest = path.split(TEST_SEPARATOR, 1) |
374 if directory not in trie: | 374 if directory not in trie: |
375 trie[directory] = {} | 375 trie[directory] = {} |
376 _AddPathToTrie(trie[directory], rest, value) | 376 _AddPathToTrie(trie[directory], rest, value) |
377 | 377 |
378 | 378 |
379 if __name__ == '__main__': | 379 if __name__ == '__main__': |
380 sys.exit(main()) | 380 sys.exit(main()) |
OLD | NEW |