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

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

Issue 9250009: Fix test.dart on Windows: change all backslashes to slashes eagerly. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fix error in stub_generator/test_config.dart Created 8 years, 11 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 | « tests/stub-generator/test_config.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 #library("test_suite"); 5 #library("test_suite");
6 6
7 #import("status_file_parser.dart"); 7 #import("status_file_parser.dart");
8 #import("test_runner.dart"); 8 #import("test_runner.dart");
9 #import("multitest.dart"); 9 #import("multitest.dart");
10 10
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 bool isNegative) { 354 bool isNegative) {
355 if (optionsFromFile['isMultitest']) return; 355 if (optionsFromFile['isMultitest']) return;
356 bool isWebTest = optionsFromFile['containsDomImport']; 356 bool isWebTest = optionsFromFile['containsDomImport'];
357 bool isLibraryDefinition = optionsFromFile['isLibraryDefinition']; 357 bool isLibraryDefinition = optionsFromFile['isLibraryDefinition'];
358 if (!isLibraryDefinition && optionsFromFile['containsSourceOrImport']) { 358 if (!isLibraryDefinition && optionsFromFile['containsSourceOrImport']) {
359 print('Warning for $filename: Browser tests require #library ' + 359 print('Warning for $filename: Browser tests require #library ' +
360 'in any file that uses #import or #source'); 360 'in any file that uses #import or #source');
361 } 361 }
362 362
363 final String component = configuration['component']; 363 final String component = configuration['component'];
364 final String testPath = new File(filename).fullPathSync(); 364 final String testPath =
365 new File(filename).fullPathSync().replaceAll('\\', '/');
365 366
366 for (var vmOptions in optionsFromFile['vmOptions']) { 367 for (var vmOptions in optionsFromFile['vmOptions']) {
367 // Create a unique temporary directory for each set of vmOptions. 368 // Create a unique temporary directory for each set of vmOptions.
368 // TODO(dart:429): Replace separate replaceAlls with a RegExp when 369 // TODO(dart:429): Replace separate replaceAlls with a RegExp when
369 // replaceAll(RegExp, String) is implemented. 370 // replaceAll(RegExp, String) is implemented.
370 String optionsName = ''; 371 String optionsName = '';
371 if (optionsFromFile['vmOptions'].length > 1) { 372 if (optionsFromFile['vmOptions'].length > 1) {
372 optionsName = Strings.join(vmOptions, '-').replaceAll('-','') 373 optionsName = Strings.join(vmOptions, '-').replaceAll('-','')
373 .replaceAll('=','') 374 .replaceAll('=','')
374 .replaceAll('/',''); 375 .replaceAll('/','');
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 } 530 }
530 buildPath.removeRange(0, 1); 531 buildPath.removeRange(0, 1);
531 if (buildPath.last() == '') buildPath.removeLast(); 532 if (buildPath.last() == '') buildPath.removeLast();
532 buildPath.addAll(generatedTestPath); 533 buildPath.addAll(generatedTestPath);
533 generatedTestPath = buildPath; 534 generatedTestPath = buildPath;
534 tempDir = new Directory(tempDirPath); 535 tempDir = new Directory(tempDirPath);
535 if (!tempDir.existsSync()) { 536 if (!tempDir.existsSync()) {
536 tempDir.createSync(); 537 tempDir.createSync();
537 } 538 }
538 } 539 }
539 tempDirPath = new File(tempDirPath).fullPathSync(); 540 tempDirPath = new File(tempDirPath).fullPathSync().replaceAll('\\', '/');
540 541
541 for (String subdirectory in generatedTestPath) { 542 for (String subdirectory in generatedTestPath) {
542 tempDirPath = '$tempDirPath/$subdirectory'; 543 tempDirPath = '$tempDirPath/$subdirectory';
543 tempDir = new Directory(tempDirPath); 544 tempDir = new Directory(tempDirPath);
544 if (!tempDir.existsSync()) { 545 if (!tempDir.existsSync()) {
545 tempDir.createSync(); 546 tempDir.createSync();
546 } 547 }
547 } 548 }
548 return tempDir; 549 return tempDir;
549 } 550 }
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 729
729 void activityCompleted() { 730 void activityCompleted() {
730 if (--activityCount == 0) { 731 if (--activityCount == 0) {
731 directoryListingDone(true); 732 directoryListingDone(true);
732 } 733 }
733 } 734 }
734 735
735 String shellPath() => TestUtils.compilerPath(configuration); 736 String shellPath() => TestUtils.compilerPath(configuration);
736 737
737 List<String> additionalOptions(String filename) { 738 List<String> additionalOptions(String filename) {
738 filename = new File(filename).fullPathSync(); 739 filename = new File(filename).fullPathSync().replaceAll('\\', '/');
739 Directory tempDir = createOutputDirectory(filename, 'dartc-test'); 740 Directory tempDir = createOutputDirectory(filename, 'dartc-test');
740 return 741 return
741 [ '--fatal-warnings', '--fatal-type-errors', 742 [ '--fatal-warnings', '--fatal-type-errors',
742 '-check-only', '-out', tempDir.path]; 743 '-check-only', '-out', tempDir.path];
743 } 744 }
744 745
745 void processDirectory() { 746 void processDirectory() {
746 directoryPath = getDirname(directoryPath); 747 directoryPath = getDirname(directoryPath);
747 // Enqueueing the directory listers is an activity. 748 // Enqueueing the directory listers is an activity.
748 activityStarted(); 749 activityStarted();
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
953 static String buildDir(Map configuration) { 954 static String buildDir(Map configuration) {
954 var buildDir = outputDir(configuration); 955 var buildDir = outputDir(configuration);
955 buildDir += (configuration['mode'] == 'debug') ? 'Debug_' : 'Release_'; 956 buildDir += (configuration['mode'] == 'debug') ? 'Debug_' : 'Release_';
956 buildDir += configuration['arch']; 957 buildDir += configuration['arch'];
957 return buildDir; 958 return buildDir;
958 } 959 }
959 960
960 static String dartDir() { 961 static String dartDir() {
961 Directory dart; 962 Directory dart;
962 if (new File('tools/testing/dart/test_suite.dart').existsSync()) { 963 if (new File('tools/testing/dart/test_suite.dart').existsSync()) {
963 return new File('.').fullPathSync(); 964 return new File('.').fullPathSync().replaceAll('\\', '/');
964 } else if (new File('../tools/testing/dart/test_suite.dart').existsSync()) { 965 } else if (new File('../tools/testing/dart/test_suite.dart').existsSync()) {
965 return new File('..').fullPathSync(); 966 return new File('..').fullPathSync().replaceAll('\\', '/');
966 } else { 967 } else {
967 print('Run test.dart from the dart directory or' + 968 print('Run test.dart from the dart directory or' +
968 ' an immediate subdirectory only.'); 969 ' an immediate subdirectory only.');
969 Expect.fail('Could not find top level dart directory.'); 970 Expect.fail('Could not find top level dart directory.');
970 } 971 }
971 } 972 }
972 973
973 static List<String> standardOptions(Map configuration) { 974 static List<String> standardOptions(Map configuration) {
974 List args = ["--ignore-unrecognized-flags"]; 975 List args = ["--ignore-unrecognized-flags"];
975 if (configuration["checked"]) { 976 if (configuration["checked"]) {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
1033 * $noCrash tests are expected to be flaky but not crash 1034 * $noCrash tests are expected to be flaky but not crash
1034 * $pass tests are expected to pass 1035 * $pass tests are expected to pass
1035 * $failOk tests are expected to fail that we won't fix 1036 * $failOk tests are expected to fail that we won't fix
1036 * $fail tests are expected to fail that we should fix 1037 * $fail tests are expected to fail that we should fix
1037 * $crash tests are expected to crash that we should fix 1038 * $crash tests are expected to crash that we should fix
1038 * $timeout tests are allowed to timeout 1039 * $timeout tests are allowed to timeout
1039 """; 1040 """;
1040 print(report); 1041 print(report);
1041 } 1042 }
1042 } 1043 }
OLDNEW
« no previous file with comments | « tests/stub-generator/test_config.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698