flavors_test_ios.dart 1.48 KB
Newer Older
Ian Hickson's avatar
Ian Hickson committed
1
// Copyright 2014 The Flutter Authors. All rights reserved.
2 3 4
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

5
import 'package:flutter_devicelab/framework/devices.dart';
6
import 'package:flutter_devicelab/framework/framework.dart';
7
import 'package:flutter_devicelab/framework/task_result.dart';
8
import 'package:flutter_devicelab/framework/utils.dart';
9 10
import 'package:flutter_devicelab/tasks/integration_tests.dart';

11
Future<void> main() async {
12
  deviceOperatingSystem = DeviceOperatingSystem.ios;
13 14 15
  await task(() async {
    await createFlavorsTest().call();
    await createIntegrationTestFlavorsTest().call();
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
    // test install and uninstall of flavors app
    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('install failed, bogus flavor not found')) {
        print(stderrString);
        return TaskResult.failure('Should not succeed with bogus flavor');
      }
    });
40 41 42

    return TaskResult.success(null);
  });
43
}