Skip to content

Commit 8245fcd

Browse files
committed
[macOS] Add integration test
1 parent 9a67219 commit 8245fcd

File tree

35 files changed

+1681
-2
lines changed

35 files changed

+1681
-2
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Copyright 2014 The Flutter Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
import 'package:flutter_devicelab/framework/devices.dart';
6+
import 'package:flutter_devicelab/framework/framework.dart';
7+
import 'package:flutter_devicelab/framework/ios.dart';
8+
import 'package:flutter_devicelab/framework/task_result.dart';
9+
import 'package:flutter_devicelab/framework/utils.dart';
10+
import 'package:path/path.dart' as path;
11+
12+
Future<void> main() async {
13+
deviceOperatingSystem = DeviceOperatingSystem.macos;
14+
await task(() async {
15+
final String projectDirectory =
16+
'${flutterDirectory.path}/dev/integration_tests/macos_integration_test';
17+
18+
await inDirectory(projectDirectory, () async {
19+
section('Build clean');
20+
21+
await flutter('clean');
22+
23+
section('Configure macOS integration app');
24+
25+
await flutter('build', options: <String>['macos', '-v', '--config-only', '--release']);
26+
});
27+
28+
section('Run integration XCUITests');
29+
30+
if (!await runXcodeTests(
31+
platformDirectory: path.join(projectDirectory, 'macos'),
32+
destination: 'platform=macOS',
33+
testName: 'integration test macos',
34+
)) {
35+
return TaskResult.failure('macOS XCUITests failed');
36+
}
37+
38+
return TaskResult.success(null);
39+
});
40+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
6+
.DS_Store
7+
.atom/
8+
.build/
9+
.buildlog/
10+
.history
11+
.svn/
12+
.swiftpm/
13+
migrate_working_dir/
14+
15+
# IntelliJ related
16+
*.iml
17+
*.ipr
18+
*.iws
19+
.idea/
20+
21+
# The .vscode folder contains launch configuration and tasks you configure in
22+
# VS Code which you may wish to be included in version control, so this line
23+
# is commented out by default.
24+
#.vscode/
25+
26+
# Flutter/Dart/Pub related
27+
**/doc/api/
28+
**/ios/Flutter/.last_build_id
29+
.dart_tool/
30+
.flutter-plugins
31+
.flutter-plugins-dependencies
32+
.pub-cache/
33+
.pub/
34+
/build/
35+
36+
# Symbolication related
37+
app.*.symbols
38+
39+
# Obfuscation related
40+
app.*.map.json
41+
42+
# Android Studio will place build artifacts here
43+
/android/app/debug
44+
/android/app/profile
45+
/android/app/release
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled and should not be manually edited.
5+
6+
version:
7+
revision: "0ef02b5dc79609d9ad83357bebf13359baf10e7f"
8+
channel: "[user-branch]"
9+
10+
project_type: app
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: 0ef02b5dc79609d9ad83357bebf13359baf10e7f
17+
base_revision: 0ef02b5dc79609d9ad83357bebf13359baf10e7f
18+
- platform: android
19+
create_revision: 0ef02b5dc79609d9ad83357bebf13359baf10e7f
20+
base_revision: 0ef02b5dc79609d9ad83357bebf13359baf10e7f
21+
- platform: ios
22+
create_revision: 0ef02b5dc79609d9ad83357bebf13359baf10e7f
23+
base_revision: 0ef02b5dc79609d9ad83357bebf13359baf10e7f
24+
- platform: linux
25+
create_revision: 0ef02b5dc79609d9ad83357bebf13359baf10e7f
26+
base_revision: 0ef02b5dc79609d9ad83357bebf13359baf10e7f
27+
- platform: macos
28+
create_revision: 0ef02b5dc79609d9ad83357bebf13359baf10e7f
29+
base_revision: 0ef02b5dc79609d9ad83357bebf13359baf10e7f
30+
- platform: web
31+
create_revision: 0ef02b5dc79609d9ad83357bebf13359baf10e7f
32+
base_revision: 0ef02b5dc79609d9ad83357bebf13359baf10e7f
33+
- platform: windows
34+
create_revision: 0ef02b5dc79609d9ad83357bebf13359baf10e7f
35+
base_revision: 0ef02b5dc79609d9ad83357bebf13359baf10e7f
36+
37+
# User provided section
38+
39+
# List of Local paths (relative to this file) that should be
40+
# ignored by the migrate tool.
41+
#
42+
# Files that are not part of the templates will be ignored by default.
43+
unmanaged_files:
44+
- 'lib/main.dart'
45+
- 'ios/Runner.xcodeproj/project.pbxproj'
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# macOS Integration test
2+
3+
Tests some of the functionality of macOS embedder, such as resize synchronization not deadlocking.
4+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include: package:flutter_lints/flutter.yaml
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import 'package:flutter/material.dart';
2+
3+
void main() {
4+
runApp(const MainApp());
5+
}
6+
7+
class MainApp extends StatefulWidget {
8+
const MainApp({super.key});
9+
10+
@override
11+
State<MainApp> createState() => _MainAppState();
12+
}
13+
14+
class _MainAppState extends State<MainApp> {
15+
int _count = 0;
16+
17+
@override
18+
Widget build(BuildContext context) {
19+
return MaterialApp(
20+
home: Scaffold(
21+
body: Column(
22+
children: [
23+
Text('Count is $_count'),
24+
TextButton(
25+
onPressed: () {
26+
setState(() {
27+
_count++;
28+
});
29+
},
30+
child: Text('Increment')),
31+
],
32+
),
33+
),
34+
);
35+
}
36+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Flutter-related
2+
**/Flutter/ephemeral/
3+
**/Pods/
4+
5+
# Xcode-related
6+
**/dgph
7+
**/xcuserdata/
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include "ephemeral/Flutter-Generated.xcconfig"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include "ephemeral/Flutter-Generated.xcconfig"

0 commit comments

Comments
 (0)