11#! /bin/bash
22
3- set -e
3+ # TODO(matanlurey): Remove all references are gone and using run_ios_tests.dart.
4+ # See https://github.com/flutter/flutter/issues/143953 for tracking.
45
6+ set -e
57
68# Needed because if it is set, cd may print the path it changed to.
79unset CDPATH
@@ -24,120 +26,20 @@ function follow_links() (
2426 echo " $file "
2527)
2628
27- SCRIPT_DIR=$( follow_links " $( dirname -- " ${BASH_SOURCE[0]} " ) " )
28- SRC_DIR=" $( cd " $SCRIPT_DIR /../../.." ; pwd -P) "
29-
30- if uname -m | grep " arm64" ; then
31- FLUTTER_ENGINE=" ios_debug_sim_unopt_arm64"
32- else
33- FLUTTER_ENGINE=" ios_debug_sim_unopt"
34- fi
35-
36- if [[ $# -eq 1 ]]; then
37- FLUTTER_ENGINE=" $1 "
38- fi
39-
40- # Make sure simulators rotate automatically for "PlatformViewRotation" test.
41- # Can also be set via Simulator app Device > Rotate Device Automatically
42- defaults write com.apple.iphonesimulator RotateWindowWhenSignaledByGuest -int 1
43-
44- SCENARIO_PATH=$SRC_DIR /out/$FLUTTER_ENGINE /scenario_app/Scenarios
45- pushd .
46- cd $SCENARIO_PATH
47-
48- RESULT_BUNDLE_FOLDER=$( mktemp -d ios_scenario_xcresult_XXX)
49- RESULT_BUNDLE_PATH=" ${SCENARIO_PATH} /${RESULT_BUNDLE_FOLDER} "
50-
51- # Zip and upload xcresult to luci.
52- # First parameter ($1) is the zip output name.
53- zip_and_upload_xcresult_to_luci () {
54- # We don't want the zip to contain the abusolute path,
55- # so use relative path (./$RESULT_BUNDLE_FOLDER) instead.
56- zip -q -r $1 " ./$RESULT_BUNDLE_FOLDER "
57- mv -f $1 $FLUTTER_TEST_OUTPUTS_DIR
58- exit 1
29+ function dart_bin() {
30+ dart_path=" $1 /flutter/third_party/dart/tools/sdks/dart-sdk/bin"
31+ if [[ ! -e " $dart_path " ]]; then
32+ dart_path=" $1 /third_party/dart/tools/sdks/dart-sdk/bin"
33+ fi
34+ echo " $dart_path "
5935}
6036
61- readonly DEVICE_NAME=" iPhone SE (3rd generation)"
62- readonly DEVICE=com.apple.CoreSimulator.SimDeviceType.iPhone-SE-3rd-generation
63- readonly OS_RUNTIME=com.apple.CoreSimulator.SimRuntime.iOS-17-0
64- readonly OS=" 17.0"
65-
66- # Delete any existing devices named "iPhone SE (3rd generation)". Having more
67- # than one may cause issues when builds target the device.
68- echo " Deleting any existing devices names $DEVICE_NAME ..."
69- RESULT=0
70- while [[ $RESULT == 0 ]]; do
71- xcrun simctl delete " $DEVICE_NAME " || RESULT=1
72- if [ $RESULT == 0 ]; then
73- echo " Deleted $DEVICE_NAME "
74- fi
75- done
76- echo " "
77-
78- echo " Creating $DEVICE_NAME $DEVICE $OS_RUNTIME ..."
79- xcrun simctl create " $DEVICE_NAME " " $DEVICE " " $OS_RUNTIME "
80- echo " "
81-
82- echo " Running simulator tests with Skia"
83- echo " "
84-
85- if set -o pipefail && xcodebuild -sdk iphonesimulator \
86- -scheme Scenarios \
87- -resultBundlePath " $RESULT_BUNDLE_PATH /ios_scenario.xcresult" \
88- -destination " platform=iOS Simulator,OS=$OS ,name=$DEVICE_NAME " \
89- clean test \
90- FLUTTER_ENGINE=" $FLUTTER_ENGINE " ; then
91- echo " test success."
92- else
93- echo " test failed."
94- zip_and_upload_xcresult_to_luci " ios_scenario_xcresult.zip"
95- fi
96- rm -rf $RESULT_BUNDLE_PATH
97-
98- echo " Running simulator tests with Impeller"
99- echo " "
100-
101- # Skip testFontRenderingWhenSuppliedWithBogusFont: https://github.com/flutter/flutter/issues/113250
102- # Skip golden tests that use software rendering: https://github.com/flutter/flutter/issues/131888
103- if set -o pipefail && xcodebuild -sdk iphonesimulator \
104- -scheme Scenarios \
105- -resultBundlePath " $RESULT_BUNDLE_PATH /ios_scenario.xcresult" \
106- -destination " platform=iOS Simulator,OS=$OS ,name=$DEVICE_NAME " \
107- clean test \
108- FLUTTER_ENGINE=" $FLUTTER_ENGINE " \
109- -skip-testing ScenariosUITests/MultiplePlatformViewsBackgroundForegroundTest/testPlatformView \
110- -skip-testing ScenariosUITests/MultiplePlatformViewsTest/testPlatformView \
111- -skip-testing ScenariosUITests/NonFullScreenFlutterViewPlatformViewUITests/testPlatformView \
112- -skip-testing ScenariosUITests/PlatformViewMutationClipPathTests/testPlatformView \
113- -skip-testing ScenariosUITests/PlatformViewMutationClipPathWithTransformTests/testPlatformView \
114- -skip-testing ScenariosUITests/PlatformViewMutationClipRectAfterMovedTests/testPlatformView \
115- -skip-testing ScenariosUITests/PlatformViewMutationClipRectTests/testPlatformView \
116- -skip-testing ScenariosUITests/PlatformViewMutationClipRectWithTransformTests/testPlatformView \
117- -skip-testing ScenariosUITests/PlatformViewMutationClipRRectTests/testPlatformView \
118- -skip-testing ScenariosUITests/PlatformViewMutationClipRRectWithTransformTests/testPlatformView \
119- -skip-testing ScenariosUITests/PlatformViewMutationLargeClipRRectTests/testPlatformView \
120- -skip-testing ScenariosUITests/PlatformViewMutationLargeClipRRectWithTransformTests/testPlatformView \
121- -skip-testing ScenariosUITests/PlatformViewMutationOpacityTests/testPlatformView \
122- -skip-testing ScenariosUITests/PlatformViewMutationTransformTests/testPlatformView \
123- -skip-testing ScenariosUITests/PlatformViewRotation/testPlatformView \
124- -skip-testing ScenariosUITests/PlatformViewUITests/testPlatformView \
125- -skip-testing ScenariosUITests/PlatformViewWithNegativeOtherBackDropFilterTests/testPlatformView \
126- -skip-testing ScenariosUITests/PlatformViewWithOtherBackdropFilterTests/testPlatformView \
127- -skip-testing ScenariosUITests/RenderingSelectionTest/testSoftwareRendering \
128- -skip-testing ScenariosUITests/TwoPlatformViewClipPathTests/testPlatformView \
129- -skip-testing ScenariosUITests/TwoPlatformViewClipRectTests/testPlatformView \
130- -skip-testing ScenariosUITests/TwoPlatformViewClipRRectTests/testPlatformView \
131- -skip-testing ScenariosUITests/TwoPlatformViewsWithOtherBackDropFilterTests/testPlatformView \
132- -skip-testing ScenariosUITests/UnobstructedPlatformViewTests/testMultiplePlatformViewsWithOverlays \
133- # Plist with FLTEnableImpeller=YES, all projects in the workspace requires this file.
134- # For example, FlutterAppExtensionTestHost has a dummy file under the below directory.
135- INFOPLIST_FILE=" Scenarios/Info_Impeller.plist" ; then
136- echo " test success."
137- else
138- echo " test failed."
139- zip_and_upload_xcresult_to_luci " ios_scenario_impeller_xcresult.zip"
140- fi
141- rm -rf $RESULT_BUNDLE_PATH
37+ SCRIPT_DIR=$( follow_links " $( dirname -- " ${BASH_SOURCE[0]} " ) " )
38+ SRC_DIR=" $( cd " $SCRIPT_DIR /../../.." ; pwd -P) "
39+ DART_BIN=$( dart_bin " $SRC_DIR " )
40+ DART=" ${DART_BIN} /dart"
14241
143- popd
42+ " $DART " \
43+ --disable-dart-dev \
44+ testing/scenario_app/bin/run_ios_tests.dart \
45+ " $@ "
0 commit comments