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

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

Issue 10226008: Revert "unittest step 3 and 4: remove TestFramework.dart, make test.dart use" (Closed) Base URL: https://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 | « tools/testing/dart/browser_test.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 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 String optionsName = ''; 532 String optionsName = '';
533 if (optionsFromFile['vmOptions'].length > 1) { 533 if (optionsFromFile['vmOptions'].length > 1) {
534 optionsName = Strings.join(vmOptions, '-').replaceAll('-','') 534 optionsName = Strings.join(vmOptions, '-').replaceAll('-','')
535 .replaceAll('=','') 535 .replaceAll('=','')
536 .replaceAll('/',''); 536 .replaceAll('/','');
537 } 537 }
538 Directory tempDir = createOutputDirectory(testPath, optionsName); 538 Directory tempDir = createOutputDirectory(testPath, optionsName);
539 539
540 String dartWrapperFilename = '${tempDir.path}/test.dart'; 540 String dartWrapperFilename = '${tempDir.path}/test.dart';
541 String compiledDartWrapperFilename = '${tempDir.path}/test.js'; 541 String compiledDartWrapperFilename = '${tempDir.path}/test.js';
542 String domLibraryImport = 'dart:dom';
542 543
543 String htmlPath = '${tempDir.path}/test.html'; 544 String htmlPath = '${tempDir.path}/test.html';
544 if (!isWebTest) { 545 if (!isWebTest) {
545 // test.dart will import the dart test directly, if it is a library, 546 // test.dart will import the dart test directly, if it is a library,
546 // or indirectly through test_as_library.dart, if it is not. 547 // or indirectly through test_as_library.dart, if it is not.
547 String dartLibraryFilename; 548 String dartLibraryFilename;
548 if (isLibraryDefinition) { 549 if (isLibraryDefinition) {
549 dartLibraryFilename = testPath; 550 dartLibraryFilename = testPath;
550 } else { 551 } else {
551 dartLibraryFilename = 'test_as_library.dart'; 552 dartLibraryFilename = 'test_as_library.dart';
552 File file = new File('${tempDir.path}/$dartLibraryFilename'); 553 File file = new File('${tempDir.path}/$dartLibraryFilename');
553 RandomAccessFile dartLibrary = file.openSync(FileMode.WRITE); 554 RandomAccessFile dartLibrary = file.openSync(FileMode.WRITE);
554 dartLibrary.writeStringSync(WrapDartTestInLibrary(testPath)); 555 dartLibrary.writeStringSync(WrapDartTestInLibrary(testPath));
555 dartLibrary.closeSync(); 556 dartLibrary.closeSync();
556 } 557 }
557 558
558 File file = new File(dartWrapperFilename); 559 File file = new File(dartWrapperFilename);
559 RandomAccessFile dartWrapper = file.openSync(FileMode.WRITE); 560 RandomAccessFile dartWrapper = file.openSync(FileMode.WRITE);
560 dartWrapper.writeStringSync( 561 dartWrapper.writeStringSync(DartTestWrapper(
561 DartTestWrapper(dartDir, dartLibraryFilename)); 562 domLibraryImport,
563 '$dartDir/tests/isolate/src/TestFramework.dart',
564 dartLibraryFilename));
562 dartWrapper.closeSync(); 565 dartWrapper.closeSync();
563 } else { 566 } else {
564 dartWrapperFilename = testPath; 567 dartWrapperFilename = testPath;
565 // TODO(whesse): Once test.py is retired, adjust the relative path in 568 // TODO(whesse): Once test.py is retired, adjust the relative path in
566 // the client/samples/dartcombat test to its css file, remove the 569 // the client/samples/dartcombat test to its css file, remove the
567 // "../../" from this path, and move this out of the isWebTest guard. 570 // "../../" from this path, and move this out of the isWebTest guard.
568 // Also remove getHtmlName, and just use test.html. 571 // Also remove getHtmlName, and just use test.html.
569 // TODO(efortuna): this shortening of htmlFilename is a band-aid until 572 // TODO(efortuna): this shortening of htmlFilename is a band-aid until
570 // the above TODO gets fixed. Windows cannot have paths that are longer 573 // the above TODO gets fixed. Windows cannot have paths that are longer
571 // than 260 characters, and without this hack, we were running past the 574 // than 260 characters, and without this hack, we were running past the
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after
1367 * $noCrash tests are expected to be flaky but not crash 1370 * $noCrash tests are expected to be flaky but not crash
1368 * $pass tests are expected to pass 1371 * $pass tests are expected to pass
1369 * $failOk tests are expected to fail that we won't fix 1372 * $failOk tests are expected to fail that we won't fix
1370 * $fail tests are expected to fail that we should fix 1373 * $fail tests are expected to fail that we should fix
1371 * $crash tests are expected to crash that we should fix 1374 * $crash tests are expected to crash that we should fix
1372 * $timeout tests are allowed to timeout 1375 * $timeout tests are allowed to timeout
1373 """; 1376 """;
1374 print(report); 1377 print(report);
1375 } 1378 }
1376 } 1379 }
OLDNEW
« no previous file with comments | « tools/testing/dart/browser_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698