Index: tools/testing/dart/runtime_configuration.dart |
diff --git a/tools/testing/dart/runtime_configuration.dart b/tools/testing/dart/runtime_configuration.dart |
index 33b83e982e3369914da23cb4229c133c42975b3c..94207b61a36b3d62de3fbd0212093fddd4f35c6f 100644 |
--- a/tools/testing/dart/runtime_configuration.dart |
+++ b/tools/testing/dart/runtime_configuration.dart |
@@ -4,6 +4,8 @@ |
library runtime_configuration; |
+import 'dart:io' show Directory, File; |
+ |
import 'compiler_configuration.dart' show CommandArtifact; |
// TODO(ahe): Remove this import, we can precompute all the values required |
@@ -59,6 +61,9 @@ class RuntimeConfiguration { |
case 'drt': |
return new DrtRuntimeConfiguration(); |
+ case 'self_check': |
+ return new SelfCheckRuntimeConfiguration(); |
+ |
default: |
throw "Unknown runtime '$runtime'"; |
} |
@@ -82,6 +87,8 @@ class RuntimeConfiguration { |
} |
List<String> dart2jsPreambles(Uri preambleDir) => []; |
+ |
+ bool get shouldSkipNegativeTests => false; |
} |
/// The 'none' runtime configuration. |
@@ -287,6 +294,39 @@ class DartPrecompiledAdbRuntimeConfiguration |
} |
} |
+class SelfCheckRuntimeConfiguration extends DartVmRuntimeConfiguration { |
+ final List<String> selfCheckers = <String>[]; |
+ |
+ SelfCheckRuntimeConfiguration() { |
+ searchForSelfCheckers(); |
+ } |
+ |
+ void searchForSelfCheckers() { |
+ for (var entry in new Directory('pkg').listSync(recursive: true)) { |
Bill Hesse
2016/12/06 14:46:03
Please use the test utils to specify the full path
asgerf
2016/12/06 15:41:49
Done.
|
+ if (entry is File && entry.path.endsWith('_self_check.dart')) { |
+ selfCheckers.add(entry.path); |
+ } |
+ } |
+ } |
+ |
+ List<Command> computeRuntimeCommands( |
+ TestSuite suite, |
+ CommandBuilder commandBuilder, |
+ CommandArtifact artifact, |
+ List<String> arguments, |
+ Map<String, String> environmentOverrides) { |
+ String executable = suite.dartVmBinaryFileName; |
+ return selfCheckers |
+ .map((String tester) => commandBuilder.getSelfCheckCommand( |
+ executable, tester, arguments, environmentOverrides, |
+ checked: suite.configuration['checked'])) |
+ .toList(); |
+ } |
+ |
+ @override |
+ bool get shouldSkipNegativeTests => true; |
+} |
+ |
/// Temporary runtime configuration for browser runtimes that haven't been |
/// migrated yet. |
// TODO(ahe): Remove this class. |