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

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

Issue 10627008: Added the ability to filter which tests are run by name, using a --filter (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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 | « tools/testing/dart/test_options.dart ('k') | 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 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 info)); 439 info));
440 } 440 }
441 } 441 }
442 442
443 List<Command> makeCommands(TestInformation info, var args) { 443 List<Command> makeCommands(TestInformation info, var args) {
444 if (configuration['compiler'] == 'dart2js') { 444 if (configuration['compiler'] == 'dart2js') {
445 args = new List.from(args); 445 args = new List.from(args);
446 String testPath = 446 String testPath =
447 new File(info.filename).fullPathSync().replaceAll('\\', '/'); 447 new File(info.filename).fullPathSync().replaceAll('\\', '/');
448 String tempDir = createOutputDirectory(testPath, ''); 448 String tempDir = createOutputDirectory(testPath, '');
449 if (configuration['filter'] != '') {
450 args.add('--filter="${configuration["filter"]}"');
451 }
449 args.add('--out=$tempDir/out.js'); 452 args.add('--out=$tempDir/out.js');
450 List<Command> commands = <Command>[new Command(shellPath(), args)]; 453 List<Command> commands = <Command>[new Command(shellPath(), args)];
451 if (configuration['runtime'] == 'd8') { 454 if (configuration['runtime'] == 'd8') {
452 var d8 = TestUtils.d8FileName(configuration); 455 var d8 = TestUtils.d8FileName(configuration);
453 commands.add(new Command(d8, ['$tempDir/out.js'])); 456 commands.add(new Command(d8, ['$tempDir/out.js']));
454 } 457 }
455 return commands; 458 return commands;
456 } else { 459 } else {
460 if (configuration['filter'] != '') {
461 args.add('--filter="${configuration["filter"]}"');
462 }
457 return <Command>[new Command(shellPath(), args)]; 463 return <Command>[new Command(shellPath(), args)];
458 } 464 }
459 } 465 }
460 466
461 Function makeTestCaseCreator(Map optionsFromFile) { 467 Function makeTestCaseCreator(Map optionsFromFile) {
462 return (String filename, 468 return (String filename,
463 bool isNegative, 469 bool isNegative,
464 [bool isNegativeIfChecked = false, 470 [bool isNegativeIfChecked = false,
465 bool hasFatalTypeErrors = false, 471 bool hasFatalTypeErrors = false,
466 bool hasRuntimeErrors = false, 472 bool hasRuntimeErrors = false,
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 dartLibraryFilename = 'test_as_library.dart'; 562 dartLibraryFilename = 'test_as_library.dart';
557 File file = new File('$tempDir/$dartLibraryFilename'); 563 File file = new File('$tempDir/$dartLibraryFilename');
558 RandomAccessFile dartLibrary = file.openSync(FileMode.WRITE); 564 RandomAccessFile dartLibrary = file.openSync(FileMode.WRITE);
559 dartLibrary.writeStringSync(WrapDartTestInLibrary(testPath)); 565 dartLibrary.writeStringSync(WrapDartTestInLibrary(testPath));
560 dartLibrary.closeSync(); 566 dartLibrary.closeSync();
561 } 567 }
562 568
563 File file = new File(dartWrapperFilename); 569 File file = new File(dartWrapperFilename);
564 RandomAccessFile dartWrapper = file.openSync(FileMode.WRITE); 570 RandomAccessFile dartWrapper = file.openSync(FileMode.WRITE);
565 dartWrapper.writeStringSync( 571 dartWrapper.writeStringSync(
566 DartTestWrapper(dartDir, dartLibraryFilename)); 572 DartTestWrapper(dartDir, dartLibraryFilename,
573 configuration['filter']));
567 dartWrapper.closeSync(); 574 dartWrapper.closeSync();
568 } else { 575 } else {
569 dartWrapperFilename = testPath; 576 dartWrapperFilename = testPath;
570 // TODO(whesse): Once test.py is retired, adjust the relative path in 577 // TODO(whesse): Once test.py is retired, adjust the relative path in
571 // the client/samples/dartcombat test to its css file, remove the 578 // the client/samples/dartcombat test to its css file, remove the
572 // "../../" from this path, and move this out of the isWebTest guard. 579 // "../../" from this path, and move this out of the isWebTest guard.
573 // Also remove getHtmlName, and just use test.html. 580 // Also remove getHtmlName, and just use test.html.
574 // TODO(efortuna): this shortening of htmlFilename is a band-aid until 581 // TODO(efortuna): this shortening of htmlFilename is a band-aid until
575 // the above TODO gets fixed. Windows cannot have paths that are longer 582 // the above TODO gets fixed. Windows cannot have paths that are longer
576 // than 260 characters, and without this hack, we were running past the 583 // than 260 characters, and without this hack, we were running past the
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after
1346 * $noCrash tests are expected to be flaky but not crash 1353 * $noCrash tests are expected to be flaky but not crash
1347 * $pass tests are expected to pass 1354 * $pass tests are expected to pass
1348 * $failOk tests are expected to fail that we won't fix 1355 * $failOk tests are expected to fail that we won't fix
1349 * $fail tests are expected to fail that we should fix 1356 * $fail tests are expected to fail that we should fix
1350 * $crash tests are expected to crash that we should fix 1357 * $crash tests are expected to crash that we should fix
1351 * $timeout tests are allowed to timeout 1358 * $timeout tests are allowed to timeout
1352 """; 1359 """;
1353 print(report); 1360 print(report);
1354 } 1361 }
1355 } 1362 }
OLDNEW
« no previous file with comments | « tools/testing/dart/test_options.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698