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

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

Issue 12387010: Add --csp flag to test.dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
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 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after
1089 String executable = compilerPath; 1089 String executable = compilerPath;
1090 List<String> args = TestUtils.standardOptions(configuration); 1090 List<String> args = TestUtils.standardOptions(configuration);
1091 switch (compiler) { 1091 switch (compiler) {
1092 case 'dart2js': 1092 case 'dart2js':
1093 case 'dart2dart': 1093 case 'dart2dart':
1094 String packageRoot = 1094 String packageRoot =
1095 packageRootArgument(optionsFromFile['packageRoot']); 1095 packageRootArgument(optionsFromFile['packageRoot']);
1096 if (packageRoot != null) { 1096 if (packageRoot != null) {
1097 args.add(packageRoot); 1097 args.add(packageRoot);
1098 } 1098 }
1099 if (compiler == 'dart2dart') args.add('--out=$outputFile');
1100 args.add('--out=$outputFile'); 1099 args.add('--out=$outputFile');
1101 args.add(inputFile); 1100 args.add(inputFile);
1102 break; 1101 break;
1103 default: 1102 default:
1104 Expect.fail('unimplemented compiler $compiler'); 1103 Expect.fail('unimplemented compiler $compiler');
1105 } 1104 }
1106 if (executable.endsWith('.dart')) { 1105 if (executable.endsWith('.dart')) {
1107 // Run the compiler script via the Dart VM. 1106 // Run the compiler script via the Dart VM.
1108 args.insertRange(0, 1, executable); 1107 args.insertRange(0, 1, executable);
1109 executable = dartShellFileName; 1108 executable = dartShellFileName;
(...skipping 28 matching lines...) Expand all
1138 if (!optionsName.isEmpty) { 1137 if (!optionsName.isEmpty) {
1139 testUniqueName = '$testUniqueName-$optionsName'; 1138 testUniqueName = '$testUniqueName-$optionsName';
1140 } 1139 }
1141 1140
1142 // Create '[build dir]/generated_tests/$compiler-$runtime/$testUniqueName', 1141 // Create '[build dir]/generated_tests/$compiler-$runtime/$testUniqueName',
1143 // including any intermediate directories that don't exist. 1142 // including any intermediate directories that don't exist.
1144 // If the tests are run in checked or minified mode we add that to the 1143 // If the tests are run in checked or minified mode we add that to the
1145 // '$compile-$runtime' directory name. 1144 // '$compile-$runtime' directory name.
1146 var checked = configuration['checked'] ? '-checked' : ''; 1145 var checked = configuration['checked'] ? '-checked' : '';
1147 var minified = configuration['minified'] ? '-minified' : ''; 1146 var minified = configuration['minified'] ? '-minified' : '';
1147 var csp = configuration['csp'] ? '-csp' : '';
1148 var dirName = "${configuration['compiler']}-${configuration['runtime']}" 1148 var dirName = "${configuration['compiler']}-${configuration['runtime']}"
1149 "$checked$minified"; 1149 "$checked$minified$csp";
1150 Path generatedTestPath = new Path(buildDir) 1150 Path generatedTestPath = new Path(buildDir)
1151 .append('generated_tests') 1151 .append('generated_tests')
1152 .append(dirName) 1152 .append(dirName)
1153 .append(testUniqueName); 1153 .append(testUniqueName);
1154 1154
1155 TestUtils.mkdirRecursive(new Path('.'), generatedTestPath); 1155 TestUtils.mkdirRecursive(new Path('.'), generatedTestPath);
1156 return new File.fromPath(generatedTestPath).fullPathSync() 1156 return new File.fromPath(generatedTestPath).fullPathSync()
1157 .replaceAll('\\', '/'); 1157 .replaceAll('\\', '/');
1158 } 1158 }
1159 1159
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
1807 // args.add("--verbose"); 1807 // args.add("--verbose");
1808 if (!isBrowserRuntime(configuration['runtime'])) { 1808 if (!isBrowserRuntime(configuration['runtime'])) {
1809 args.add("--allow-mock-compilation"); 1809 args.add("--allow-mock-compilation");
1810 args.add("--categories=all"); 1810 args.add("--categories=all");
1811 } 1811 }
1812 } 1812 }
1813 if ((compiler == "dart2js" || compiler == "dart2dart") && 1813 if ((compiler == "dart2js" || compiler == "dart2dart") &&
1814 configuration["minified"]) { 1814 configuration["minified"]) {
1815 args.add("--minify"); 1815 args.add("--minify");
1816 } 1816 }
1817 if (compiler == "dart2js" && configuration["csp"]) {
1818 args.add("--disallow-unsafe-eval");
1819 }
1817 return args; 1820 return args;
1818 } 1821 }
1819 1822
1820 static bool usesWebDriver(String runtime) { 1823 static bool usesWebDriver(String runtime) {
1821 const BROWSERS = const [ 1824 const BROWSERS = const [
1822 'dartium', 1825 'dartium',
1823 'ie9', 1826 'ie9',
1824 'ie10', 1827 'ie10',
1825 'safari', 1828 'safari',
1826 'opera', 1829 'opera',
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
1935 * $pass tests are expected to pass 1938 * $pass tests are expected to pass
1936 * $failOk tests are expected to fail that we won't fix 1939 * $failOk tests are expected to fail that we won't fix
1937 * $fail tests are expected to fail that we should fix 1940 * $fail tests are expected to fail that we should fix
1938 * $crash tests are expected to crash that we should fix 1941 * $crash tests are expected to crash that we should fix
1939 * $timeout tests are allowed to timeout 1942 * $timeout tests are allowed to timeout
1940 * $compileErrorSkip tests are skipped on browsers due to compile-time error 1943 * $compileErrorSkip tests are skipped on browsers due to compile-time error
1941 """; 1944 """;
1942 print(report); 1945 print(report);
1943 } 1946 }
1944 } 1947 }
OLDNEW
« tools/testing/dart/http_server.dart ('K') | « tools/testing/dart/test_options.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698