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

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

Issue 256743009: Cache output of dart2js compilations that went wrong on disk. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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
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 1899 matching lines...) Expand 10 before | Expand all | Expand 10 after
1910 1910
1911 /** 1911 /**
1912 * Copy a [source] file to a new place. 1912 * Copy a [source] file to a new place.
1913 * Assumes that the directory for [dest] already exists. 1913 * Assumes that the directory for [dest] already exists.
1914 */ 1914 */
1915 static Future copyFile(Path source, Path dest) { 1915 static Future copyFile(Path source, Path dest) {
1916 return new File(source.toNativePath()).openRead() 1916 return new File(source.toNativePath()).openRead()
1917 .pipe(new File(dest.toNativePath()).openWrite()); 1917 .pipe(new File(dest.toNativePath()).openWrite());
1918 } 1918 }
1919 1919
1920 static Future isContentEqual(Path source, Path dest) {
1921 return new File(source.toNativePath()).readAsString()
1922 .then((srcString) {
1923 return new File(dest.toNativePath()).readAsString()
1924 .then((destString) => srcString == destString);
1925 })
1926 .catchError((error) {
1927 return false;
1928 });
1929 }
1930
1931 static Future copyIfDifferent(Path source, Path dest) {
1932 return isContentEqual(source, dest).then((equal) {
1933 return equal ? null : TestUtils.copyFile(source, dest);
1934 });
1935 }
1936
1920 static Future copyDirectory(String source, String dest) { 1937 static Future copyDirectory(String source, String dest) {
1921 source = new Path(source).toNativePath(); 1938 source = new Path(source).toNativePath();
1922 dest = new Path(dest).toNativePath(); 1939 dest = new Path(dest).toNativePath();
1923 1940
1924 var executable = 'cp'; 1941 var executable = 'cp';
1925 var args = ['-Rp', source, dest]; 1942 var args = ['-Rp', source, dest];
1926 if (Platform.operatingSystem == 'windows') { 1943 if (Platform.operatingSystem == 'windows') {
1927 executable = 'xcopy'; 1944 executable = 'xcopy';
1928 args = [source, dest, '/e', '/i']; 1945 args = [source, dest, '/e', '/i'];
1929 } 1946 }
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
2140 path.length > WINDOWS_SHORTEN_PATH_LIMIT) { 2157 path.length > WINDOWS_SHORTEN_PATH_LIMIT) {
2141 for (var key in PATH_REPLACEMENTS.keys) { 2158 for (var key in PATH_REPLACEMENTS.keys) {
2142 if (path.startsWith(key)) { 2159 if (path.startsWith(key)) {
2143 path = path.replaceFirst(key, PATH_REPLACEMENTS[key]); 2160 path = path.replaceFirst(key, PATH_REPLACEMENTS[key]);
2144 break; 2161 break;
2145 } 2162 }
2146 } 2163 }
2147 } 2164 }
2148 return path; 2165 return path;
2149 } 2166 }
2167
2168 static String cachedOutputFile(String outputFile) {
2169 return "$outputFile.cached_output";
2170 }
2171
2150 } 2172 }
2151 2173
2152 class SummaryReport { 2174 class SummaryReport {
2153 static int total = 0; 2175 static int total = 0;
2154 static int skipped = 0; 2176 static int skipped = 0;
2155 static int skippedByDesign = 0; 2177 static int skippedByDesign = 0;
2156 static int noCrash = 0; 2178 static int noCrash = 0;
2157 static int pass = 0; 2179 static int pass = 0;
2158 static int failOk = 0; 2180 static int failOk = 0;
2159 static int fail = 0; 2181 static int fail = 0;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
2211 * $pass tests are expected to pass 2233 * $pass tests are expected to pass
2212 * $failOk tests are expected to fail that we won't fix 2234 * $failOk tests are expected to fail that we won't fix
2213 * $fail tests are expected to fail that we should fix 2235 * $fail tests are expected to fail that we should fix
2214 * $crash tests are expected to crash that we should fix 2236 * $crash tests are expected to crash that we should fix
2215 * $timeout tests are allowed to timeout 2237 * $timeout tests are allowed to timeout
2216 * $compileErrorSkip tests are skipped on browsers due to compile-time error 2238 * $compileErrorSkip tests are skipped on browsers due to compile-time error
2217 """; 2239 """;
2218 print(report); 2240 print(report);
2219 } 2241 }
2220 } 2242 }
OLDNEW
« tools/testing/dart/test_runner.dart ('K') | « tools/testing/dart/test_runner.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698