|
41 | 41 | # Can also be set via Simulator app Device > Rotate Device Automatically |
42 | 42 | defaults write com.apple.iphonesimulator RotateWindowWhenSignaledByGuest -int 1 |
43 | 43 |
|
44 | | -cd $SRC_DIR/out/$FLUTTER_ENGINE/scenario_app/Scenarios |
| 44 | +SCENARIO_PATH=$SRC_DIR/out/$FLUTTER_ENGINE/scenario_app/Scenarios |
| 45 | +cd $SCENARIO_PATH |
| 46 | + |
| 47 | +RESULT_BUNDLE_FOLDER="ios_scenario_xcresult" |
| 48 | +RESULT_BUNDLE_PATH="${SCENARIO_PATH}/${RESULT_BUNDLE_FOLDER}" |
| 49 | + |
| 50 | +# Zip and upload xcresult to luci. |
| 51 | +# First parameter ($1) is the zip output name. |
| 52 | +ZIP_AND_UPLOAD_XCRESULT_TO_LUCI () { |
| 53 | + # Using RESULT_BUNDLE_PATH causes the zip containing all the sub directories. |
| 54 | + # So use relative directory instead. |
| 55 | + echo $1 |
| 56 | + zip -q -r $1 "./$RESULT_BUNDLE_FOLDER" |
| 57 | + if ( -z "$FLUTTER_TEST_OUTPUTS_DIR") then |
| 58 | + mv -f $1 $FLUTTER_TEST_OUTPUTS_DIR |
| 59 | + fi |
| 60 | + exit 1 |
| 61 | +} |
45 | 62 |
|
46 | 63 | echo "Running simulator tests with Skia" |
47 | 64 | echo "" |
48 | 65 |
|
49 | | -set -o pipefail && xcodebuild -sdk iphonesimulator \ |
| 66 | +mktemp -d $RESULT_BUNDLE_PATH |
| 67 | +trap 'rm -rf $RESULT_BUNDLE_PATH' EXIT |
| 68 | + |
| 69 | +if set -o pipefail && xcodebuild -sdk iphonesimulator \ |
50 | 70 | -scheme Scenarios \ |
| 71 | + -resultBundlePath "$RESULT_BUNDLE_PATH/ios_scenario.xcresult" \ |
51 | 72 | -destination 'platform=iOS Simulator,OS=16.2,name=iPhone SE (3rd generation)' \ |
52 | 73 | clean test \ |
53 | | - FLUTTER_ENGINE="$FLUTTER_ENGINE" |
| 74 | + FLUTTER_ENGINE="$FLUTTER_ENGINE"; then |
| 75 | + echo "test success." |
| 76 | +else |
| 77 | + echo "test failed." |
| 78 | + ZIP_AND_UPLOAD_XCRESULT_TO_LUCI "ios_scenario_xcresult.zip" |
| 79 | +fi |
54 | 80 |
|
55 | 81 | echo "Running simulator tests with Impeller" |
56 | 82 | echo "" |
57 | 83 |
|
58 | 84 | # Skip testFontRenderingWhenSuppliedWithBogusFont: https://github.com/flutter/flutter/issues/113250 |
59 | | -set -o pipefail && xcodebuild -sdk iphonesimulator \ |
| 85 | +if set -o pipefail && xcodebuild -sdk iphonesimulator \ |
60 | 86 | -scheme Scenarios \ |
| 87 | + -resultBundlePath "$RESULT_BUNDLE_PATH/ios_scenario.xcresult" \ |
61 | 88 | -destination 'platform=iOS Simulator,OS=16.2,name=iPhone SE (3rd generation)' \ |
62 | 89 | clean test \ |
63 | 90 | FLUTTER_ENGINE="$FLUTTER_ENGINE" \ |
64 | 91 | -skip-testing "ScenariosUITests/BogusFontTextTest/testFontRenderingWhenSuppliedWithBogusFont" \ |
65 | | - INFOPLIST_FILE="Scenarios/Info_Impeller.plist" # Plist with FLTEnableImpeller=YES |
| 92 | + INFOPLIST_FILE="Scenarios/Info_Impeller.plist"; then # Plist with FLTEnableImpeller=YES |
| 93 | + echo "test success." |
| 94 | +else |
| 95 | + echo "test failed." |
| 96 | + ZIP_AND_UPLOAD_XCRESULT_TO_LUCI "ios_scenario_impeller_xcresult.zip" |
| 97 | +fi |
0 commit comments