mirror of
https://github.com/flutter/flutter
synced 2024-11-05 18:37:51 +00:00
c05dc3e68e
Reland of https://github.com/flutter/flutter/pull/133719. Updates [the string comparison in flavor_test.dart](https://github.com/flutter/flutter/pull/134060/files#diff-53383b32b975bfed6875306dfb98911cad077a5251ca0591c5b0e125fb4a0f05R39) to use `path.join` to build the path string so that the generated path is correct for both Linux and Windows hosts. Fixes https://github.com/flutter/flutter/issues/133713 I've tested this on a Windows host targeting a physical Android device.
48 lines
1.6 KiB
Dart
48 lines
1.6 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:flutter_devicelab/framework/devices.dart';
|
|
import 'package:flutter_devicelab/framework/framework.dart';
|
|
import 'package:flutter_devicelab/framework/task_result.dart';
|
|
import 'package:flutter_devicelab/framework/utils.dart';
|
|
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
|
|
|
Future<void> main() async {
|
|
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
|
await task(() async {
|
|
await createFlavorsTest().call();
|
|
await createIntegrationTestFlavorsTest().call();
|
|
// test install and uninstall of flavors app
|
|
final TaskResult installTestsResult = await inDirectory(
|
|
'${flutterDirectory.path}/dev/integration_tests/flavors',
|
|
() async {
|
|
await flutter(
|
|
'install',
|
|
options: <String>['--flavor', 'paid'],
|
|
);
|
|
await flutter(
|
|
'install',
|
|
options: <String>['--flavor', 'paid', '--uninstall-only'],
|
|
);
|
|
final StringBuffer stderr = StringBuffer();
|
|
await evalFlutter(
|
|
'install',
|
|
canFail: true,
|
|
stderr: stderr,
|
|
options: <String>['--flavor', 'bogus'],
|
|
);
|
|
|
|
final String stderrString = stderr.toString();
|
|
if (!stderrString.contains('The Xcode project defines schemes: free, paid')) {
|
|
print(stderrString);
|
|
return TaskResult.failure('Should not succeed with bogus flavor');
|
|
}
|
|
|
|
return TaskResult.success(null);
|
|
},
|
|
);
|
|
|
|
return installTestsResult;
|
|
});
|
|
}
|