From 72cb3985424f931d955ff425e8c065bcfa9799a0 Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Fri, 14 Apr 2023 12:04:19 -0700 Subject: [PATCH] [macOS] Build unittests on all macOS host builds Whether we're building an x64 or arm64 macOS host build, always build unit tests. Also removes the --enable-unittests gn config option since it was added specifically for macOS in https://github.com/flutter/engine/pull/40242. Issue: https://github.com/flutter/flutter/issues/124840 --- testing/testing.gni | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/testing/testing.gni b/testing/testing.gni index 3fadcbbc71e16..7059bc15f017b 100644 --- a/testing/testing.gni +++ b/testing/testing.gni @@ -10,9 +10,12 @@ import("//third_party/dart/sdk_args.gni") is_aot_test = flutter_runtime_mode == "profile" || flutter_runtime_mode == "release" -# Unit tests targets are only enabled for host machines and Fuchsia right now +# Build unit tests when any of the following are true: +# * host_toolchain: non-cross-compile, so we can run tests on the host. +# * is_mac: arm64 builds can run x64 binaries. +# * is_fuchsia: build unittests for testing on device. declare_args() { - enable_unittests = current_toolchain == host_toolchain || is_fuchsia + enable_unittests = current_toolchain == host_toolchain || is_fuchsia || is_mac } # Creates a translation unit that defines the flutter::testing::GetFixturesPath