Move the test runner (i.e. "test.dart"/"test.py") to pkg/.

This makes it an actual Pub package like most other code inside the SDK
repo. The main goal is to make it easier to write tests for the test
runner itself.

This change:

- Moves all of the code from tools/testing/dart/ over to
  pkg/test_runner. Most of it ends up under test_runner/lib/src.

- Move tools/testing/dart/main.dart to
  pkg/test_runner/bin/test_runner.dart.

- Move standalone_2/io/test_runner_test.dart to
  pkg/test_runner/test/test_runner_test.dart. I don't think it currently
  works, but it wasn't being run in its old location either.

- Add test_runner to the analysis-server bot. This ensures the
  test_runner package is static error clean.

- Remove standalone_2/io/test_runner_analyze_test.dart which used to
  attempt to do the above and is no longer needed.

- Update test.py to look for the test runner at its new location.

- Add test_runner to the repo .packages file and remove the weird
  test_dart pseudo-package. (I think this fixes #35279.)

- Remove status file entries for the removed standalone_2 tests.

There are no code changes to the test runner itself aside from fixing
up import paths.

Change-Id: I3d05d50d222b291848fa5a30de2846e803bc81e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105821
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
This commit is contained in:
Robert Nystrom 2019-06-14 23:35:10 +00:00 committed by commit-bot@chromium.org
parent 3bacc84c1e
commit 99e8a9fba5
80 changed files with 201 additions and 636 deletions

View file

@ -94,10 +94,10 @@ term_glyph:third_party/pkg/term_glyph/lib
test:third_party/pkg/test/pkgs/test/lib
test_api:third_party/pkg/test/pkgs/test_api/lib
test_core:third_party/pkg/test/pkgs/test_core/lib
test_dart:tools/testing/dart
test_descriptor:third_party/pkg/test_descriptor/lib
test_process:third_party/pkg/test_process/lib
test_reflective_loader:third_party/pkg/test_reflective_loader/lib
test_runner:pkg/test_runner/lib
testing:pkg/testing/lib
typed_data:third_party/pkg/typed_data/lib
unittest:third_party/pkg/unittest/lib

View file

@ -163,7 +163,7 @@ String getWrapperContent(
void createHtmlWrapper(File sdkJsFile, Uri outputFile, String jsContent,
String outputFilename, Uri outDir) {
// For debugging via HTML, Chrome and ./tools/testing/dart/http_server.dart.
// For debugging via HTML, Chrome and ./pkg/test_runner/bin/http_server.dart.
var sdkFile = File(path.relative(sdkJsFile.path, from: sdkRoot.path));
String jsRootDart = "/root_dart/${sdkFile.uri}";
File.fromUri(outputFile.resolve("$outputFilename.html.js")).writeAsStringSync(
@ -173,7 +173,7 @@ void createHtmlWrapper(File sdkJsFile, Uri outputFile, String jsContent,
jsRootDart, "/root_build/$outputFilename.html.js"));
print("You should now be able to run\n\n"
"dart ${sdkRoot.path}/tools/testing/dart/http_server.dart -p 39550 "
"dart ${sdkRoot.path}/pkg/test_runner/bin/http_server.dart -p 39550 "
"--network 127.0.0.1 "
"--build-directory=${outDir.toFilePath()}"
"\n\nand go to\n\n"

View file

@ -84,6 +84,7 @@ status_file/test/normalize_test: SkipByDesign # Uses dart:io
status_file/test/parse_and_normalize_test: SkipByDesign # Uses dart:io
status_file/test/repo_status_files_test: SkipByDesign # Uses dart:io
telemetry/test/*: SkipByDesign # Only meant to run on vm
test_runner/test/*: SkipByDesign # Only meant to run on vm
testing/*: SkipByDesign # Only meant to run on vm
typed_data/test/typed_buffers_test/01: Fail # Not supporting Int64List, Uint64List.

View file

@ -2,6 +2,10 @@ name: smith
author: Dart Team <misc@dartlang.org>
description: Shared code for working with the Dart SDK's tests and test runner.
homepage: http://www.dartlang.org
# This package is not intended to be published.
publish_to: none
environment:
sdk: "^2.3.0"
dev_dependencies:
expect:
path: ../expect

View file

@ -1,11 +1,11 @@
name: status_file
# This package is not intended to be published.
publish_to: none
environment:
sdk: "^2.3.0"
dependencies:
path: "^1.4.0"
args: "^1.4.4"
dev_dependencies:
expect:
path: ../expect

View file

@ -35,7 +35,6 @@ no_lazy_dispatchers_test: SkipByDesign # SIMDBC interpreter doesn't support --no
io/web_socket_test: Pass, RuntimeError # Issue 26814.
[ $system == windows ]
io/skipping_dart2js_compilations_test: Skip # Issue 19551.
verbose_gc_to_bmu_test: Skip
io/process_sync_test: Pass, Timeout # Issue 24596
io/sleep_test: Pass, Fail # Issue 25757

3
pkg/test_runner/.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
# Dont commit the following files and directories created by pub.
.packages
pubspec.lock

View file

@ -0,0 +1,53 @@
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:test_runner/src/configuration.dart';
import 'package:test_runner/src/testing_servers.dart';
import 'package:test_runner/src/utils.dart';
import 'package:test_runner/src/vendored_pkg/args/args.dart';
void main(List<String> arguments) {
var parser = new ArgParser();
parser.addOption('port',
abbr: 'p',
help: 'The main server port we wish to respond to requests.',
defaultsTo: '0');
parser.addOption('crossOriginPort',
abbr: 'c',
help: 'A different port that accepts request from the main server port.',
defaultsTo: '0');
parser.addFlag('help',
abbr: 'h', negatable: false, help: 'Print this usage information.');
parser.addOption('build-directory', help: 'The build directory to use.');
parser.addOption('package-root', help: 'The package root to use.');
parser.addOption('packages', help: 'The package spec file to use.');
parser.addOption('network',
help: 'The network interface to use.', defaultsTo: '0.0.0.0');
parser.addFlag('csp',
help: 'Use Content Security Policy restrictions.', defaultsTo: false);
parser.addOption('runtime',
help: 'The runtime we are using (for csp flags).', defaultsTo: 'none');
var args = parser.parse(arguments);
if (args['help'] as bool) {
print(parser.getUsage());
} else {
var servers = new TestingServers(
args['build-directory'] as String,
args['csp'] as bool,
Runtime.find(args['runtime'] as String),
null,
args['package-root'] as String,
args['packages'] as String);
var port = int.parse(args['port'] as String);
var crossOriginPort = int.parse(args['crossOriginPort'] as String);
servers
.startServers(args['network'] as String,
port: port, crossOriginPort: crossOriginPort)
.then((_) {
DebugLogger.info('Server listening on port ${servers.port}');
DebugLogger.info('Server listening on port ${servers.crossOriginPort}');
});
}
}

View file

@ -10,8 +10,8 @@
* DARTBIN should be the checked in stable binary.
*/
import 'browser_controller.dart';
import 'configuration.dart';
import 'package:test_runner/src/browser_controller.dart';
import 'package:test_runner/src/configuration.dart';
void printHelp() {
print("Usage pattern:");

View file

@ -2,10 +2,10 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE.md file.
import 'configuration.dart';
import 'options.dart';
import 'repository.dart';
import 'test_configurations.dart';
import 'package:test_runner/src/configuration.dart';
import 'package:test_runner/src/options.dart';
import 'package:test_runner/src/repository.dart';
import 'package:test_runner/src/test_configurations.dart';
void main(List<String> arguments) {
Repository.uri = Uri.base;

View file

@ -21,8 +21,8 @@
///
/// The default test directory layout is documented in "test_suite.dart", above
/// `factory StandardTestSuite.forDirectory`.
import "options.dart";
import "test_configurations.dart";
import "package:test_runner/src/options.dart";
import "package:test_runner/src/test_configurations.dart";
/// Runs all of the tests specified by the given command line [arguments].
void main(List<String> arguments) {

View file

@ -23,7 +23,7 @@ String dart2jsHtml(String title, String scriptPath) {
<body>
<h1> Running $title </h1>
<script type="text/javascript"
src="/root_dart/tools/testing/dart/test_controller.js">
src="/root_dart/pkg/test_runner/lib/src/test_controller.js">
</script>
<script type="text/javascript" src="$scriptPath"
onerror="scriptTagOnErrorCallback(null)"
@ -152,7 +152,7 @@ String dartdevcHtml(String testName, String testJSDir, Compiler compiler) {
<body>
<h1>Running $testName</h1>
<script type="text/javascript"
src="/root_dart/tools/testing/dart/test_controller.js">
src="/root_dart/pkg/test_runner/lib/src/test_controller.js">
</script>
<script>
var require = {
@ -180,9 +180,9 @@ requirejs(["$testName", "dart_sdk", "async_helper"],
testErrorToStackTrace = function(error) {
var stackTrace = sdk.dart.stackTrace(error).toString();
var lines = stackTrace.split("\\n");
// Remove the first line, which is just "Error".
lines = lines.slice(1);
@ -193,7 +193,7 @@ requirejs(["$testName", "dart_sdk", "async_helper"],
break;
}
}
// TODO(rnystrom): It would be nice to shorten the URLs of the remaining
// lines too.
return lines.join("\\n");

View file

@ -502,7 +502,7 @@ class BrowserTestCommand extends Command {
String get reproductionCommand {
var parts = [
io.Platform.resolvedExecutable,
'tools/testing/dart/launch_browser.dart',
'pkg/test_runner/bin/launch_browser.dart',
browser.name,
url
];

View file

@ -13,7 +13,7 @@ import 'browser_controller.dart';
import 'command.dart';
import 'configuration.dart';
import 'test_progress.dart';
import 'test_runner.dart';
import 'test_case.dart';
import 'utils.dart';
/// CommandOutput records the output of a completed command: the process's exit

View file

@ -516,7 +516,7 @@ class Dart2jsCompilerConfiguration extends Dart2xCompilerConfiguration {
Command computeBabelCommand(String input, String output, String options) {
var uri = Repository.uri;
var babelTransform =
uri.resolve('tools/testing/dart/babel_transform.js').toFilePath();
uri.resolve('pkg/test_runner/lib/src/babel_transform.js').toFilePath();
var babelStandalone =
uri.resolve('third_party/babel/babel.min.js').toFilePath();
return Command.compilation(

View file

@ -10,10 +10,10 @@ import 'package:smith/smith.dart';
export 'package:smith/smith.dart';
import 'compiler_configuration.dart';
import 'http_server.dart';
import 'path.dart';
import 'repository.dart';
import 'runtime_configuration.dart';
import 'testing_servers.dart';
/// All of the contextual information to determine how a test suite should be
/// run.

View file

@ -90,10 +90,6 @@ final _multitestOutcomes = [
'checked mode compile-time error' // This is now a no-op
].toSet();
// Note: This function is called directly by:
//
// tests/compiler/dart2js/frontend_checker.dart
// tools/status_clean.dart
void extractTestsFromMultitest(Path filePath, Map<String, String> tests,
Map<String, Set<String>> outcomes) {
var contents = new File(filePath.toNativePath()).readAsStringSync();

View file

@ -181,8 +181,8 @@ test options, specifying how tests should be run.''',
new _Option.bool(
'use_blobs', 'Use mmap instead of shared libraries for precompilation.',
hide: true),
new _Option.bool(
'use_elf', 'Directly generate an ELF shared libraries for precompilation.',
new _Option.bool('use_elf',
'Directly generate an ELF shared libraries for precompilation.',
hide: true),
new _Option.bool('keep_generated_files', 'Keep any generated files.',
abbr: 'k'),

View file

@ -6,7 +6,7 @@ library summary_report;
import "package:status_file/expectation.dart";
import "test_runner.dart";
import "test_case.dart";
final summaryReport = new SummaryReport();

View file

@ -12,7 +12,7 @@ import 'co19_test_config.dart';
import 'configuration.dart';
import 'path.dart';
import 'test_progress.dart';
import 'test_runner.dart';
import 'test_case.dart';
import 'test_suite.dart';
import 'utils.dart';

View file

@ -251,7 +251,7 @@ window.addEventListener('DOMContentLoaded', onLoad, false);
// Note: before renaming this function, note that it is also included in an
// inlined error handler in generated HTML files, and manually in tests that
// include an HTML file.
// See: tools/testing/dart/browser_test.dart
// See: pkg/test_runner/lib/src/browser.dart
function scriptTagOnErrorCallback(e) {
var message = e && e.message;
recordEvent('script_onerror', 'script.onError called: ' + message);

View file

@ -13,7 +13,7 @@ import 'command_output.dart';
import 'configuration.dart';
import 'path.dart';
import 'summary_report.dart';
import 'test_runner.dart';
import 'test_case.dart';
import 'utils.dart';
/// Controls how message strings are processed before being displayed.

View file

@ -18,18 +18,18 @@ import 'dart:math';
import "package:status_file/expectation.dart";
import 'browser_test.dart';
import 'browser.dart';
import 'command.dart';
import 'compiler_configuration.dart';
import 'configuration.dart';
import 'expectation_set.dart';
import 'http_server.dart';
import 'multitest.dart';
import 'path.dart';
import 'repository.dart';
import 'summary_report.dart';
import 'test_case.dart';
import 'test_configurations.dart';
import 'test_runner.dart';
import 'testing_servers.dart';
import 'utils.dart';
RegExp multiHtmlTestGroupRegExp = new RegExp(r"\s*[^/]\s*group\('[^,']*");

View file

@ -8,10 +8,9 @@ import 'dart:io';
import 'package:package_resolver/package_resolver.dart';
import 'configuration.dart';
import 'repository.dart';
import 'utils.dart';
import 'vendored_pkg/args/args.dart';
import 'package:test_runner/src/configuration.dart';
import 'package:test_runner/src/repository.dart';
import 'package:test_runner/src/utils.dart';
class DispatchingServer {
HttpServer server;
@ -61,52 +60,6 @@ class DispatchingServer {
const PREFIX_BUILDDIR = 'root_build';
const PREFIX_DARTDIR = 'root_dart';
void main(List<String> arguments) {
/** Convenience method for local testing. */
var parser = new ArgParser();
parser.addOption('port',
abbr: 'p',
help: 'The main server port we wish to respond to requests.',
defaultsTo: '0');
parser.addOption('crossOriginPort',
abbr: 'c',
help: 'A different port that accepts request from the main server port.',
defaultsTo: '0');
parser.addFlag('help',
abbr: 'h', negatable: false, help: 'Print this usage information.');
parser.addOption('build-directory', help: 'The build directory to use.');
parser.addOption('package-root', help: 'The package root to use.');
parser.addOption('packages', help: 'The package spec file to use.');
parser.addOption('network',
help: 'The network interface to use.', defaultsTo: '0.0.0.0');
parser.addFlag('csp',
help: 'Use Content Security Policy restrictions.', defaultsTo: false);
parser.addOption('runtime',
help: 'The runtime we are using (for csp flags).', defaultsTo: 'none');
var args = parser.parse(arguments);
if (args['help'] as bool) {
print(parser.getUsage());
} else {
var servers = new TestingServers(
args['build-directory'] as String,
args['csp'] as bool,
Runtime.find(args['runtime'] as String),
null,
args['package-root'] as String,
args['packages'] as String);
var port = int.parse(args['port'] as String);
var crossOriginPort = int.parse(args['crossOriginPort'] as String);
servers
.startServers(args['network'] as String,
port: port, crossOriginPort: crossOriginPort)
.then((_) {
DebugLogger.info('Server listening on port ${servers.port}');
DebugLogger.info('Server listening on port ${servers.crossOriginPort}');
});
}
}
/**
* Runs a set of servers that are initialized specifically for the needs of our
* test framework, such as dealing with package-root.
@ -186,7 +139,7 @@ class TestingServers {
/// Gets the command line string to spawn the server.
String get commandLine {
var dart = Platform.resolvedExecutable;
var script = _dartDirectory.resolve('tools/testing/dart/http_server.dart');
var script = _dartDirectory.resolve('pkg/test_runner/bin/http_server.dart');
var buildDirectory = _buildDirectory.toFilePath();
var command = [

View file

@ -513,10 +513,10 @@ class TestUtils {
"tests_co19_src_WebPlatformTest_html-templates_parsing-html-"
"templates_appending-to-a-template_": "co19_htmltemplates_append_",
"tests_co19_src_WebPlatformTest_html-templates_parsing-html-"
"templates_clearing-the-stack-back-to-a-given-context_":
"templates_clearing-the-stack-back-to-a-given-context_":
"co19_htmltemplates_clearstack_",
"tests_co19_src_WebPlatformTest_html-templates_parsing-html-"
"templates_creating-an-element-for-the-token_":
"templates_creating-an-element-for-the-token_":
"co19_htmltemplates_create_",
"tests_co19_src_WebPlatformTest_html-templates_template-element"
"_template-": "co19_htmltemplates_element-",

View file

@ -0,0 +1,17 @@
# Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
name: test_runner
publish_to: none
environment:
sdk: "^2.3.0"
dependencies:
expect:
path: ../expect
package_resolver:
path: ../../third_party/pkg_tested/package_resolver
smith:
path: ../smith
status_file:
path: ../status_file

View file

@ -4,7 +4,7 @@
import 'package:expect/expect.dart';
import '../../../tools/testing/dart/dependency_graph.dart';
import 'package:test_runner/src/dependency_graph.dart';
main() {
var graph = new Graph<int>();
@ -45,7 +45,7 @@ main() {
});
}
var node1, node2, node3;
Node<int> node1, node2, node3;
node1 = newNode(1, []);
changeState(node1, NodeState.processing);

View file

@ -16,14 +16,16 @@
* output (+deps file), dart application)
*/
import 'package:expect/expect.dart';
import 'dart:async';
import 'dart:io';
import '../../../tools/testing/dart/command.dart';
import '../../../tools/testing/dart/command_output.dart';
import '../../../tools/testing/dart/path.dart';
import '../../../tools/testing/dart/repository.dart';
import '../../../tools/testing/dart/test_runner.dart' as runner;
import 'package:expect/expect.dart';
import 'package:test_runner/src/command.dart';
import 'package:test_runner/src/command_output.dart';
import 'package:test_runner/src/path.dart';
import 'package:test_runner/src/repository.dart';
import 'package:test_runner/src/test_case.dart';
/**
* This class is reponsible for setting up the files necessary for this test
@ -159,7 +161,7 @@ Command makeCompilationCommand(String testName, FileUtils fileUtils) {
}
void main() {
// This script is in [sdk]/tests/standalone/io.
// This script is in [sdk]/pkg/test_runner/test.
Repository.uri = Platform.script.resolve('../../..');
var fs_noTestJs = new FileUtils(
@ -214,8 +216,8 @@ void main() {
Future runTest(String name, FileUtils fileUtils, bool shouldRun) {
var completedHandler = new CommandCompletedHandler(fileUtils, shouldRun);
var command = makeCompilationCommand(name, fileUtils);
var process = new runner.RunningProcess(command, 60);
var command = makeCompilationCommand(name, fileUtils) as ProcessCommand;
var process = new RunningProcess(command, 60);
return process.run().then((CommandOutput output) {
completedHandler.processCompletedTest(output);
});

View file

@ -2,19 +2,22 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(rnystrom): This test is only run by the analyzer and front end
// configurations, so nothing is actually *executing* it. It's likely broken.
// We should either remove it or get it working again.
import "dart:io";
import "dart:async";
import "package:status_file/expectation.dart";
import "../../../tools/testing/dart/command.dart";
import "../../../tools/testing/dart/configuration.dart";
import "../../../tools/testing/dart/options.dart";
import "../../../tools/testing/dart/repository.dart";
import "../../../tools/testing/dart/test_runner.dart";
import "../../../tools/testing/dart/test_suite.dart";
import "../../../tools/testing/dart/test_progress.dart" as progress;
import "process_test_util.dart";
import "package:test_runner/src/command.dart";
import "package:test_runner/src/configuration.dart";
import "package:test_runner/src/options.dart";
import "package:test_runner/src/repository.dart";
import "package:test_runner/src/test_case.dart";
import "package:test_runner/src/test_suite.dart";
import "package:test_runner/src/test_progress.dart" as progress;
final DEFAULT_TIMEOUT = 20;
final LONG_TIMEOUT = 30;
@ -74,7 +77,7 @@ class CustomTestSuite extends TestSuite {
: super(configuration, "CustomTestSuite", []);
Future forEachTest(TestCaseEvent onTest, Map testCache, [onDone]) async {
void enqueueTestCase(testCase) {
void enqueueTestCase(TestCase testCase) {
TestController.numTests++;
onTest(testCase);
}
@ -97,14 +100,15 @@ class CustomTestSuite extends TestSuite {
}
}
TestCase _makeNormalTestCase(name, expectations) {
TestCase _makeNormalTestCase(
String name, Iterable<Expectation> expectations) {
var args = packageOptions();
args.addAll([Platform.script.toFilePath(), name]);
var command = Command.process('custom', Platform.executable, args, {});
return _makeTestCase(name, DEFAULT_TIMEOUT, command, expectations);
}
_makeCrashTestCase(name, expectations) {
TestCase _makeCrashTestCase(String name, Iterable<Expectation> expectations) {
var crashCommand = Command.process(
'custom_crash', getProcessTestFileName(), ["0", "0", "1", "1"], {});
// The crash test sometimes times out. Run it with a large timeout
@ -115,7 +119,8 @@ class CustomTestSuite extends TestSuite {
return _makeTestCase(name, LONG_TIMEOUT, crashCommand, expectations);
}
_makeTestCase(name, timeout, command, expectations) {
TestCase _makeTestCase(String name, timeout, Command command,
Iterable<Expectation> expectations) {
var configuration = new OptionsParser().parse(['--timeout', '$timeout'])[0];
return new TestCase(name, [command], configuration,
new Set<Expectation>.from(expectations));
@ -167,3 +172,18 @@ void main(List<String> arguments) {
}
}
}
String getPlatformExecutableExtension() {
var os = Platform.operatingSystem;
if (os == 'windows') return '.exe';
return ''; // Linux and Mac OS.
}
String getProcessTestFileName() {
var extension = getPlatformExecutableExtension();
var executable = Platform.executable;
var dirIndex = executable.lastIndexOf('dart');
var buffer = new StringBuffer(executable.substring(0, dirIndex));
buffer.write('process_test$extension');
return buffer.toString();
}

View file

@ -10,10 +10,10 @@
/// co19.
///
/// Usage:
/// [: dart tools/testing/dart/co19_test.dart :]
import 'configuration.dart';
import 'options.dart';
import 'test_configurations.dart';
/// [: dart pkg/test_runner/tool/co19.dart :]
import 'package:test_runner/src/configuration.dart';
import 'package:test_runner/src/options.dart';
import 'package:test_runner/src/test_configurations.dart';
const List<String> COMMON_ARGUMENTS = const <String>[
'--report',

View file

@ -52,7 +52,7 @@ class TestDart extends Suite {
}
List<String> processedArguments = <String>[];
processedArguments.add(Uri.base
.resolve("tools/testing/dart/package_testing_support.dart")
.resolve("pkg/test_runner/bin/package_testing_support.dart")
.toFilePath());
for (String commandLine in commandLines) {
String arguments = common;

View file

@ -124,9 +124,9 @@ For quick investigation you can do
Implementation of crash dump archiving consists of two parts:
* Code in the testing framework (`UnexpectedCrashLogger` in
`tools/testing/dart/test_progress.dart`) that detects unexpected crashes, that
is situations when test _unexpectedly_ completes with a `Crash` status. In this
case it logs a line about this crash into `unexpected-crashes` file in the
`pkg/test_runner/lib/src/test_progress.dart`) that detects unexpected crashes,
that is situations when test _unexpectedly_ completes with a `Crash` status. In
this case it logs a line about this crash into `unexpected-crashes` file in the
root of the SDK checkout. This line has format `test,pid,binary` and identifies
which test crashed, what was the process id and which binary crashed.
* Code in the Python wrapper around testing framework (see `CoreDumpArchiver`
@ -202,7 +202,7 @@ See `WindowsCoreDumpEnabler` and `WindowsCoreDumpArchiver` in `tools/utils.py`.
**Note: `DART_CRASHPAD_CRASHES_DIR` is set by `WindowsCoreDumpEnabler` in
`tools/utils.py`, while `DART_CRASHPAD_HANDLER` is set by `TestSuite` in
`tools/testing/dart/test_suite.dart`.**
`pkg/test_runner/lib/src/test_suite.dart`.**
**Note: Crashpad is optimized for end-user crash reporting use case and does not write full crash dumps.**

View file

@ -22,7 +22,7 @@ See comments above
in
../tools/testing/dart/test_suite.dart
../pkg/test_runner/lib/src/test_suite.dart
for the default test directory layout. By default test-file names must
end in "_test.dart", but some test suites, such as ./co19, subclass
@ -30,13 +30,13 @@ StandardTestSuite and override this default.
See comments at the beginning of
../tools/testing/dart/multitest.dart
../pkg/test_runner/lib/src/multitest.dart
for how to create tests that pass by failing with a known error. For
example,
...
int x = "not an int"; /// 01: static type warning
int x = "not an int"; //# 01: static type warning
...
as part of a test will only pass the "--compiler dart2analyzer" test if

View file

@ -16,7 +16,7 @@
<body>
<h1> Running attribute_changed_callback_test </h1>
<script type="text/javascript"
src="/root_dart/tools/testing/dart/test_controller.js"></script>
src="/root_dart/pkg/test_runner/lib/src/test_controller.js"></script>
%TEST_SCRIPTS%
</body>
</html>

View file

@ -16,7 +16,7 @@
<body>
<h1> Running entered_left_view_test </h1>
<script type="text/javascript"
src="/root_dart/tools/testing/dart/test_controller.js"></script>
src="/root_dart/pkg/test_runner/lib/src/test_controller.js"></script>
%TEST_SCRIPTS%
</body>
</html>

View file

@ -16,7 +16,7 @@
<body>
<h1> Running created_callback_test </h1>
<script type="text/javascript"
src="/root_dart/tools/testing/dart/test_controller.js"></script>
src="/root_dart/pkg/test_runner/lib/src/test_controller.js"></script>
%TEST_SCRIPTS%
</body>
</html>

View file

@ -16,7 +16,7 @@
<body>
<h1> Running document_register_basic_test </h1>
<script type="text/javascript"
src="/root_dart/tools/testing/dart/test_controller.js"></script>
src="/root_dart/pkg/test_runner/lib/src/test_controller.js"></script>
%TEST_SCRIPTS%
</body>
</html>

View file

@ -16,7 +16,7 @@
<body>
<h1> Running document_register_basic_test </h1>
<script type="text/javascript"
src="/root_dart/tools/testing/dart/test_controller.js"></script>
src="/root_dart/pkg/test_runner/lib/src/test_controller.js"></script>
%TEST_SCRIPTS%
</body>
</html>

View file

@ -16,7 +16,7 @@
<body>
<h1> Running document_register_type_extensions_test </h1>
<script type="text/javascript"
src="/root_dart/tools/testing/dart/test_controller.js"></script>
src="/root_dart/pkg/test_runner/lib/src/test_controller.js"></script>
%TEST_SCRIPTS%
</body>
</html>

View file

@ -44,6 +44,6 @@ function validateIsFoo(element) {
</script>
<script type="text/javascript"
src="/root_dart/tools/testing/dart/test_controller.js"></script>
src="/root_dart/pkg/test_runner/lib/src/test_controller.js"></script>
%TEST_SCRIPTS%
</body>

View file

@ -16,7 +16,7 @@
<body>
<h1> Running entered_left_view_test </h1>
<script type="text/javascript"
src="/root_dart/tools/testing/dart/test_controller.js"></script>
src="/root_dart/pkg/test_runner/lib/src/test_controller.js"></script>
%TEST_SCRIPTS%
</body>
</html>

View file

@ -16,7 +16,7 @@
<body>
<h1> Running js_custom_test </h1>
<script type="text/javascript"
src="/root_dart/tools/testing/dart/test_controller.js"></script>
src="/root_dart/pkg/test_runner/lib/src/test_controller.js"></script>
%TEST_SCRIPTS%
</body>
</html>

View file

@ -16,7 +16,7 @@
<body>
<h1> Running mirrors_2_test </h1>
<script type="text/javascript"
src="/root_dart/tools/testing/dart/test_controller.js"></script>
src="/root_dart/pkg/test_runner/lib/src/test_controller.js"></script>
%TEST_SCRIPTS%
</body>
</html>

View file

@ -16,7 +16,7 @@
<body>
<h1> Running mirrors_test </h1>
<script type="text/javascript"
src="/root_dart/tools/testing/dart/test_controller.js"></script>
src="/root_dart/pkg/test_runner/lib/src/test_controller.js"></script>
%TEST_SCRIPTS%
</body>
</html>

View file

@ -16,7 +16,7 @@
<body>
<h1> Running custom_element_method_clash_test </h1>
<script type="text/javascript"
src="/root_dart/tools/testing/dart/test_controller.js"></script>
src="/root_dart/pkg/test_runner/lib/src/test_controller.js"></script>
%TEST_SCRIPTS%
</body>
</html>

View file

@ -16,7 +16,7 @@
<body>
<h1> Running custom_element_name_clash_test </h1>
<script type="text/javascript"
src="/root_dart/tools/testing/dart/test_controller.js"></script>
src="/root_dart/pkg/test_runner/lib/src/test_controller.js"></script>
%TEST_SCRIPTS%
</body>
</html>

View file

@ -16,7 +16,7 @@
<body>
<h1> Running custom_elements_23127_test </h1>
<script type="text/javascript"
src="/root_dart/tools/testing/dart/test_controller.js"></script>
src="/root_dart/pkg/test_runner/lib/src/test_controller.js"></script>
%TEST_SCRIPTS%
</body>
</html>

View file

@ -16,7 +16,7 @@
<body>
<h1> Running custom_elements_test </h1>
<script type="text/javascript"
src="/root_dart/tools/testing/dart/test_controller.js"></script>
src="/root_dart/pkg/test_runner/lib/src/test_controller.js"></script>
%TEST_SCRIPTS%
</body>
</html>

View file

@ -21,7 +21,7 @@
<script type="text/javascript"
src="/root_dart/tests/lib_2/html/js_dispatch_property_test_js.js"></script>
<script type="text/javascript"
src="/root_dart/tools/testing/dart/test_controller.js"></script>
src="/root_dart/pkg/test_runner/lib/src/test_controller.js"></script>
%TEST_SCRIPTS%
</body>
</html>

View file

@ -16,7 +16,7 @@
<script type="text/javascript"
src="/root_dart/tests/html/js_interop_constructor_name_test_js.js"></script>
<script type="text/javascript"
src="/root_dart/tools/testing/dart/test_controller.js"></script>
src="/root_dart/pkg/test_runner/lib/src/test_controller.js"></script>
%TEST_SCRIPTS%
</body>
</html>

View file

@ -1,11 +0,0 @@
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import '../../../tools/testing/dart/main.dart' as test_dart;
import '../../../tools/testing/dart/launch_browser.dart' as launch_browser;
// The purpose of this test is to run the analyzer on it and make sure our
// testing scripts are free of warnings/errors.
void main() {}

View file

@ -1,34 +0,0 @@
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Simulates a use of test_progress during a failing run of test.dart.
import "dart:io";
import "../../../tools/testing/dart/test_progress.dart";
import "../../../tools/testing/dart/test_runner.dart";
import "../../../tools/testing/dart/test_options.dart";
main(List<String> arguments) {
var progressType = arguments[0];
// Build a progress indicator.
var startTime = new DateTime.now();
var progress = new ProgressIndicator.fromName(progressType, startTime, false);
if (progressType == 'buildbot') {
BuildbotProgressIndicator.stepName = 'myStepName';
}
// Build a dummy test case.
var configuration = new TestOptionsParser().parse(['--timeout', '2'])[0];
var dummyCommand = new Command("noop", []);
var testCase = new TestCase('failing_test.dart', [dummyCommand],
configuration, (_) => null, new Set<String>.from(['PASS']));
// Simulate the test.dart use of the progress indicator.
progress.testAdded();
progress.allTestsKnown();
progress.start(testCase);
new CommandOutput.fromCase(testCase, dummyCommand, 1, false, false, [], [],
new DateTime.now().difference(startTime), false);
progress.done(testCase);
progress.allDone();
}

View file

@ -134,7 +134,5 @@ io/addlatexhash_test: Pass, Crash # Issue 31252
io/many_directory_operations_test: SkipSlow
io/many_file_operations_test: SkipSlow
io/raw_datagram_read_all_test: Pass, Fail # Timing dependent.
io/skipping_dart2js_compilations_test: SkipSlow
io/test_runner_test: SkipSlow
package/*: SkipByDesign # Launches VMs in interesting ways.
typed_data_isolate_test: SkipSlow

View file

@ -39,7 +39,6 @@ no_lazy_dispatchers_test: SkipByDesign # KBC interpreter doesn't support --no_la
[ $compiler == dartkp ]
io/arguments_test: Fail # Test harness passes runtime arguments to the compiler
io/test_runner_test: SkipByDesign # Is not relevant for AOT.
[ $system == android ]
entrypoints_verification_test: Skip # Requires shared objects which the test script doesn't "adb push".
@ -73,7 +72,6 @@ map_insert_remove_oom_test: Skip # Heap limit too low.
[ $compiler == dartkp && $mode == debug && $runtime == dart_precompiled ]
io/raw_socket_test: Crash
io/skipping_dart2js_compilations_test: Crash
io/socket_exception_test: Pass, Crash
io/socket_finalizer_test: Pass, Crash
io/socket_info_ipv4_test: Pass, Crash

View file

@ -43,7 +43,6 @@ io/regress_7191_test: Skip
io/regress_7679_test: Skip
io/secure_unauthorized_test: Skip
io/signals_test: Skip
io/skipping_dart2js_compilations_test: RuntimeError # Issue 30008
io/stdin_sync_test: Skip
io/stdio_implicit_close_test: Skip
io/stdio_nonblocking_test: Skip
@ -60,7 +59,6 @@ dwarf_stack_trace_test: Pass, RuntimeError # Results will flake due to identical
[ $runtime == dart_precompiled && $checked ]
io/namespace_test: RuntimeError
io/test_runner_test: RuntimeError
[ $compiler == app_jit || $compiler == precompiler ]
io/compile_all_test: Skip # Incompatible flag --compile_all

View file

@ -18,12 +18,8 @@ io/platform_resolved_executable_test/05: RuntimeError # Issue 33168
io/platform_test: Skip # Platform.executable
io/test_extension_fail_test: Skip # Platform.executable
io/test_extension_test: Skip # Platform.executable
io/test_runner_test: RuntimeError # Issue 33168
regress_26031_test: Skip # Platform.resolvedExecutable
[ $runtime == vm ]
io/test_runner_test: Skip # Spawns a process which runs in Dart2 mode.
[ $system == android ]
io/file_stat_test: Skip # Issue 26376
io/file_system_watcher_test: Skip # Issue 26376
@ -58,7 +54,6 @@ io/socket_upgrade_to_secure_test: Skip # Issue 27638
[ $system == windows ]
io/process_sync_test: Pass, Timeout # Issue 24596
io/skipping_dart2js_compilations_test: Skip # Issue 19551.
io/sleep_test: Pass, Fail # Issue 25757
io/socket_info_ipv6_test: Skip
verbose_gc_to_bmu_test: Skip
@ -99,7 +94,6 @@ io/process_sync_test: Timeout, Pass
io/dart_std_io_pipe_test: Timeout, Pass
io/http_client_stays_alive_test: Skip # Spawns process in Dart2 mode.
io/process_sync_test: Timeout, Pass
io/skipping_dart2js_compilations_test: Skip # Spawns process in Dart2 mode.
[ $arch == simdbc || $arch == simdbc64 ]
full_coverage_test: Skip # TODO(vegorov) SIMDBC interpreter doesn't support coverage yet.

View file

@ -192,6 +192,7 @@
"pkg/pkg.status",
"pkg/smith/",
"pkg/status_file/",
"pkg/test_runner/",
"pkg/vm/",
"runtime/",
"sdk/",
@ -1777,6 +1778,11 @@
"script": "out/ReleaseX64/dart-sdk/bin/dartanalyzer",
"arguments": ["--fatal-warnings", "pkg/telemetry"]
},
{
"name": "analyze pkg/test_runner",
"script": "out/ReleaseX64/dart-sdk/bin/dartanalyzer",
"arguments": ["--fatal-warnings", "pkg/test_runner"]
},
{
"name": "analyze pkg/testing",
"script": "out/ReleaseX64/dart-sdk/bin/dartanalyzer",
@ -1801,12 +1807,6 @@
"script": "out/ReleaseX64/dart-sdk/bin/dartanalyzer",
"arguments": ["--fatal-warnings", "tools/gardening"]
},
{
"name": "analyze tools/testing/dart",
"script": "out/ReleaseX64/dart-sdk/bin/dartanalyzer",
"arguments": ["--fatal-warnings", "tools/testing/dart"]
},
{
"name": "dartanalyzer --batch tests",
"arguments": [

View file

@ -1,419 +0,0 @@
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
library status_clean;
import "dart:async";
import "dart:convert" show json, utf8;
import "dart:io";
import "testing/dart/multitest.dart";
import "testing/dart/status_file_parser.dart";
import "testing/dart/test_suite.dart"
show
multiHtmlTestGroupRegExp,
multiTestRegExp,
multiHtmlTestRegExp,
TestUtils;
import "testing/dart/utils.dart" show Path;
// [STATUS_TUPLES] is a list of (suite-name, directory, status-file)-tuples.
final STATUS_TUPLES = [
["corelib_2", "tests/corelib_2", "tests/corelib_2/corelib_2.status"],
["standalone", "tests/standalone", "tests/standalone/standalone.status"],
["pkg", "pkg", "pkg/pkg.status"],
["utils", "tests/utils", "tests/utils/utils.status"],
["samples", "samples", "samples/samples.status"],
["analyze_library", "sdk", "tests/lib_2/analyzer/analyze_library.status"],
[
"dart2js_extra",
"tests/compiler/dart2js_extra",
"tests/compiler/dart2js_extra/dart2js_extra.status"
],
[
"dart2js_native",
"tests/compiler/dart2js_native",
"tests/compiler/dart2js_native/dart2js_native.status"
],
[
"dart2js",
"tests/compiler/dart2js",
"tests/compiler/dart2js/dart2js.status"
],
[
"benchmark_smoke",
"tests/benchmark_smoke",
"tests/benchmark_smoke/benchmark_smoke.status"
],
];
void main(List<String> args) {
TestUtils.setDartDirUri(Platform.script.resolve('..'));
usage() {
print("Usage: ${Platform.executable} <deflake|remove-nonexistent-tests>");
exit(1);
}
if (args.length == 0) usage();
if (args[0] == 'deflake') {
run(new StatusFileDeflaker());
} else if (args[0] == 'remove-nonexistent-tests') {
run(new StatusFileNonExistentTestRemover());
} else {
usage();
}
}
run(StatusFileProcessor processor) {
Future.forEach(STATUS_TUPLES, (List tuple) {
String suiteName = tuple[0];
String directory = tuple[1];
String filePath = tuple[2];
print("Processing $filePath");
return processor.run(suiteName, directory, filePath);
});
}
abstract class StatusFileProcessor {
Future run(String suiteName, String directory, String filePath);
Future<List<Section>> _readSections(String filePath) {
File file = new File(filePath);
if (file.existsSync()) {
var completer = new Completer();
List<Section> sections = new List<Section>();
ReadConfigurationInto(new Path(file.path), sections, () {
completer.complete(sections);
});
return completer.future;
}
return new Future.value([]);
}
}
class StatusFileNonExistentTestRemover extends StatusFileProcessor {
final MultiTestDetector multiTestDetector = new MultiTestDetector();
final TestFileLister testFileLister = new TestFileLister();
Future run(String suiteName, String directory, String filePath) {
return _readSections(filePath).then((List<Section> sections) {
Set<int> invalidLines = _analyzeStatusFile(directory, filePath, sections);
if (invalidLines.length > 0) {
return _writeFixedStatusFile(filePath, invalidLines);
}
return new Future.value();
});
}
bool _testExists(String filePath, List<String> testFiles, String directory,
TestRule rule) {
// TODO: Unify this regular expression matching with status_file_parser.dart
List<RegExp> getRuleRegex(String name) {
return name
.split("/")
.map((name) => new RegExp(name.replaceAll('*', '.*')))
.toList();
}
bool matchRegexp(List<RegExp> patterns, String str) {
var parts = str.split("/");
if (patterns.length > parts.length) {
return false;
}
// NOTE: patterns.length <= parts.length
for (var i = 0; i < patterns.length; i++) {
if (!patterns[i].hasMatch(parts[i])) {
return false;
}
}
return true;
}
var rulePattern = getRuleRegex(rule.name);
return testFiles.any((String file) {
// TODO: Use test_suite.dart's [buildTestCaseDisplayName] instead.
var filePath = new Path(file).relativeTo(new Path(directory));
String baseTestName = _concat(
"${filePath.directoryPath}", "${filePath.filenameWithoutExtension}");
List<String> testNames = [];
for (var name in multiTestDetector.getMultitestNames(file)) {
testNames.add(_concat(baseTestName, name));
}
// If it is not a multitest the testname is [baseTestName]
if (testNames.isEmpty) {
testNames.add(baseTestName);
}
return testNames
.any((String testName) => matchRegexp(rulePattern, testName));
});
}
Set<int> _analyzeStatusFile(
String directory, String filePath, List<Section> sections) {
var invalidLines = new Set<int>();
var dartFiles = testFileLister.listTestFiles(directory);
for (var section in sections) {
for (var rule in section.testRules) {
if (!_testExists(filePath, dartFiles, directory, rule)) {
print("Invalid rule: ${rule.name} in file "
"$filePath:${rule.lineNumber}");
invalidLines.add(rule.lineNumber);
}
}
}
return invalidLines;
}
_writeFixedStatusFile(String statusFilePath, Set<int> invalidLines) {
var lines = new File(statusFilePath).readAsLinesSync();
var outputLines = <String>[];
for (int i = 0; i < lines.length; i++) {
// The status file parser numbers lines starting with 1, not 0.
if (!invalidLines.contains(i + 1)) {
outputLines.add(lines[i]);
}
}
var outputFile = new File("$statusFilePath.fixed");
outputFile.writeAsStringSync(outputLines.join("\n"));
}
String _concat(String base, String part) {
if (base == "") return part;
if (part == "") return base;
return "$base/$part";
}
}
class StatusFileDeflaker extends StatusFileProcessor {
TestOutcomeFetcher _testOutcomeFetcher = new TestOutcomeFetcher();
Future run(String suiteName, String directory, String filePath) {
return _readSections(filePath).then((List<Section> sections) {
return _generatedDeflakedLines(suiteName, sections)
.then((Map<int, String> fixedLines) {
if (fixedLines.length > 0) {
return _writeFixedStatusFile(filePath, fixedLines);
}
});
});
}
Future _generatedDeflakedLines(String suiteName, List<Section> sections) {
var fixedLines = new Map<int, String>();
return Future.forEach(sections, (Section section) {
return Future.forEach(section.testRules, (rule) {
return _maybeFixStatusfileLine(suiteName, section, rule, fixedLines);
});
}).then((_) => fixedLines);
}
Future _maybeFixStatusfileLine(String suiteName, Section section,
TestRule rule, Map<int, String> fixedLines) {
print("Processing ${section.statusFile.location}: ${rule.lineNumber}");
// None of our status file lines have expressions, so we pass {} here.
var notedOutcomes = rule.expression
.evaluate({})
.map((name) => Expectation.byName(name))
.where((Expectation expectation) => !expectation.isMetaExpectation)
.toSet();
if (notedOutcomes.isEmpty) return new Future.value();
// TODO: [rule.name] is actually a pattern not just a testname. We should
// find all possible testnames this rule matches against and unify the
// outcomes of these tests.
return _testOutcomeFetcher
.outcomesOf(suiteName, section, rule.name)
.then((Set<Expectation> actualOutcomes) {
var outcomesThatNeverHappened = new Set<Expectation>();
for (Expectation notedOutcome in notedOutcomes) {
bool found = false;
for (Expectation actualOutcome in actualOutcomes) {
if (actualOutcome.canBeOutcomeOf(notedOutcome)) {
found = true;
break;
}
}
if (!found) {
outcomesThatNeverHappened.add(notedOutcome);
}
}
if (outcomesThatNeverHappened.length > 0 && actualOutcomes.length > 0) {
// Print the change to stdout.
print("${rule.name} "
"(${section.statusFile.location}:${rule.lineNumber}):");
print(" Actual outcomes: ${actualOutcomes.toList()}");
print(" Outcomes in status file: ${notedOutcomes.toList()}");
print(" Outcomes in status file that never happened : "
"${outcomesThatNeverHappened.toList()}\n");
// Build the fixed status file line.
fixedLines[rule.lineNumber] =
'${rule.name}: ${actualOutcomes.join(', ')} '
'# before: ${notedOutcomes.join(', ')} / '
'never happened: ${outcomesThatNeverHappened.join(', ')}';
}
});
}
_writeFixedStatusFile(String filePath, Map<int, String> fixedLines) {
var lines = new File(filePath).readAsLinesSync();
var outputLines = <String>[];
for (int i = 0; i < lines.length; i++) {
if (fixedLines.containsKey(i + 1)) {
outputLines.add(fixedLines[i + 1]);
} else {
outputLines.add(lines[i]);
}
}
var output = outputLines.join("\n");
var outputFile = new File("$filePath.deflaked");
outputFile.writeAsStringSync(output);
}
}
class MultiTestDetector {
final multiTestsCache = new Map<String, List<String>>();
final multiHtmlTestsCache = new Map<String, List<String>>();
List<String> getMultitestNames(String file) {
List<String> names = [];
names.addAll(getStandardMultitestNames(file));
names.addAll(getHtmlMultitestNames(file));
return names;
}
List<String> getStandardMultitestNames(String file) {
return multiTestsCache.putIfAbsent(file, () {
try {
var tests = new Map<String, String>();
var outcomes = new Map<String, Set<String>>();
if (multiTestRegExp.hasMatch(new File(file).readAsStringSync())) {
extractTestsFromMultitest(new Path(file), tests, outcomes);
}
return tests.keys.toList();
} catch (error) {
print("WARNING: Couldn't determine multitests in file ${file}: $error");
return [];
}
});
}
List<String> getHtmlMultitestNames(String file) {
return multiHtmlTestsCache.putIfAbsent(file, () {
try {
List<String> subtestNames = [];
var content = new File(file).readAsStringSync();
if (multiHtmlTestRegExp.hasMatch(content)) {
var matchesIter =
multiHtmlTestGroupRegExp.allMatches(content).iterator;
while (matchesIter.moveNext()) {
String fullMatch = matchesIter.current.group(0);
subtestNames.add(fullMatch.substring(fullMatch.indexOf("'") + 1));
}
}
return subtestNames;
} catch (error) {
print("WARNING: Couldn't determine multitests in file ${file}: $error");
}
return [];
});
}
}
class TestFileLister {
final Map<String, List<String>> _filesCache = {};
List<String> listTestFiles(String directory) {
return _filesCache.putIfAbsent(directory, () {
var dir = new Directory(directory);
// Cannot test for _test.dart because co19 tests don't have that ending.
var dartFiles = dir
.listSync(recursive: true)
.where((fe) => fe is File)
.where((file) =>
file.path.endsWith(".dart") || file.path.endsWith("_test.html"))
.map((file) => file.path)
.toList();
return dartFiles;
});
}
}
/*
* [TestOutcomeFetcher] will fetch test results from a server using a REST-like
* interface.
*/
class TestOutcomeFetcher {
static String SERVER = '108.170.219.8';
static int PORT = 4540;
HttpClient _client = new HttpClient();
Future<Set<Expectation>> outcomesOf(
String suiteName, Section section, String testName) {
var pathComponents = [
'json',
'test-outcomes',
'outcomes',
Uri.encodeComponent("$suiteName/$testName")
];
var path = pathComponents.join('/') + '/';
var url = new Uri(scheme: 'http', host: SERVER, port: PORT, path: path);
return _client
.getUrl(url)
.then((HttpClientRequest request) => request.close())
.then((HttpClientResponse response) {
return response
.transform(utf8.decoder)
.transform(json.decoder)
.first
.then((List testResults) {
var setOfActualOutcomes = new Set<Expectation>();
try {
for (var result in testResults) {
var config = result['configuration'];
var testResult = result['test_result'];
var outcome = testResult['outcome'];
// These variables are derived variables and will be set in
// tools/testing/dart/test_options.dart.
// [Mostly due to the fact that we don't have an unary !
// operator in status file expressions.]
config['unchecked'] = !config['checked'];
config['unminified'] = !config['minified'];
config['nocsp'] = !config['csp'];
config['browser'] = TestUtils.isBrowserRuntime(config['runtime']);
config['analyzer'] =
TestUtils.isCommandLineAnalyzer(config['compiler']);
config['jscl'] =
TestUtils.isJsCommandLineRuntime(config['runtime']);
if (section.condition == null ||
section.condition.evaluate(config)) {
setOfActualOutcomes.add(Expectation.byName(outcome));
}
}
return setOfActualOutcomes;
} catch (error) {
print("Warning: Error occured while processing testoutcomes"
": $error");
return [];
}
}).catchError((error) {
print("Warning: Error occured while fetching testoutcomes: $error");
return [];
});
});
}
}

View file

@ -13,9 +13,11 @@ import utils
def Main():
args = sys.argv[1:]
tools_dir = os.path.dirname(os.path.realpath(__file__))
dart_test_script = string.join(
[tools_dir, 'testing', 'dart', 'main.dart'], os.sep)
repo_dir = os.path.dirname(tools_dir)
dart_test_script = os.path.join(
repo_dir, 'pkg', 'test_runner', 'bin', 'test_runner.dart')
command = [utils.CheckedInSdkExecutable(), dart_test_script] + args
# The testing script potentially needs the android platform tools in PATH so

View file

@ -1,3 +0,0 @@
analyzer:
strong-mode:
implicit-casts: false

View file

@ -1,7 +0,0 @@
# Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
# This file is only here that so certain Dart editors recognize this is a Dart
# project.
name: testing_tools

View file

@ -817,7 +817,8 @@ def TryUnlink(file):
class BaseCoreDumpArchiver(object):
"""This class reads coredumps file written by UnexpectedCrashDumpArchiver
into the current working directory and uploads all cores and binaries
listed in it into Cloud Storage (see tools/testing/dart/test_progress.dart).
listed in it into Cloud Storage (see
pkg/test_runner/lib/src/test_progress.dart).
"""
# test.dart will write a line for each unexpected crash into this file.