native_ui_tests_macos.dart 1.17 KB
Newer Older
1 2 3 4 5 6 7 8
// 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/framework.dart';
import 'package:flutter_devicelab/framework/ios.dart';
import 'package:flutter_devicelab/framework/task_result.dart';
import 'package:flutter_devicelab/framework/utils.dart';
9
import 'package:path/path.dart' as path;
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29

Future<void> main() async {
  await task(() async {
    final String projectDirectory = '${flutterDirectory.path}/dev/integration_tests/flutter_gallery';

    await inDirectory(projectDirectory, () async {
      section('Build gallery app');

      await flutter(
        'build',
        options: <String>[
          'macos',
          '-v',
          '--debug',
        ],
      );
    });

    section('Run platform unit tests');

30 31 32 33 34 35
    if (!await runXcodeTests(
      platformDirectory: path.join(projectDirectory, 'macos'),
      destination: 'platform=macOS',
      testName: 'native_ui_tests_macos',
      skipCodesign: true,
    )) {
36 37 38 39 40 41
      return TaskResult.failure('Platform unit tests failed');
    }

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