Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[flutter_plugin_tools] Make unit tests pass on Windows #4149

Merged
merged 19 commits into from
Jul 9, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix xctest tests
  • Loading branch information
stuartmorgan committed Jul 9, 2021
commit d47d8ab7782dc9a80ad2d5093af8c101fcca49c5
4 changes: 3 additions & 1 deletion script/tool/lib/src/xctest_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'dart:convert';
import 'dart:io' as io;

import 'package:file/file.dart';
import 'package:platform/platform.dart';

import 'common/core.dart';
import 'common/package_looping_command.dart';
Expand All @@ -31,7 +32,8 @@ class XCTestCommand extends PackageLoopingCommand {
XCTestCommand(
Directory packagesDir, {
ProcessRunner processRunner = const ProcessRunner(),
}) : super(packagesDir, processRunner: processRunner) {
Platform platform = const LocalPlatform(),
}) : super(packagesDir, processRunner: processRunner, platform: platform) {
argParser.addOption(
_kiOSDestination,
help:
Expand Down
6 changes: 4 additions & 2 deletions script/tool/test/xctest_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,18 @@ void main() {

group('test xctest_command', () {
late FileSystem fileSystem;
late MockPlatform mockPlatform;
late Directory packagesDir;
late CommandRunner<void> runner;
late RecordingProcessRunner processRunner;

setUp(() {
fileSystem = MemoryFileSystem();
mockPlatform = MockPlatform(isMacOS: true);
packagesDir = createPackagesDirectory(fileSystem: fileSystem);
processRunner = RecordingProcessRunner();
final XCTestCommand command =
XCTestCommand(packagesDir, processRunner: processRunner);
final XCTestCommand command = XCTestCommand(packagesDir,
processRunner: processRunner, platform: mockPlatform);

runner = CommandRunner<void>('xctest_command', 'Test for xctest_command');
runner.addCommand(command);
Expand Down