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

Side by Side Diff: tools/testing/dart/test_suite.dart

Issue 9918017: Don't use the full filename for hash value when sharding tests, this will make the result depend on… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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 | Annotate | Revision Log
« 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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * Classes and methods for enumerating and preparing tests. 6 * Classes and methods for enumerating and preparing tests.
7 * 7 *
8 * This library includes: 8 * This library includes:
9 * 9 *
10 * - Creating tests by listing all the Dart files in certain directories, 10 * - Creating tests by listing all the Dart files in certain directories,
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 } else { 320 } else {
321 testName = filename; 321 testName = filename;
322 } 322 }
323 323
324 if (configuration['compiler'] != 'dartc') { 324 if (configuration['compiler'] != 'dartc') {
325 if (testName.endsWith('.dart')) { 325 if (testName.endsWith('.dart')) {
326 testName = testName.substring(0, testName.length - 5); 326 testName = testName.substring(0, testName.length - 5);
327 } 327 }
328 } 328 }
329 } 329 }
330 int shards = configuration['shards'];
331 if (shards > 1) {
332 int shard = configuration['shard'];
333 if (testName.hashCode() % shards != shard -1) {
334 return;
335 }
336 }
337
330 Set<String> expectations = testExpectations.expectations(testName); 338 Set<String> expectations = testExpectations.expectations(testName);
331 if (configuration['report']) { 339 if (configuration['report']) {
332 // Tests with multiple VMOptions are counted more than once. 340 // Tests with multiple VMOptions are counted more than once.
333 for (var dummy in optionsFromFile["vmOptions"]) { 341 for (var dummy in optionsFromFile["vmOptions"]) {
334 SummaryReport.add(expectations); 342 SummaryReport.add(expectations);
335 } 343 }
336 } 344 }
337 if (expectations.contains(SKIP)) return; 345 if (expectations.contains(SKIP)) return;
338 346
339 if (TestUtils.isBrowserRuntime(configuration['runtime'])) { 347 if (TestUtils.isBrowserRuntime(configuration['runtime'])) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 } 381 }
374 } 382 }
375 383
376 Function makeTestCaseCreator(Map optionsFromFile) { 384 Function makeTestCaseCreator(Map optionsFromFile) {
377 return (String filename, 385 return (String filename,
378 bool isNegative, 386 bool isNegative,
379 [bool isNegativeIfChecked = false, 387 [bool isNegativeIfChecked = false,
380 bool hasFatalTypeErrors = false, 388 bool hasFatalTypeErrors = false,
381 bool hasRuntimeErrors = false, 389 bool hasRuntimeErrors = false,
382 Set<String> multitestOutcome = null]) { 390 Set<String> multitestOutcome = null]) {
383 int shards = configuration['shards'];
384 if (shards > 1) {
385 int shard = configuration['shard'];
386 if (filename.hashCode() % shards != shard -1) {
387 return;
388 }
389 }
390
391 // Cache the test information for each test case. 391 // Cache the test information for each test case.
392 var info = new TestInformation(filename, 392 var info = new TestInformation(filename,
393 optionsFromFile, 393 optionsFromFile,
394 isNegative, 394 isNegative,
395 isNegativeIfChecked, 395 isNegativeIfChecked,
396 hasFatalTypeErrors, 396 hasFatalTypeErrors,
397 hasRuntimeErrors, 397 hasRuntimeErrors,
398 multitestOutcome); 398 multitestOutcome);
399 cachedTests.add(info); 399 cachedTests.add(info);
400 enqueueTestCaseFromTestInformation(info); 400 enqueueTestCaseFromTestInformation(info);
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after
1239 * $noCrash tests are expected to be flaky but not crash 1239 * $noCrash tests are expected to be flaky but not crash
1240 * $pass tests are expected to pass 1240 * $pass tests are expected to pass
1241 * $failOk tests are expected to fail that we won't fix 1241 * $failOk tests are expected to fail that we won't fix
1242 * $fail tests are expected to fail that we should fix 1242 * $fail tests are expected to fail that we should fix
1243 * $crash tests are expected to crash that we should fix 1243 * $crash tests are expected to crash that we should fix
1244 * $timeout tests are allowed to timeout 1244 * $timeout tests are allowed to timeout
1245 """; 1245 """;
1246 print(report); 1246 print(report);
1247 } 1247 }
1248 } 1248 }
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