Files
sdk/pkg/kernel/tool/smoke_test_quick.dart
T
Jens Johansen d69a2110ef [CFE] Remove old dill test, suit etc.
This is no longer necessary with the VM only supporting the latest
version and kernel (optionally) including a git-checksum to match up
VM and dills.

Change-Id: Ifccfd0d12333cd99258100cda30e1536cc230bc2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166024
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-10-05 12:52:49 +00:00

64 lines
2.1 KiB
Dart

// Copyright (c) 2019, 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 'dart:io';
final String repoDir = _computeRepoDir();
String get dartVm => Platform.executable;
main(List<String> args) async {
Stopwatch stopwatch = new Stopwatch()..start();
List<Future> futures = new List<Future>();
futures.add(run("pkg/front_end/test/spelling_test_src_suite.dart",
["--", "spelling_test_src/kernel/..."]));
await Future.wait(futures);
print("\n-----------------------\n");
print("Done with exitcode $exitCode in ${stopwatch.elapsedMilliseconds} ms");
}
Future<void> run(String script, List<String> scriptArguments,
{bool filter: true}) async {
List<String> arguments = [];
arguments.add("$script");
arguments.addAll(scriptArguments);
Stopwatch stopwatch = new Stopwatch()..start();
ProcessResult result =
await Process.run(dartVm, arguments, workingDirectory: repoDir);
String runWhat = "${dartVm} ${arguments.join(' ')}";
if (result.exitCode != 0) {
exitCode = result.exitCode;
print("-----");
print("Running: $runWhat: "
"Failed with exit code ${result.exitCode} "
"in ${stopwatch.elapsedMilliseconds} ms.");
String stdout = result.stdout.toString();
if (filter) {
List<String> lines = stdout.split("\n");
int lastIgnored = -1;
for (int i = 0; i < lines.length; i++) {
if (lines[i].startsWith("[ ")) lastIgnored = i;
}
lines.removeRange(0, lastIgnored + 1);
stdout = lines.join("\n");
}
stdout = stdout.trim();
if (stdout.isNotEmpty) {
print(stdout);
print("-----");
}
} else {
print("Running: $runWhat: Done in ${stopwatch.elapsedMilliseconds} ms.");
}
}
String _computeRepoDir() {
ProcessResult result = Process.runSync(
'git', ['rev-parse', '--show-toplevel'],
runInShell: true,
workingDirectory: new File.fromUri(Platform.script).parent.path);
return (result.stdout as String).trim();
}