-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[pigeon] Consolidate platform test harnesses #2803
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
stuartmorgan-g
wants to merge
19
commits into
flutter:main
from
stuartmorgan-g:pigeon-test-harness-consolidation
Closed
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
192132a
Add README explaining structure
stuartmorgan-g 73c6d5b
Initial test plugin; unchanged from template
stuartmorgan-g dbb833b
Initial seconday test plugin; unchanged from template
stuartmorgan-g 7620b5f
Misc template cleanup, and add generated files.
stuartmorgan-g 8e821e1
Move Kotlin tests into the new harness
stuartmorgan-g 76fa575
Move Java tests into the new harness
stuartmorgan-g 32fcb68
Move Obj-C tests into the new harness
stuartmorgan-g 5262d34
Modernize imports in ObjC tests
stuartmorgan-g b6658f1
Move Swift (iOS) tests into the new harness
stuartmorgan-g 75f6e42
Replace macOS test with a new, similar test using the shared structure
stuartmorgan-g 018fd31
Move Windows tests into the new harness
stuartmorgan-g f9de9e8
README cleanup
stuartmorgan-g b9ee5a8
Analyzer fix
stuartmorgan-g c7c764c
Autoformat
stuartmorgan-g 92df7b1
Misc repo check fixes
stuartmorgan-g 173cf2e
Roll back Gradle and AGP version for macOS CI
stuartmorgan-g 75d142b
Delete unneeded template files
stuartmorgan-g a4b5271
Adjust READMEs
stuartmorgan-g 45a2477
Add integration test issue reference
stuartmorgan-g File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # Native Pigeon Tests | ||
|
|
||
| This directory contains native test harnesses for native and end-to-end tests | ||
| of Pigeon-generated code. The [test script](../tool/run_tests.dart) generates | ||
| native code from [pigeons/](../pigeons/) into the native test scaffolding, and | ||
| then drives the tests there. | ||
|
|
||
| To run these tests, use [`run_tests.dart`](../tool/run_tests.dart) | ||
|
|
||
| ## test\_plugin | ||
|
|
||
| The new unified test harness for all platforms. Tests in this plugin use the | ||
| same structure as tests for the Flutter team-maintained plugins, as described | ||
| [in the repository documentation](https://github.com/flutter/flutter/wiki/Plugin-Tests). | ||
|
|
||
| ## alternate\_language\_test\_plugin | ||
|
|
||
| The test harness for alternate languages, on platforms that have multiple | ||
| supported plugin languages. It covers: | ||
| - Java for Android | ||
| - Objective-C for iOS | ||
|
|
||
| ## flutter\_null\_safe\_unit\_tests | ||
|
|
||
| Dart unit tests for null-safe mode. This is a legacy structure from before | ||
| NNBD was the only mode Pigeon supported; these should be folded back into | ||
| the main tests. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ | |
| .buildlog/ | ||
| .history | ||
| .svn/ | ||
| migrate_working_dir/ | ||
|
|
||
| # IntelliJ related | ||
| *.iml | ||
|
|
||
33 changes: 33 additions & 0 deletions
33
packages/pigeon/platform_tests/alternate_language_test_plugin/.metadata
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # This file tracks properties of this Flutter project. | ||
| # Used by Flutter tool to assess capabilities and perform upgrades etc. | ||
| # | ||
| # This file should be version controlled. | ||
|
|
||
| version: | ||
| revision: c7d11549a51eb37807604bdfd1141a82be8fac4b | ||
| channel: main | ||
|
|
||
| project_type: plugin | ||
|
|
||
| # Tracks metadata for the flutter migrate command | ||
| migration: | ||
| platforms: | ||
| - platform: root | ||
| create_revision: c7d11549a51eb37807604bdfd1141a82be8fac4b | ||
| base_revision: c7d11549a51eb37807604bdfd1141a82be8fac4b | ||
| - platform: android | ||
| create_revision: c7d11549a51eb37807604bdfd1141a82be8fac4b | ||
| base_revision: c7d11549a51eb37807604bdfd1141a82be8fac4b | ||
| - platform: ios | ||
| create_revision: c7d11549a51eb37807604bdfd1141a82be8fac4b | ||
| base_revision: c7d11549a51eb37807604bdfd1141a82be8fac4b | ||
|
|
||
| # User provided section | ||
|
|
||
| # List of Local paths (relative to this file) that should be | ||
| # ignored by the migrate tool. | ||
| # | ||
| # Files that are not part of the templates will be ignored by default. | ||
| unmanaged_files: | ||
| - 'lib/main.dart' | ||
| - 'ios/Runner.xcodeproj/project.pbxproj' |
6 changes: 6 additions & 0 deletions
6
packages/pigeon/platform_tests/alternate_language_test_plugin/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # alternate_language_test_plugin | ||
|
|
||
| Tests for languages not covered by `test_plugin`. | ||
| See [the `platform_tests` README](../README.md) for details. | ||
|
|
||
| To run these tests, use [`run_tests.dart`](../tool/run_tests.dart) |
9 changes: 9 additions & 0 deletions
9
packages/pigeon/platform_tests/alternate_language_test_plugin/android/.gitignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| *.iml | ||
| .gradle | ||
| /local.properties | ||
| /.idea/workspace.xml | ||
| /.idea/libraries | ||
| .DS_Store | ||
| /build | ||
| /captures | ||
| .cxx |
52 changes: 52 additions & 0 deletions
52
packages/pigeon/platform_tests/alternate_language_test_plugin/android/build.gradle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| group 'com.example.alternate_language_test_plugin' | ||
| version '1.0' | ||
|
|
||
| buildscript { | ||
| repositories { | ||
| google() | ||
| mavenCentral() | ||
| } | ||
|
|
||
| dependencies { | ||
| classpath 'com.android.tools.build:gradle:4.2.0' | ||
| } | ||
| } | ||
|
|
||
| rootProject.allprojects { | ||
| repositories { | ||
| google() | ||
| mavenCentral() | ||
| } | ||
| } | ||
|
|
||
| apply plugin: 'com.android.library' | ||
|
|
||
| android { | ||
| compileSdkVersion 31 | ||
|
|
||
| compileOptions { | ||
| sourceCompatibility JavaVersion.VERSION_1_8 | ||
| targetCompatibility JavaVersion.VERSION_1_8 | ||
| } | ||
|
|
||
| defaultConfig { | ||
| minSdkVersion 16 | ||
| } | ||
|
|
||
| testOptions { | ||
| unitTests.includeAndroidResources = true | ||
| unitTests.returnDefaultValues = true | ||
| unitTests.all { | ||
| testLogging { | ||
| events "passed", "skipped", "failed", "standardOut", "standardError" | ||
| outputs.upToDateWhen {false} | ||
| showStandardStreams = true | ||
| } | ||
| } | ||
| } | ||
|
|
||
| dependencies { | ||
| testImplementation 'junit:junit:4.+' | ||
| testImplementation "org.mockito:mockito-core:3.+" | ||
| } | ||
| } |
1 change: 1 addition & 0 deletions
1
packages/pigeon/platform_tests/alternate_language_test_plugin/android/settings.gradle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| rootProject.name = 'alternate_language_test_plugin' |
5 changes: 5 additions & 0 deletions
5
packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/.gitignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # TODO(stuartmorgan): Remove this, so that review will show the effects of | ||
| # changes on generated files. This will need a way to avoid unnecessary churn, | ||
| # such as a flag to suppress version stamp generation. | ||
| *.java | ||
| !AlternateLanguageTestPlugin.kt |
3 changes: 3 additions & 0 deletions
3
...pigeon/platform_tests/alternate_language_test_plugin/android/src/main/AndroidManifest.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
| package="com.example.alternate_language_test_plugin"> | ||
| </manifest> |
20 changes: 20 additions & 0 deletions
20
...src/main/java/com/example/alternate_language_test_plugin/AlternateLanguageTestPlugin.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| // Copyright 2013 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. | ||
|
|
||
| package com.example.alternate_language_test_plugin; | ||
|
|
||
| import androidx.annotation.NonNull; | ||
| import io.flutter.embedding.engine.plugins.FlutterPlugin; | ||
|
|
||
| /** | ||
| * This plugin is currently a no-op since only unit tests have been set up. In the future, this will | ||
| * register Pigeon APIs used in integration tests. | ||
| */ | ||
| public class AlternateLanguageTestPlugin implements FlutterPlugin { | ||
| @Override | ||
| public void onAttachedToEngine(@NonNull FlutterPluginBinding flutterPluginBinding) {} | ||
|
|
||
| @Override | ||
| public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) {} | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
...droid/app/src/profile/AndroidManifest.xml → ...android/app/src/debug/AndroidManifest.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.