flutter/packages/integration_test/test/_requires_vm_service.dart
Matan Lurey b94e21b439
Note when --enable-vmservice is required and skip otherwise. (#167579)
Our CI system runs with `--enable-vmservice`, but the default (i.e. for
`flutter test`) does not.

Closes https://github.com/flutter/flutter/issues/136079.
2025-04-22 19:50:01 +00:00

18 lines
564 B
Dart

// Copyright 2014 The Flutter Authors. 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:developer' as developer;
import 'package:flutter_test/flutter_test.dart';
Future<bool> hasVmServiceEnabled() async {
final developer.ServiceProtocolInfo info = await developer.Service.getInfo();
final bool result = info.serverUri != null;
if (!result) {
// ignore: avoid_print
print('Run test suite with --enable-vmservice to enable this test.');
}
return result;
}