f3fe9dc3b3
This is a reland of 58860f4814
Original change's description:
> Improve handling of disable-dartdev-analytics
>
> This is second try of https://dart-review.googlesource.com/c/sdk/+/171284
> that was reverted to to faulty logic in main_options.
>
> Some other refactorings are piggy-backed along.
>
> TestProject.runSync no longer takes a 'command' argument. It was anyway
> often not an argument.
>
> Also stop the messy handling of pub arguments. It is no longer needed.
>
> BUG: https://github.com/dart-lang/sdk/issues/44135
> Change-Id: I49abf5810d9ea262409ba9d93f0471037cb8a753
> TEST=The VM change is tested via all the pkg/dartdev/test/command/* tests that invoke dart with the --no-analytics flag.
> TEST=Furthermore manual test that the --no-analytics flag is passed to dartdev.
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174261
> Reviewed-by: Jonas Jensen <jonasfj@google.com>
> Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Change-Id: I725662f578d061f87171ceffe9aff3de83688f58
TEST=Furthermore run the vm-kernel-precomp-obfuscate-linux-release-x64-try trybot
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174473
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
39 lines
1.3 KiB
Dart
39 lines
1.3 KiB
Dart
// Copyright (c) 2020, 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/test.dart';
|
|
|
|
import 'utils.dart';
|
|
|
|
void main() {
|
|
TestProject p;
|
|
|
|
tearDown(() => p?.dispose());
|
|
|
|
test('Ensure parsing fails after encountering invalid file', () {
|
|
// Regression test for https://github.com/dart-lang/sdk/issues/43991
|
|
p = project();
|
|
final noArgsResult = p.runSync(['foo.dart']);
|
|
expect(noArgsResult.stderr, isNotEmpty);
|
|
expect(noArgsResult.stdout, isEmpty);
|
|
expect(noArgsResult.exitCode, 64);
|
|
|
|
final argsResult = p.runSync(['foo.dart', '--bar']);
|
|
expect(argsResult.stderr, noArgsResult.stderr);
|
|
expect(argsResult.stdout, isEmpty);
|
|
expect(argsResult.exitCode, 64);
|
|
});
|
|
|
|
test('Providing --snapshot VM option with invalid script fails gracefully',
|
|
() {
|
|
// Regression test for https://github.com/dart-lang/sdk/issues/43785
|
|
p = project();
|
|
final result = p.runSync(['--snapshot=abc', 'foo.dart']);
|
|
expect(result.stderr, isNotEmpty);
|
|
expect(result.stderr, contains("Error when reading 'foo.dart':"));
|
|
expect(result.stdout, isEmpty);
|
|
expect(result.exitCode, 254);
|
|
});
|
|
}
|