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

Unified Diff: tools/testing/dart/test_suite.dart

Issue 2955513002: Dynamically load packages for dartdevc tests in test.dart. (Closed)
Patch Set: Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: tools/testing/dart/test_suite.dart
diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart
index 7930cfa5dec63118c21cc529080d12a94a5ddfe8..2404ac4ebba795daccefa4dc1b3e058c13133993 100644
--- a/tools/testing/dart/test_suite.dart
+++ b/tools/testing/dart/test_suite.dart
@@ -167,7 +167,7 @@ abstract class TestSuite {
String get compilerPath {
var compilerConfiguration = configuration.compilerConfiguration;
if (!compilerConfiguration.hasCompiler) return null;
- var name = compilerConfiguration.computeCompilerPath(buildDir);
+ var name = compilerConfiguration.computeCompilerPath();
// TODO(ahe): Only validate this once, in test_options.dart.
TestUtils.ensureExists(name, configuration);
@@ -881,7 +881,7 @@ class StandardTestSuite extends TestSuite {
CommandArtifact compilationArtifact =
compilerConfiguration.computeCompilationArtifact(
- buildDir, tempDir, compileTimeArguments, environmentOverrides);
+ tempDir, compileTimeArguments, environmentOverrides);
if (!configuration.skipCompilation) {
commands.addAll(compilationArtifact.commands);
}
@@ -895,7 +895,6 @@ class StandardTestSuite extends TestSuite {
List<String> runtimeArguments =
compilerConfiguration.computeRuntimeArguments(
configuration.runtimeConfiguration,
- buildDir,
info,
vmOptions,
sharedOptions,
@@ -1089,7 +1088,7 @@ class StandardTestSuite extends TestSuite {
var jsDir = new Path(compilationTempDir)
.relativeTo(TestUtils.dartDir)
.toString();
- content = dartdevcHtml(nameNoExt, jsDir);
+ content = dartdevcHtml(nameNoExt, jsDir, buildDir);
}
new File(htmlPath).writeAsStringSync(content);
@@ -1106,8 +1105,8 @@ class StandardTestSuite extends TestSuite {
break;
case Compiler.dartdevc:
- commands.add(_dartdevcCompileCommand(dartWrapperFilename,
- '$compilationTempDir/$nameNoExt.js', optionsFromFile));
+ commands.add(configuration.compilerConfiguration.createCommand(
+ dartWrapperFilename, '$compilationTempDir/$nameNoExt.js'));
break;
default:
@@ -1126,8 +1125,8 @@ class StandardTestSuite extends TestSuite {
break;
case Compiler.dartdevc:
- commands.add(_dartdevcCompileCommand(fromPath.toNativePath(),
- '$tempDir/${namePath.filename}.js', optionsFromFile));
+ commands.add(configuration.compilerConfiguration.createCommand(
+ fromPath.toNativePath(), '$tempDir/${namePath.filename}.js'));
break;
default:
@@ -1319,33 +1318,6 @@ class StandardTestSuite extends TestSuite {
alwaysCompile: !useSdk);
}
- /// Creates a [Command] to compile a single .dart file using dartdevc.
- Command _dartdevcCompileCommand(String inputFile, String outputFile,
- Map<String, dynamic> optionsFromFile) {
- var args = [
- "--dart-sdk",
- "$buildDir/dart-sdk",
- "--library-root",
- new Path(inputFile).directoryPath.toString(),
- "-o",
- outputFile,
- inputFile
- ];
-
- // TODO(29923): This compiles everything imported by the test into the
- // same generated JS module, including other packages like expect,
- // stack_trace, etc. Those should be compiled as separate JS modules (by
- // build.py) and loaded dynamically by the test.
-
- return Command.compilation(
- Compiler.dartdevc.name,
- outputFile,
- configuration.compilerConfiguration.bootstrapDependencies(buildDir),
- compilerPath,
- args,
- environmentOverrides);
- }
-
String get scriptType {
switch (configuration.compiler) {
case Compiler.none:

Powered by Google App Engine
This is Rietveld 408576698