mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00

Fuchsia will soon remove all support for Component Framework version 1 components (recognized by component manifests ending in `.cmx`). Notably, some of the `flutter` tool commands for Fuchsia devices-- notably, but not limited to, those related to CFv1--are outdated, and either do not work today or soon won't work. This PR removes the outdated components and commands, replacing some with the newer version, or simply removing the non-working features, in some cases.
90 lines
4.1 KiB
Dart
90 lines
4.1 KiB
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 'package:args/command_runner.dart';
|
|
import 'package:flutter_tools/src/base/file_system.dart';
|
|
import 'package:flutter_tools/src/base/logger.dart';
|
|
import 'package:flutter_tools/src/commands/analyze.dart';
|
|
import 'package:flutter_tools/src/globals.dart' as globals;
|
|
import 'package:flutter_tools/src/project_validator.dart';
|
|
|
|
import '../src/context.dart';
|
|
import '../src/test_flutter_command_runner.dart';
|
|
|
|
void main() {
|
|
late FileSystem fileSystem;
|
|
|
|
group('analyze --suggestions command integration', () {
|
|
|
|
setUp(() {
|
|
fileSystem = globals.localFileSystem;
|
|
});
|
|
|
|
testUsingContext('General Info Project Validator', () async {
|
|
final BufferLogger loggerTest = BufferLogger.test();
|
|
final AnalyzeCommand command = AnalyzeCommand(
|
|
artifacts: globals.artifacts!,
|
|
fileSystem: fileSystem,
|
|
logger: loggerTest,
|
|
platform: globals.platform,
|
|
terminal: globals.terminal,
|
|
processManager: globals.processManager,
|
|
allProjectValidators: <ProjectValidator>[GeneralInfoProjectValidator()],
|
|
);
|
|
final CommandRunner<void> runner = createTestCommandRunner(command);
|
|
|
|
await runner.run(<String>[
|
|
'analyze',
|
|
'--no-pub',
|
|
'--no-current-package',
|
|
'--suggestions',
|
|
'../../dev/integration_tests/flutter_gallery',
|
|
]);
|
|
|
|
const String expected = '\n'
|
|
'┌───────────────────────────────────────────────────────────────────┐\n'
|
|
'│ General Info │\n'
|
|
'│ [✓] App Name: flutter_gallery │\n'
|
|
'│ [✓] Supported Platforms: android, ios, web, macos, linux, windows │\n'
|
|
'│ [✓] Is Flutter Package: yes │\n'
|
|
'│ [✓] Uses Material Design: yes │\n'
|
|
'│ [✓] Is Plugin: no │\n'
|
|
'└───────────────────────────────────────────────────────────────────┘\n';
|
|
|
|
expect(loggerTest.statusText, contains(expected));
|
|
});
|
|
|
|
testUsingContext('PubDependenciesProjectValidator success ', () async {
|
|
final BufferLogger loggerTest = BufferLogger.test();
|
|
final AnalyzeCommand command = AnalyzeCommand(
|
|
artifacts: globals.artifacts!,
|
|
fileSystem: fileSystem,
|
|
logger: loggerTest,
|
|
platform: globals.platform,
|
|
terminal: globals.terminal,
|
|
processManager: globals.processManager,
|
|
allProjectValidators: <ProjectValidator>[
|
|
PubDependenciesProjectValidator(globals.processManager),
|
|
],
|
|
);
|
|
final CommandRunner<void> runner = createTestCommandRunner(command);
|
|
|
|
await runner.run(<String>[
|
|
'analyze',
|
|
'--no-pub',
|
|
'--no-current-package',
|
|
'--suggestions',
|
|
'../../dev/integration_tests/flutter_gallery',
|
|
]);
|
|
|
|
const String expected = '\n'
|
|
'┌────────────────────────────────────────────────────────────────────────────────────┐\n'
|
|
'│ Pub dependencies │\n'
|
|
'│ [✓] Dart dependencies: All pub dependencies are hosted on https://pub.dartlang.org │\n'
|
|
'└────────────────────────────────────────────────────────────────────────────────────┘\n';
|
|
expect(loggerTest.statusText, contains(expected));
|
|
});
|
|
});
|
|
}
|