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

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

Issue 9584004: Revert "Enable use of #import stmts containing relative paths in Dart multitests" This change broke… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 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/multitest.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 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 } 663 }
664 buildPath.removeRange(0, 1); 664 buildPath.removeRange(0, 1);
665 if (buildPath.last() == '') buildPath.removeLast(); 665 if (buildPath.last() == '') buildPath.removeLast();
666 buildPath.addAll(generatedTestPath); 666 buildPath.addAll(generatedTestPath);
667 generatedTestPath = buildPath; 667 generatedTestPath = buildPath;
668 tempDir = new Directory(tempDirPath); 668 tempDir = new Directory(tempDirPath);
669 if (!tempDir.existsSync()) { 669 if (!tempDir.existsSync()) {
670 tempDir.createSync(); 670 tempDir.createSync();
671 } 671 }
672 } 672 }
673 TestUtils.mkdirRecursive(tempDirPath, 673 tempDirPath = new File(tempDirPath).fullPathSync().replaceAll('\\', '/');
674 Strings.join(generatedTestPath, '/')); 674
675 for (String subdirectory in generatedTestPath) {
676 tempDirPath = '$tempDirPath/$subdirectory';
677 tempDir = new Directory(tempDirPath);
678 if (!tempDir.existsSync()) {
679 tempDir.createSync();
680 }
681 }
675 return tempDir; 682 return tempDir;
676 } 683 }
677 684
678 String get scriptType() { 685 String get scriptType() {
679 switch (configuration['component']) { 686 switch (configuration['component']) {
680 case 'dartium': 687 case 'dartium':
681 return 'application/dart'; 688 return 'application/dart';
682 case 'chromium': 689 case 'chromium':
683 case 'frogium': 690 case 'frogium':
684 case 'legium': 691 case 'legium':
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
1009 '$dartDir/third_party/hamcrest/v1_3/hamcrest-generator-1.3.0RC2.jar', 1016 '$dartDir/third_party/hamcrest/v1_3/hamcrest-generator-1.3.0RC2.jar',
1010 '$dartDir/third_party/hamcrest/v1_3/hamcrest-integration-1.3.0RC2.jar', 1017 '$dartDir/third_party/hamcrest/v1_3/hamcrest-integration-1.3.0RC2.jar',
1011 '$dartDir/third_party/hamcrest/v1_3/hamcrest-library-1.3.0RC2.jar', 1018 '$dartDir/third_party/hamcrest/v1_3/hamcrest-library-1.3.0RC2.jar',
1012 '$dartDir/third_party/junit/v4_8_2/junit.jar'], 1019 '$dartDir/third_party/junit/v4_8_2/junit.jar'],
1013 ':'); // Path separator. 1020 ':'); // Path separator.
1014 } 1021 }
1015 } 1022 }
1016 1023
1017 1024
1018 class TestUtils { 1025 class TestUtils {
1019
1020 /**
1021 * Creates a directory using a [relativePath] to an existing
1022 * [base] directory if that [relativePath] does not already exist.
1023 */
1024 static void mkdirRecursive(String base, String relativePath) {
1025 Directory baseDir = new Directory(base);
1026 Expect.isTrue(baseDir.existsSync(),
1027 "This method expects ${base} to already exist");
1028 String pathSep = new Platform().pathSeparator();
1029 if (pathSep != '/') {
1030 relativePath = relativePath.replaceAll(pathSep, '/');
1031 }
1032 for (String dir in relativePath.split('/')) {
1033 var tempDir = new Directory('$base/$dir');
1034 if (!tempDir.existsSync()) {
1035 tempDir.createSync();
1036 }
1037 base = "$base/$dir";
1038 }
1039 }
1040
1041 /**
1042 * Copy a [source] file to a new place.
1043 * Assumes that the directory for [dest] already exists.
1044 */
1045 static void copyFile(File source, File dest) {
1046 List contents = source.readAsBytesSync();
1047 RandomAccessFile handle = dest.openSync(FileMode.WRITE);
1048 handle.writeListSync(contents, 0, contents.length);
1049 handle.closeSync();
1050 }
1051
1052 static String executableSuffix(String component) { 1026 static String executableSuffix(String component) {
1053 if (new Platform().operatingSystem() == 'windows') { 1027 if (new Platform().operatingSystem() == 'windows') {
1054 if (component != 'frogium' 1028 if (component != 'frogium'
1055 && component != 'legium' 1029 && component != 'legium'
1056 && component != 'webdriver') { 1030 && component != 'webdriver') {
1057 return '.exe'; 1031 return '.exe';
1058 } else { 1032 } else {
1059 return '.bat'; 1033 return '.bat';
1060 } 1034 }
1061 } 1035 }
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
1199 * $noCrash tests are expected to be flaky but not crash 1173 * $noCrash tests are expected to be flaky but not crash
1200 * $pass tests are expected to pass 1174 * $pass tests are expected to pass
1201 * $failOk tests are expected to fail that we won't fix 1175 * $failOk tests are expected to fail that we won't fix
1202 * $fail tests are expected to fail that we should fix 1176 * $fail tests are expected to fail that we should fix
1203 * $crash tests are expected to crash that we should fix 1177 * $crash tests are expected to crash that we should fix
1204 * $timeout tests are allowed to timeout 1178 * $timeout tests are allowed to timeout
1205 """; 1179 """;
1206 print(report); 1180 print(report);
1207 } 1181 }
1208 } 1182 }
OLDNEW
« no previous file with comments | « tools/testing/dart/multitest.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698