forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add --shards support to trace_test_cases.py.
This permits much faster experimentation for very large test executable by using --index 0 --shards 1000. R=cmp@chromium.org NOTRY=true BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/10553023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142892 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
maruel@chromium.org
committed
Jun 19, 2012
1 parent
78180d9
commit 9fb2958
Showing
3 changed files
with
115 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env python | ||
# Copyright (c) 2012 The Chromium Authors. All rights reserved. | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
import unittest | ||
|
||
import list_test_cases | ||
|
||
|
||
class ListTestCasesTest(unittest.TestCase): | ||
def test_shards(self): | ||
test_cases = ( | ||
(range(10), 10, 0, 1), | ||
|
||
([0, 1], 5, 0, 3), | ||
([2, 3], 5, 1, 3), | ||
([4 ], 5, 2, 3), | ||
|
||
([0], 5, 0, 7), | ||
([1], 5, 1, 7), | ||
([2], 5, 2, 7), | ||
([3], 5, 3, 7), | ||
([4], 5, 4, 7), | ||
([ ], 5, 5, 7), | ||
([ ], 5, 6, 7), | ||
|
||
([0, 1], 4, 0, 2), | ||
([2, 3], 4, 1, 2), | ||
) | ||
for expected, range_length, index, shards in test_cases: | ||
result = list_test_cases.filter_shards(range(range_length), index, shards) | ||
self.assertEquals( | ||
expected, result, (result, expected, range_length, index, shards)) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters