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

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

Issue 10021048: Remove need to instantiate Platform and make methods static. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add stable test binaries. 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/test_runner.dart ('k') | utils/compiler/build_helper.dart » ('j') | 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 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 while ('${tempDir.path}/../$htmlFilename'.length >= 260) { 558 while ('${tempDir.path}/../$htmlFilename'.length >= 260) {
559 htmlFilename = htmlFilename.substring(htmlFilename.length~/2); 559 htmlFilename = htmlFilename.substring(htmlFilename.length~/2);
560 } 560 }
561 htmlPath = '${tempDir.path}/../$htmlFilename'; 561 htmlPath = '${tempDir.path}/../$htmlFilename';
562 } 562 }
563 final String scriptPath = (compiler == 'none') ? 563 final String scriptPath = (compiler == 'none') ?
564 dartWrapperFilename : compiledDartWrapperFilename; 564 dartWrapperFilename : compiledDartWrapperFilename;
565 // Create the HTML file for the test. 565 // Create the HTML file for the test.
566 RandomAccessFile htmlTest = new File(htmlPath).openSync(FileMode.WRITE); 566 RandomAccessFile htmlTest = new File(htmlPath).openSync(FileMode.WRITE);
567 String filePrefix = ''; 567 String filePrefix = '';
568 if (new Platform().operatingSystem() == 'windows') { 568 if (Platform.operatingSystem() == 'windows') {
569 // Firefox on Windows does not like absolute file path names that start 569 // Firefox on Windows does not like absolute file path names that start
570 // with 'C:' adding 'file:///' solves the problem. 570 // with 'C:' adding 'file:///' solves the problem.
571 filePrefix = 'file:///'; 571 filePrefix = 'file:///';
572 } 572 }
573 htmlTest.writeStringSync(GetHtmlContents( 573 htmlTest.writeStringSync(GetHtmlContents(
574 filename, 574 filename,
575 '$filePrefix$dartDir/lib/unittest/test_controller.js', 575 '$filePrefix$dartDir/lib/unittest/test_controller.js',
576 scriptType, 576 scriptType,
577 filePrefix + scriptPath)); 577 filePrefix + scriptPath));
578 htmlTest.closeSync(); 578 htmlTest.closeSync();
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 String getHtmlName(String filename) { 770 String getHtmlName(String filename) {
771 return filename.replaceAll('/', '_').replaceAll(':', '_') 771 return filename.replaceAll('/', '_').replaceAll(':', '_')
772 .replaceAll('\\', '_') + configuration['compiler'] + '-' + 772 .replaceAll('\\', '_') + configuration['compiler'] + '-' +
773 configuration['runtime'] + '.html'; 773 configuration['runtime'] + '.html';
774 } 774 }
775 775
776 String get dumpRenderTreeFilename() { 776 String get dumpRenderTreeFilename() {
777 if (configuration['drt'] != '') { 777 if (configuration['drt'] != '') {
778 return configuration['drt']; 778 return configuration['drt'];
779 } 779 }
780 if (new Platform().operatingSystem() == 'macos') { 780 if (Platform.operatingSystem() == 'macos') {
781 return '$dartDir/client/tests/drt/DumpRenderTree.app/Contents/' 781 return '$dartDir/client/tests/drt/DumpRenderTree.app/Contents/'
782 'MacOS/DumpRenderTree'; 782 'MacOS/DumpRenderTree';
783 } 783 }
784 return '$dartDir/client/tests/drt/DumpRenderTree'; 784 return '$dartDir/client/tests/drt/DumpRenderTree';
785 } 785 }
786 786
787 String get dartiumFilename() { 787 String get dartiumFilename() {
788 if (configuration['dartium'] != '') { 788 if (configuration['dartium'] != '') {
789 return configuration['dartium']; 789 return configuration['dartium'];
790 } 790 }
791 if (new Platform().operatingSystem() == 'macos') { 791 if (Platform.operatingSystem() == 'macos') {
792 return '$dartDir/client/tests/dartium/Chromium.app/Contents/' 792 return '$dartDir/client/tests/dartium/Chromium.app/Contents/'
793 'MacOS/Chromium'; 793 'MacOS/Chromium';
794 } 794 }
795 return '$dartDir/client/tests/dartium/chrome'; 795 return '$dartDir/client/tests/dartium/chrome';
796 } 796 }
797 797
798 void testGeneratorStarted() { 798 void testGeneratorStarted() {
799 ++activeTestGenerators; 799 ++activeTestGenerators;
800 } 800 }
801 801
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
1214 * Assumes that the directory for [dest] already exists. 1214 * Assumes that the directory for [dest] already exists.
1215 */ 1215 */
1216 static void copyFile(File source, File dest) { 1216 static void copyFile(File source, File dest) {
1217 List contents = source.readAsBytesSync(); 1217 List contents = source.readAsBytesSync();
1218 RandomAccessFile handle = dest.openSync(FileMode.WRITE); 1218 RandomAccessFile handle = dest.openSync(FileMode.WRITE);
1219 handle.writeListSync(contents, 0, contents.length); 1219 handle.writeListSync(contents, 0, contents.length);
1220 handle.closeSync(); 1220 handle.closeSync();
1221 } 1221 }
1222 1222
1223 static String executableSuffix(String executable) { 1223 static String executableSuffix(String executable) {
1224 if (new Platform().operatingSystem() == 'windows') { 1224 if (Platform.operatingSystem() == 'windows') {
1225 if (executable == 'd8' || executable == 'vm' || executable == 'none') { 1225 if (executable == 'd8' || executable == 'vm' || executable == 'none') {
1226 return '.exe'; 1226 return '.exe';
1227 } else { 1227 } else {
1228 return '.bat'; 1228 return '.bat';
1229 } 1229 }
1230 } 1230 }
1231 return ''; 1231 return '';
1232 } 1232 }
1233 1233
1234 static String executableName(Map configuration) { 1234 static String executableName(Map configuration) {
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
1380 * $noCrash tests are expected to be flaky but not crash 1380 * $noCrash tests are expected to be flaky but not crash
1381 * $pass tests are expected to pass 1381 * $pass tests are expected to pass
1382 * $failOk tests are expected to fail that we won't fix 1382 * $failOk tests are expected to fail that we won't fix
1383 * $fail tests are expected to fail that we should fix 1383 * $fail tests are expected to fail that we should fix
1384 * $crash tests are expected to crash that we should fix 1384 * $crash tests are expected to crash that we should fix
1385 * $timeout tests are allowed to timeout 1385 * $timeout tests are allowed to timeout
1386 """; 1386 """;
1387 print(report); 1387 print(report);
1388 } 1388 }
1389 } 1389 }
OLDNEW
« no previous file with comments | « tools/testing/dart/test_runner.dart ('k') | utils/compiler/build_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698