Visitar URL original
[pigeon] Updated documentation in run_tests.sh and turned the ios uni… · creatorpiyush/packages@9586e99 · GitHub
Skip to content

Commit 9586e99

Browse files
authored
[pigeon] Updated documentation in run_tests.sh and turned the ios unit tests back on. (flutter#191)
1 parent 72bc4f3 commit 9586e99

2 files changed

Lines changed: 69 additions & 17 deletions

File tree

‎packages/pigeon/platform_tests/ios_unit_tests/ios/Runner.xcodeproj/project.pbxproj‎

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111
0D50127523FF75B100CD5B95 /* RunnerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D50127423FF75B100CD5B95 /* RunnerTests.m */; };
1212
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
1313
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
14-
3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
15-
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
16-
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
17-
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
1814
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
1915
97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
2016
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
@@ -39,8 +35,6 @@
3935
dstPath = "";
4036
dstSubfolderSpec = 10;
4137
files = (
42-
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
43-
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
4438
);
4539
name = "Embed Frameworks";
4640
runOnlyForDeploymentPostprocessing = 0;
@@ -56,13 +50,11 @@
5650
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
5751
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
5852
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
59-
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
6053
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
6154
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
6255
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
6356
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
6457
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
65-
9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = "<group>"; };
6658
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
6759
97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
6860
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
@@ -83,8 +75,6 @@
8375
isa = PBXFrameworksBuildPhase;
8476
buildActionMask = 2147483647;
8577
files = (
86-
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
87-
3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
8878
);
8979
runOnlyForDeploymentPostprocessing = 0;
9080
};
@@ -103,9 +93,7 @@
10393
9740EEB11CF90186004384FC /* Flutter */ = {
10494
isa = PBXGroup;
10595
children = (
106-
3B80C3931E831B6300D905FE /* App.framework */,
10796
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
108-
9740EEBA1CF902C7004384FC /* Flutter.framework */,
10997
9740EEB21CF90195004384FC /* Debug.xcconfig */,
11098
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
11199
9740EEB31CF90195004384FC /* Generated.xcconfig */,
@@ -271,7 +259,7 @@
271259
);
272260
runOnlyForDeploymentPostprocessing = 0;
273261
shellPath = /bin/sh;
274-
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
262+
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
275263
};
276264
9740EEB61CF901F6004384FC /* Run Script */ = {
277265
isa = PBXShellScriptBuildPhase;
@@ -408,7 +396,6 @@
408396
};
409397
249021D3217E4FDB00AE95B9 /* Profile */ = {
410398
isa = XCBuildConfiguration;
411-
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
412399
buildSettings = {
413400
ALWAYS_SEARCH_USER_PATHS = NO;
414401
CLANG_ANALYZER_NONNULL = YES;
@@ -482,7 +469,6 @@
482469
};
483470
97C147031CF9000F007C117D /* Debug */ = {
484471
isa = XCBuildConfiguration;
485-
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
486472
buildSettings = {
487473
ALWAYS_SEARCH_USER_PATHS = NO;
488474
CLANG_ANALYZER_NONNULL = YES;
@@ -538,7 +524,6 @@
538524
};
539525
97C147041CF9000F007C117D /* Release */ = {
540526
isa = XCBuildConfiguration;
541-
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
542527
buildSettings = {
543528
ALWAYS_SEARCH_USER_PATHS = NO;
544529
CLANG_ANALYZER_NONNULL = YES;

‎packages/pigeon/run_tests.sh‎

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,28 @@
1+
###############################################################################
2+
# run_tests.sh
3+
#
4+
# This runs all the different types of tests for pigeon. It should be run from
5+
# the directory that contains the script.
6+
###############################################################################
7+
18
# exit when any command fails
29
set -e
310

11+
###############################################################################
12+
# Variables
13+
###############################################################################
414
flutter=$(which flutter)
515
flutter_bin=$(dirname $flutter)
616
framework_path="$flutter_bin/cache/artifacts/engine/ios/"
717

18+
###############################################################################
19+
# Functions
20+
###############################################################################
21+
22+
# test_pigeon_ios(<path to pigeon file>)
23+
#
24+
# Compiles the pigeon file to a temp directory and attempts to compile the code
25+
# and runs the dart analyzer on the generated dart code.
826
test_pigeon_ios() {
927
temp_dir=$(mktemp -d -t pigeon)
1028

@@ -30,6 +48,9 @@ test_pigeon_ios() {
3048
rm -rf $temp_dir
3149
}
3250

51+
# test_pigeon_android(<path to pigeon file>)
52+
#
53+
# Compiles the pigeon file to a temp directory and attempts to compile the code.
3354
test_pigeon_android() {
3455
temp_dir=$(mktemp -d -t pigeon)
3556

@@ -48,7 +69,22 @@ test_pigeon_android() {
4869
rm -rf $temp_dir
4970
}
5071

72+
###############################################################################
73+
# Dart unit tests
74+
###############################################################################
75+
pub get
5176
pub run test test/
77+
78+
###############################################################################
79+
# Compilation tests (Code is generated and compiled)
80+
###############################################################################
81+
# Make sure the artifacts are present.
82+
flutter precache
83+
# Make sure flutter dependencies are available.
84+
pushd $PWD
85+
cd e2e_tests/test_objc/
86+
flutter pub get
87+
popd
5288
test_pigeon_android ./pigeons/voidflutter.dart
5389
test_pigeon_android ./pigeons/voidhost.dart
5490
test_pigeon_android ./pigeons/host2flutter.dart
@@ -64,6 +100,9 @@ test_pigeon_ios ./pigeons/void_arg_host.dart
64100
test_pigeon_ios ./pigeons/void_arg_flutter.dart
65101
test_pigeon_ios ./pigeons/list.dart
66102

103+
###############################################################################
104+
# Mock handler flutter tests.
105+
###############################################################################
67106
pushd $PWD
68107
pub run pigeon \
69108
--input pigeons/message.dart \
@@ -73,6 +112,31 @@ cd mock_handler_tester
73112
flutter test
74113
popd
75114

115+
###############################################################################
116+
# iOS unit tests on generated code.
117+
###############################################################################
118+
pub run pigeon \
119+
--input pigeons/message.dart \
120+
--dart_out /dev/null \
121+
--objc_header_out platform_tests/ios_unit_tests/ios/Runner/messages.h \
122+
--objc_source_out platform_tests/ios_unit_tests/ios/Runner/messages.m
123+
clang-format -i platform_tests/ios_unit_tests/ios/Runner/messages.h
124+
clang-format -i platform_tests/ios_unit_tests/ios/Runner/messages.m
125+
pushd $PWD
126+
cd platform_tests/ios_unit_tests
127+
flutter build ios
128+
cd ios
129+
xcodebuild \
130+
-workspace Runner.xcworkspace \
131+
-scheme RunnerTests \
132+
-sdk iphonesimulator \
133+
-destination 'platform=iOS Simulator,name=iPhone 8' \
134+
test
135+
popd
136+
137+
###############################################################################
138+
# End-to-end (e2e) integration tests.
139+
###############################################################################
76140
DARTLE_H="e2e_tests/test_objc/ios/Runner/dartle.h"
77141
DARTLE_M="e2e_tests/test_objc/ios/Runner/dartle.m"
78142
DARTLE_DART="e2e_tests/test_objc/lib/dartle.dart"
@@ -97,5 +161,8 @@ xcodebuild \
97161
test | xcpretty
98162
popd
99163

164+
###############################################################################
165+
# Run the formatter on generated code.
166+
###############################################################################
100167
cd ../..
101-
pub global activate flutter_plugin_tools && pub global run flutter_plugin_tools format
168+
pub global activate flutter_plugin_tools && pub global run flutter_plugin_tools format

0 commit comments

Comments
 (0)