diff --git a/DEPS b/DEPS index 9388d84c32c93..3de8af5bb222a 100644 --- a/DEPS +++ b/DEPS @@ -26,7 +26,7 @@ vars = { 'skia_git': 'https://skia.googlesource.com', # OCMock is for testing only so there is no google clone 'ocmock_git': 'https://github.com/erikdoe/ocmock.git', - 'skia_revision': '893403fb389695fc3517aae7f74e5c895f716e82', + 'skia_revision': 'f3881b278e69f149a4dd27fb489f087e956555a7', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/ci/licenses_golden/licenses_skia b/ci/licenses_golden/licenses_skia index 57d23fe496744..22f9a54bbd92a 100644 --- a/ci/licenses_golden/licenses_skia +++ b/ci/licenses_golden/licenses_skia @@ -1,4 +1,4 @@ -Signature: 17db75aebf1d4946c4ee3afccb724c51 +Signature: 8aeca91f52546bbdbc8acc4155644a0d UNUSED LICENSES: diff --git a/shell/platform/android/io/flutter/Log.java b/shell/platform/android/io/flutter/Log.java index a4696c96eb616..1cfa51ff98ac3 100644 --- a/shell/platform/android/io/flutter/Log.java +++ b/shell/platform/android/io/flutter/Log.java @@ -9,41 +9,54 @@ import io.flutter.BuildConfig; /** - * Port of {@link android.util.Log} that only logs in {@link BuildConfig#DEBUG} mode. + * Port of {@link android.util.Log} that only logs in {@link BuildConfig#DEBUG} mode and + * internally filters logs based on a {@link #logLevel}. */ public class Log { + private static int logLevel = android.util.Log.DEBUG; + + /** + * Sets a log cutoff such that a log level of lower priority than {@code logLevel} is + * filtered out. + *

+ * See {@link android.util.Log} for log level constants. + */ + public static void setLogLevel(int logLevel) { + Log.logLevel = logLevel; + } + public static void v(@NonNull String tag, @NonNull String message) { - if (BuildConfig.DEBUG) { + if (BuildConfig.DEBUG && logLevel >= android.util.Log.VERBOSE) { android.util.Log.v(tag, message); } } public static void v(@NonNull String tag, @NonNull String message, @NonNull Throwable tr) { - if (BuildConfig.DEBUG) { + if (BuildConfig.DEBUG && logLevel >= android.util.Log.VERBOSE) { android.util.Log.v(tag, message, tr); } } public static void i(@NonNull String tag, @NonNull String message) { - if (BuildConfig.DEBUG) { + if (BuildConfig.DEBUG && logLevel >= android.util.Log.INFO) { android.util.Log.i(tag, message); } } public static void i(@NonNull String tag, @NonNull String message, @NonNull Throwable tr) { - if (BuildConfig.DEBUG) { + if (BuildConfig.DEBUG && logLevel >= android.util.Log.INFO) { android.util.Log.i(tag, message, tr); } } public static void d(@NonNull String tag, @NonNull String message) { - if (BuildConfig.DEBUG) { + if (BuildConfig.DEBUG && logLevel >= android.util.Log.DEBUG) { android.util.Log.d(tag, message); } } public static void d(@NonNull String tag, @NonNull String message, @NonNull Throwable tr) { - if (BuildConfig.DEBUG) { + if (BuildConfig.DEBUG && logLevel >= android.util.Log.DEBUG) { android.util.Log.d(tag, message, tr); } } diff --git a/testing/ios/IosUnitTests/IosUnitTests.xcodeproj/project.pbxproj b/testing/ios/IosUnitTests/IosUnitTests.xcodeproj/project.pbxproj index ed344fbc8e564..0fbb5662cd4dc 100644 --- a/testing/ios/IosUnitTests/IosUnitTests.xcodeproj/project.pbxproj +++ b/testing/ios/IosUnitTests/IosUnitTests.xcodeproj/project.pbxproj @@ -15,6 +15,7 @@ 0D6AB6C422BB05E200EEE540 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D6AB6C322BB05E200EEE540 /* main.m */; }; 0D6AB6EB22BB40E700EEE540 /* FlutterEngineTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0D6AB6E722BB40CF00EEE540 /* FlutterEngineTest.mm */; }; 0D6AB72C22BC339F00EEE540 /* libOCMock.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0D6AB72522BC336100EEE540 /* libOCMock.a */; }; + 0D6AB73F22BD8F0200EEE540 /* FlutterEngineConfig.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 0D6AB73E22BD8F0200EEE540 /* FlutterEngineConfig.xcconfig */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -84,6 +85,7 @@ 0D6AB6CF22BB05E200EEE540 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 0D6AB6E722BB40CF00EEE540 /* FlutterEngineTest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FlutterEngineTest.mm; sourceTree = ""; }; 0D6AB71722BC336100EEE540 /* OCMock.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = OCMock.xcodeproj; path = ../../../../../third_party/ocmock/Source/OCMock.xcodeproj; sourceTree = ""; }; + 0D6AB73E22BD8F0200EEE540 /* FlutterEngineConfig.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = FlutterEngineConfig.xcconfig; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -146,6 +148,7 @@ 0D6AB71722BC336100EEE540 /* OCMock.xcodeproj */, 0D6AB6E622BB409F00EEE540 /* Source */, 0D6AB6CF22BB05E200EEE540 /* Info.plist */, + 0D6AB73E22BD8F0200EEE540 /* FlutterEngineConfig.xcconfig */, ); path = Tests; sourceTree = ""; @@ -321,6 +324,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 0D6AB73F22BD8F0200EEE540 /* FlutterEngineConfig.xcconfig in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -549,6 +553,7 @@ }; 0D6AB6D622BB05E200EEE540 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 0D6AB73E22BD8F0200EEE540 /* FlutterEngineConfig.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; @@ -577,7 +582,7 @@ ); OTHER_LDFLAGS = ( "-L", - ../../../../out/ios_debug_sim_unopt, + ../../../../out/$FLUTTER_ENGINE, "-lFlutter", "-lOCMock", "-ObjC", @@ -592,6 +597,7 @@ }; 0D6AB6D722BB05E200EEE540 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 0D6AB73E22BD8F0200EEE540 /* FlutterEngineConfig.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; @@ -620,7 +626,7 @@ ); OTHER_LDFLAGS = ( "-L", - ../../../../out/ios_debug_sim_unopt, + ../../../../out/$FLUTTER_ENGINE, "-lFlutter", "-lOCMock", "-ObjC", diff --git a/testing/ios/IosUnitTests/Tests/FlutterEngineConfig.xcconfig b/testing/ios/IosUnitTests/Tests/FlutterEngineConfig.xcconfig new file mode 100644 index 0000000000000..8d3437a336fb1 --- /dev/null +++ b/testing/ios/IosUnitTests/Tests/FlutterEngineConfig.xcconfig @@ -0,0 +1 @@ +FLUTTER_ENGINE=ios_debug_sim_unopt diff --git a/testing/ios/IosUnitTests/build_and_run_tests.sh b/testing/ios/IosUnitTests/build_and_run_tests.sh new file mode 100755 index 0000000000000..f307604a5b048 --- /dev/null +++ b/testing/ios/IosUnitTests/build_and_run_tests.sh @@ -0,0 +1,6 @@ +pushd $PWD +cd ../../../.. +./flutter/tools/gn --ios --simulator --unoptimized +ninja -j 100 -C out/ios_debug_sim_unopt +popd +./run_tests.sh ios_debug_sim_unopt diff --git a/testing/ios/IosUnitTests/run_tests.sh b/testing/ios/IosUnitTests/run_tests.sh index ee45a093adcfb..806693a923211 100755 --- a/testing/ios/IosUnitTests/run_tests.sh +++ b/testing/ios/IosUnitTests/run_tests.sh @@ -1,9 +1,16 @@ -pushd $PWD -cd ../../../.. -./flutter/tools/gn --ios --simulator --unoptimized -ninja -j 100 -C out/ios_debug_sim_unopt/ -popd +FLUTTER_ENGINE=ios_debug_sim_unopt + +if [ $# -eq 1 ]; then + FLUTTER_ENGINE=$1 +fi + +PRETTY="cat" +if which xcpretty; then + PRETTY="xcpretty" +fi + xcodebuild -sdk iphonesimulator \ -scheme IosUnitTests \ -destination 'platform=iOS Simulator,name=iPhone SE,OS=12.2' \ - test \ No newline at end of file + test \ + FLUTTER_ENGINE=$FLUTTER_ENGINE | $PRETTY