d5da8dc67d
* Auto-dispose the TestProject (several instances were never disposed) * Don't rely on package:test by default from the test-project. Change-Id: I383eb36cbacb341b702f42075af562d20a2be45d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291069 Reviewed-by: Jonas Jensen <jonasfj@google.com> Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
55 lines
1.3 KiB
Dart
55 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 'dart:io' as io;
|
|
|
|
import 'package:cli_util/cli_logging.dart';
|
|
import 'package:dartdev/src/analysis_server.dart';
|
|
import 'package:dartdev/src/core.dart';
|
|
import 'package:dartdev/src/sdk.dart';
|
|
import 'package:test/test.dart';
|
|
|
|
import 'utils.dart';
|
|
|
|
void main() {
|
|
group('AnalysisServer', () {
|
|
late TestProject p;
|
|
|
|
setUp(() {
|
|
log = Logger.standard();
|
|
p = project();
|
|
});
|
|
|
|
test('can start', () async {
|
|
AnalysisServer server = AnalysisServer(
|
|
null,
|
|
io.Directory(sdk.sdkPath),
|
|
[p.dir],
|
|
commandName: 'testing',
|
|
argResults: null,
|
|
suppressAnalytics: true,
|
|
);
|
|
await server.start();
|
|
await server.shutdown();
|
|
});
|
|
|
|
test('can send message', () async {
|
|
AnalysisServer server = AnalysisServer(
|
|
null,
|
|
io.Directory(sdk.sdkPath),
|
|
[p.dir],
|
|
commandName: 'testing',
|
|
argResults: null,
|
|
suppressAnalytics: true,
|
|
);
|
|
await server.start();
|
|
|
|
final response = await server.getVersion();
|
|
expect(response, isNotEmpty);
|
|
|
|
await server.shutdown();
|
|
});
|
|
});
|
|
}
|