diff --git a/BUILD.gn b/BUILD.gn index edac93a4acfaaafeb0403374047d94348f784737..80da512d06aa849f3f54d5cd53a7e97df4064b78 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -4,10 +4,7 @@ import("//flutter/common/config.gni") import("//flutter/shell/platform/config.gni") - -if (is_fuchsia) { - import("//build/fuchsia/sdk.gni") -} +import("//flutter/testing/testing.gni") # Whether to build the dartdevc sdk, libraries, and source files # required for the flutter web sdk. @@ -15,40 +12,54 @@ declare_args() { full_dart_sdk = false } -group("flutter") { - testonly = true +config("config") { + include_dirs = [ ".." ] + if (is_win) { + if (current_cpu != "x86") { + cflags = [ "/WX" ] # Treat warnings as errors. + } + } +} - public_deps = [] +# This "fuchsia_legacy" configuration includes old, non-embedder API sources and +# defines the LEGACY_FUCHSIA_EMBEDDER symbol. This config and its associated +# template are both transitional and will be removed after the embedder API +# transition is complete. +# +# See `source_set_maybe_fuchsia_legacy` in //flutter/common/config.gni +# +# TODO(fxb/54041): Remove when no longer neccesary. +config("fuchsia_legacy") { + if (is_fuchsia) { + defines = [ "LEGACY_FUCHSIA_EMBEDDER" ] + } +} - if (!is_fuchsia) { - public_deps += [ - "//flutter/lib/snapshot:generate_snapshot_bin", - "//flutter/lib/snapshot:kernel_platform_files", +config("export_dynamic_symbols") { + if (is_linux || is_fuchsia) { + inputs = [ + "//flutter/common/exported_symbols.sym", ] + ldflags = [ "-Wl,--dynamic-list=" + rebase_path(inputs[0], root_build_dir) ] } +} - public_deps += [ +group("flutter") { + testonly = true + + # Compile the engine. + public_deps = [ "//flutter/shell/platform/embedder:flutter_engine", "//flutter/sky", ] - if (current_toolchain == host_toolchain) { - public_deps += [ "//flutter/tools/font-subset" ] - } - - if (current_toolchain == host_toolchain) { - public_deps += [ "//flutter/shell/testing" ] - public_deps += [ "//flutter/tools/const_finder" ] - } - - if (is_fuchsia) { + # If enbaled, compile the SDK / snapshot. + if (!is_fuchsia) { public_deps += [ - "//flutter/shell/platform/fuchsia", - "//flutter/shell/testing($host_toolchain)", + "//flutter/lib/snapshot:generate_snapshot_bin", + "//flutter/lib/snapshot:kernel_platform_files", ] - } - if (!is_fuchsia) { if (current_toolchain == host_toolchain) { public_deps += [ "//flutter/flutter_frontend_server:frontend_server", @@ -61,93 +72,95 @@ group("flutter") { } } - # If on the host, compile all unittests targets. + # If on the host, compile tools. if (current_toolchain == host_toolchain) { - if (is_mac) { - public_deps += - [ "//flutter/shell/platform/darwin:flutter_channels_unittests" ] - } + public_deps += [ + "//flutter/shell/testing", + "//flutter/tools/const_finder", + "//flutter/tools/font-subset", + ] + } + + # Compile all benchmark targets if enabled. + if (enable_unittests && !is_win) { + public_deps += [ + "//flutter/fml:fml_benchmarks", + "//flutter/lib/ui:ui_benchmarks", + "//flutter/shell/common:shell_benchmarks", + "//flutter/third_party/txt:txt_benchmarks", + ] + } + # Compile all unittests targets if enabled. + if (enable_unittests) { public_deps += [ "//flutter/flow:flow_unittests", "//flutter/fml:fml_unittests", "//flutter/lib/ui:ui_unittests", "//flutter/runtime:runtime_unittests", "//flutter/shell/common:shell_unittests", - "//flutter/shell/platform/embedder:embedder_unittests", "//flutter/testing:testing_unittests", "//flutter/third_party/txt:txt_unittests", ] - if (!is_win) { + if (is_fuchsia) { + public_deps += [ "//flutter/shell/platform/fuchsia:tests" ] + } + + if (is_mac) { + public_deps += + [ "//flutter/shell/platform/darwin:flutter_channels_unittests" ] + } + + if (!is_win && !is_fuchsia) { public_deps += [ - "//flutter/fml:fml_benchmarks", - "//flutter/lib/ui:ui_benchmarks", - "//flutter/shell/common:shell_benchmarks", "//flutter/shell/platform/android/external_view_embedder:android_external_view_embedder_unittests", "//flutter/shell/platform/android/jni:jni_unittests", - "//flutter/third_party/txt:txt_benchmarks", ] } + # TODO(): Enable embedder_unittests on fucsia. + if (!is_fuchsia) { + public_deps += [ "//flutter/shell/platform/embedder:embedder_unittests" ] + } + # Unit tests for desktop embeddings should only be built if the desktop # embeddings are being built. if (enable_desktop_embeddings) { public_deps += [ "//flutter/shell/platform/common/cpp:common_cpp_core_unittests", - "//flutter/shell/platform/common/cpp:common_cpp_unittests", "//flutter/shell/platform/common/cpp/client_wrapper:client_wrapper_unittests", - "//flutter/shell/platform/glfw/client_wrapper:client_wrapper_glfw_unittests", ] + + if (!is_fuchsia) { + # These tests require the embedder and thus cannot run on fuchsia. + # TODO(): Enable when embedder works on fuchsia. + public_deps += + [ "//flutter/shell/platform/common/cpp:common_cpp_unittests" ] + + # These tests require GLFW and thus cannot run on fuchsia. + public_deps += [ "//flutter/shell/platform/glfw/client_wrapper:client_wrapper_glfw_unittests" ] + } + + if (is_linux) { + public_deps += + [ "//flutter/shell/platform/linux:flutter_linux_unittests" ] + } + if (is_mac) { public_deps += [ "//flutter/shell/platform/darwin/macos:flutter_desktop_darwin_unittests" ] } + if (is_win) { public_deps += [ "//flutter/shell/platform/windows:flutter_windows_unittests", "//flutter/shell/platform/windows/client_wrapper:client_wrapper_windows_unittests", ] } - if (is_linux) { - public_deps += - [ "//flutter/shell/platform/linux:flutter_linux_unittests" ] - } } } } -config("config") { - include_dirs = [ ".." ] - if (is_win) { - if (current_cpu != "x86") { - cflags = [ "/WX" ] # Treat warnings as errors. - } - } -} - -# This "fuchsia_legacy" configuration includes old, non-embedder API sources and -# defines the LEGACY_FUCHSIA_EMBEDDER symbol. This config and its associated -# template are both transitional and will be removed after the embedder API -# transition is complete. -# -# See `source_set_maybe_fuchsia_legacy` in //flutter/common/config.gni -# -# TODO(fxb/54041): Remove when no longer neccesary. -config("fuchsia_legacy") { - if (is_fuchsia) { - defines = [ "LEGACY_FUCHSIA_EMBEDDER" ] - } -} - -config("export_dynamic_symbols") { - if (is_linux || is_fuchsia) { - inputs = [ - "//flutter/common/exported_symbols.sym", - ] - ldflags = [ "-Wl,--dynamic-list=" + rebase_path(inputs[0], root_build_dir) ] - } -} - group("dist") { testonly = true @@ -156,23 +169,12 @@ group("dist") { ] } -# Fuchsia currently only supports a subset of our unit tests -# When adding a new dep here, please also ensure the dep is added to -# testing/fuchsia/run_tests.sh and testing/fuchsia/test_fars if (is_fuchsia) { group("fuchsia_tests") { testonly = true deps = [ - "//flutter/flow:flow_tests", - "//flutter/flow:flow_tests_next", - "//flutter/fml:fml_tests", - "//flutter/runtime:runtime_tests", - "//flutter/runtime:runtime_tests_next", - "//flutter/shell/common:shell_tests", - "//flutter/shell/common:shell_tests_next", - "//flutter/shell/platform/fuchsia/flutter:flutter_runner_scenic_tests", - "//flutter/shell/platform/fuchsia/flutter:flutter_runner_tests", + "//flutter/shell/platform/fuchsia:tests", ] } } diff --git a/common/config.gni b/common/config.gni index 3e2fbb624d45ecdac6a309b0dcffaef856e46235..c0727a6f8b6f4a15329e4c5c512dab17109a3f4f 100644 --- a/common/config.gni +++ b/common/config.gni @@ -6,27 +6,16 @@ if (is_android) { import("//build/config/android/config.gni") } -import("//build/fuchsia/sdk.gni") - if (target_cpu == "arm" || target_cpu == "arm64") { import("//build/config/arm.gni") } -if (is_fuchsia) { - import("//build/toolchain/clang.gni") -} - declare_args() { # The runtime mode ("debug", "profile", "release", or "jit_release") flutter_runtime_mode = "debug" # Whether to use the Skia text shaper module flutter_enable_skshaper = false - - # A copy of the enable_bitcode flag from build/toolchain/clang.gni. - # This needs to be mirrored here because build/toolchain/clang.gni does - # not exist in the Fuchsia source tree. - flutter_enable_bitcode = false } # feature_defines_list --------------------------------------------------------- @@ -60,15 +49,6 @@ if (flutter_runtime_mode == "debug") { feature_defines_list += [ "FLUTTER_RUNTIME_MODE=0" ] } -if (is_fuchsia) { - # TODO(chinmaygarde): This is always set. The macro may now be removed. - feature_defines_list += [ "FUCHSIA_SDK=1" ] -} - -if ((is_ios || is_mac) && defined(enable_bitcode)) { - flutter_enable_bitcode = enable_bitcode -} - if (is_ios || is_mac) { flutter_cflags_objc = [ "-Werror=overriding-method-mismatch", diff --git a/flow/BUILD.gn b/flow/BUILD.gn index bd7f20e5bc31886c9bcfe7ef27d4ea949407b34b..643311cf98fd322a8eb7fd37a60190eff30d960c 100644 --- a/flow/BUILD.gn +++ b/flow/BUILD.gn @@ -2,12 +2,9 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//build/fuchsia/sdk.gni") import("//flutter/common/config.gni") import("//flutter/testing/testing.gni") -if (is_fuchsia) { - import("//build/fuchsia/sdk.gni") - import("//flutter/tools/fuchsia/fuchsia_archive.gni") -} source_set_maybe_fuchsia_legacy("flow") { sources = [ @@ -97,179 +94,113 @@ source_set_maybe_fuchsia_legacy("flow") { ] } -test_fixtures("flow_fixtures") { - fixtures = [] -} - -source_set_maybe_fuchsia_legacy("flow_testing") { - testonly = true - - sources = [ - "testing/gl_context_switch_test.cc", - "testing/gl_context_switch_test.h", - "testing/layer_test.h", - "testing/mock_layer.cc", - "testing/mock_layer.h", - "testing/mock_raster_cache.cc", - "testing/mock_raster_cache.h", - "testing/mock_texture.cc", - "testing/mock_texture.h", - "testing/skia_gpu_object_layer_test.cc", - "testing/skia_gpu_object_layer_test.h", - ] - - public_deps = [ - "//flutter/testing:skia", - "//third_party/googletest:gtest", - ] - - deps_legacy_and_next = [ ":flow" ] -} - -source_set_maybe_fuchsia_legacy("flow_unittests_common") { - testonly = true - - sources = [ - "embedded_view_params_unittests.cc", - "flow_run_all_unittests.cc", - "flow_test_utils.cc", - "flow_test_utils.h", - "gl_context_switch_unittests.cc", - "layers/backdrop_filter_layer_unittests.cc", - "layers/clip_path_layer_unittests.cc", - "layers/clip_rect_layer_unittests.cc", - "layers/clip_rrect_layer_unittests.cc", - "layers/color_filter_layer_unittests.cc", - "layers/container_layer_unittests.cc", - "layers/image_filter_layer_unittests.cc", - "layers/layer_tree_unittests.cc", - "layers/opacity_layer_unittests.cc", - "layers/performance_overlay_layer_unittests.cc", - "layers/physical_shape_layer_unittests.cc", - "layers/picture_layer_unittests.cc", - "layers/platform_view_layer_unittests.cc", - "layers/shader_mask_layer_unittests.cc", - "layers/texture_layer_unittests.cc", - "layers/transform_layer_unittests.cc", - "matrix_decomposition_unittests.cc", - "mutators_stack_unittests.cc", - "raster_cache_unittests.cc", - "rtree_unittests.cc", - "skia_gpu_object_unittests.cc", - "testing/mock_layer_unittests.cc", - "testing/mock_texture_unittests.cc", - "texture_unittests.cc", - ] - - deps = [ - ":flow_fixtures", - "//flutter/fml", - "//flutter/testing:skia", - "//flutter/testing:testing_lib", - "//third_party/dart/runtime:libdart_jit", # for tracing - "//third_party/googletest:gtest", - "//third_party/skia", - ] - - sources_legacy = [ "layers/fuchsia_layer_unittests.cc" ] - - deps_legacy = [ "//build/fuchsia/pkg:sys_cpp_testing" ] - - deps_legacy_and_next = [ - ":flow", - ":flow_testing", - ] -} +if (enable_unittests) { + test_fixtures("flow_fixtures") { + fixtures = [] + } -if (is_fuchsia) { - executable("flow_unittests") { + source_set_maybe_fuchsia_legacy("flow_testing") { testonly = true - deps = [ - ":flow_unittests_common_fuchsia_legacy", + sources = [ + "testing/gl_context_switch_test.cc", + "testing/gl_context_switch_test.h", + "testing/layer_test.h", + "testing/mock_layer.cc", + "testing/mock_layer.h", + "testing/mock_raster_cache.cc", + "testing/mock_raster_cache.h", + "testing/mock_texture.cc", + "testing/mock_texture.h", + "testing/skia_gpu_object_layer_test.cc", + "testing/skia_gpu_object_layer_test.h", ] - } - executable("flow_unittests_next") { - testonly = true - deps = [ - ":flow_unittests_common", + public_deps = [ + "//flutter/testing:skia", + "//third_party/googletest:gtest", ] - } -} else { - executable("flow_unittests") { - testonly = true - deps = [ - ":flow_unittests_common", - ] + deps_legacy_and_next = [ ":flow" ] } -} -if (is_fuchsia) { - fuchsia_archive("flow_tests") { + source_set_maybe_fuchsia_legacy("flow_unittests_common") { testonly = true - deps = [ - ":flow_unittests", + sources = [ + "embedded_view_params_unittests.cc", + "flow_run_all_unittests.cc", + "flow_test_utils.cc", + "flow_test_utils.h", + "gl_context_switch_unittests.cc", + "layers/backdrop_filter_layer_unittests.cc", + "layers/clip_path_layer_unittests.cc", + "layers/clip_rect_layer_unittests.cc", + "layers/clip_rrect_layer_unittests.cc", + "layers/color_filter_layer_unittests.cc", + "layers/container_layer_unittests.cc", + "layers/image_filter_layer_unittests.cc", + "layers/layer_tree_unittests.cc", + "layers/opacity_layer_unittests.cc", + "layers/performance_overlay_layer_unittests.cc", + "layers/physical_shape_layer_unittests.cc", + "layers/picture_layer_unittests.cc", + "layers/platform_view_layer_unittests.cc", + "layers/shader_mask_layer_unittests.cc", + "layers/texture_layer_unittests.cc", + "layers/transform_layer_unittests.cc", + "matrix_decomposition_unittests.cc", + "mutators_stack_unittests.cc", + "raster_cache_unittests.cc", + "rtree_unittests.cc", + "skia_gpu_object_unittests.cc", + "testing/mock_layer_unittests.cc", + "testing/mock_texture_unittests.cc", + "texture_unittests.cc", ] - binary = "flow_unittests" - - libraries = common_libs - - meta_dir = "//flutter/testing/fuchsia/meta" - cmx_file = "$meta_dir/fuchsia_test.cmx" - - resources = [ - { - path = rebase_path( - "//flutter/testing/resources/performance_overlay_gold_60fps.png") - dest = "flutter/testing/resources/performance_overlay_gold_60fps.png" - }, - { - path = rebase_path( - "//flutter/testing/resources/performance_overlay_gold_90fps.png") - dest = "flutter/testing/resources/performance_overlay_gold_90fps.png" - }, - { - path = rebase_path( - "//flutter/testing/resources/performance_overlay_gold_120fps.png") - dest = "flutter/testing/resources/performance_overlay_gold_120fps.png" - }, - ] - } - - fuchsia_archive("flow_tests_next") { - testonly = true - deps = [ - ":flow_unittests_next", + ":flow_fixtures", + "//flutter/fml", + "//flutter/testing:skia", + "//flutter/testing:testing_lib", + "//third_party/dart/runtime:libdart_jit", # for tracing + "//third_party/googletest:gtest", + "//third_party/skia", ] - binary = "flow_unittests_next" - - libraries = common_libs + sources_legacy = [ "layers/fuchsia_layer_unittests.cc" ] - meta_dir = "//flutter/testing/fuchsia/meta" - cmx_file = "$meta_dir/fuchsia_test.cmx" + deps_legacy = [ "//build/fuchsia/pkg:sys_cpp_testing" ] - resources = [ - { - path = rebase_path( - "//flutter/testing/resources/performance_overlay_gold_60fps.png") - dest = "flutter/testing/resources/performance_overlay_gold_60fps.png" - }, - { - path = rebase_path( - "//flutter/testing/resources/performance_overlay_gold_90fps.png") - dest = "flutter/testing/resources/performance_overlay_gold_90fps.png" - }, - { - path = rebase_path( - "//flutter/testing/resources/performance_overlay_gold_120fps.png") - dest = "flutter/testing/resources/performance_overlay_gold_120fps.png" - }, + deps_legacy_and_next = [ + ":flow", + ":flow_testing", ] } + + if (is_fuchsia) { + executable("flow_unittests") { + testonly = true + + deps = [ + ":flow_unittests_common_fuchsia_legacy", + ] + } + executable("flow_unittests_next") { + testonly = true + + deps = [ + ":flow_unittests_common", + ] + } + } else { + executable("flow_unittests") { + testonly = true + + deps = [ + ":flow_unittests_common", + ] + } + } } diff --git a/fml/BUILD.gn b/fml/BUILD.gn index 44c4d00b4be61eee73edd72f3a4de0c02a0752ac..8673841db57fc7010c957d4fc5da4dd760397d39 100644 --- a/fml/BUILD.gn +++ b/fml/BUILD.gn @@ -2,10 +2,8 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -if (is_fuchsia) { - import("//build/fuchsia/sdk.gni") - import("//flutter/tools/fuchsia/fuchsia_archive.gni") -} +import("//build/fuchsia/sdk.gni") +import("//flutter/common/config.gni") import("//flutter/testing/testing.gni") source_set("fml") { @@ -224,80 +222,73 @@ source_set("fml") { } } -test_fixtures("fml_fixtures") { - fixtures = [] -} +if (enable_unittests) { + test_fixtures("fml_fixtures") { + fixtures = [] + } -executable("fml_unittests") { - testonly = true + executable("fml_benchmarks") { + testonly = true - sources = [ - "ascii_trie_unittests.cc", - "backtrace_unittests.cc", - "base32_unittest.cc", - "command_line_unittest.cc", - "file_unittest.cc", - "hash_combine_unittests.cc", - "memory/ref_counted_unittest.cc", - "memory/task_runner_checker_unittest.cc", - "memory/weak_ptr_unittest.cc", - "message_loop_task_queues_merge_unmerge_unittests.cc", - "message_loop_task_queues_unittests.cc", - "message_loop_unittests.cc", - "message_unittests.cc", - "paths_unittests.cc", - "raster_thread_merger_unittests.cc", - "synchronization/count_down_latch_unittests.cc", - "synchronization/semaphore_unittest.cc", - "synchronization/sync_switch_unittest.cc", - "synchronization/waitable_event_unittest.cc", - "thread_local_unittests.cc", - "thread_unittests.cc", - "time/time_delta_unittest.cc", - "time/time_point_unittest.cc", - "time/time_unittest.cc", - ] + sources = [ + "message_loop_task_queues_benchmark.cc", + ] - if (is_mac) { - sources += [ - "platform/darwin/cf_utils_unittests.mm", - "platform/darwin/string_range_sanitization_unittests.mm", + deps = [ + "//flutter/benchmarking", + "//flutter/fml", + "//flutter/runtime:libdart", ] } - deps = [ - ":fml_fixtures", - "//flutter/fml", - "//flutter/fml/dart", - "//flutter/runtime:libdart", - "//flutter/testing", - ] + executable("fml_unittests") { + testonly = true + + sources = [ + "ascii_trie_unittests.cc", + "backtrace_unittests.cc", + "base32_unittest.cc", + "command_line_unittest.cc", + "file_unittest.cc", + "hash_combine_unittests.cc", + "memory/ref_counted_unittest.cc", + "memory/task_runner_checker_unittest.cc", + "memory/weak_ptr_unittest.cc", + "message_loop_task_queues_merge_unmerge_unittests.cc", + "message_loop_task_queues_unittests.cc", + "message_loop_unittests.cc", + "message_unittests.cc", + "paths_unittests.cc", + "raster_thread_merger_unittests.cc", + "synchronization/count_down_latch_unittests.cc", + "synchronization/semaphore_unittest.cc", + "synchronization/sync_switch_unittest.cc", + "synchronization/waitable_event_unittest.cc", + "thread_local_unittests.cc", + "thread_unittests.cc", + "time/time_delta_unittest.cc", + "time/time_point_unittest.cc", + "time/time_unittest.cc", + ] - if (is_fuchsia) { - libs = [ "${fuchsia_sdk_path}/arch/${target_cpu}/sysroot/lib/libzircon.so" ] - } -} + if (is_mac) { + sources += [ + "platform/darwin/cf_utils_unittests.mm", + "platform/darwin/string_range_sanitization_unittests.mm", + ] + } -if (is_fuchsia) { - fuchsia_test_archive("fml_tests") { deps = [ - ":fml_unittests", + ":fml_fixtures", + "//flutter/fml", + "//flutter/fml/dart", + "//flutter/runtime:libdart", + "//flutter/testing", ] - binary = "fml_unittests" + if (is_fuchsia) { + libs = + [ "${fuchsia_sdk_path}/arch/${target_cpu}/sysroot/lib/libzircon.so" ] + } } } - -executable("fml_benchmarks") { - testonly = true - - sources = [ - "message_loop_task_queues_benchmark.cc", - ] - - deps = [ - "//flutter/benchmarking", - "//flutter/fml", - "//flutter/runtime:libdart", - ] -} diff --git a/lib/ui/BUILD.gn b/lib/ui/BUILD.gn index c5b21b82273b40c5a1d19503c771157a36506dd1..06a950461a53a304b604f7c98d2e17c00b216eeb 100644 --- a/lib/ui/BUILD.gn +++ b/lib/ui/BUILD.gn @@ -142,7 +142,7 @@ source_set_maybe_fuchsia_legacy("ui") { deps_legacy_and_next = [ "//flutter/flow:flow" ] } -if (current_toolchain == host_toolchain) { +if (enable_unittests) { test_fixtures("ui_unittests_fixtures") { dart_main = "fixtures/ui_test.dart" fixtures = [ @@ -154,47 +154,80 @@ if (current_toolchain == host_toolchain) { ] } - executable("ui_unittests") { + executable("ui_benchmarks") { testonly = true - configs += [ "//flutter:export_dynamic_symbols" ] + public_configs = [ "//flutter:export_dynamic_symbols" ] sources = [ - "painting/image_decoder_unittests.cc", - "painting/image_encoding_unittests.cc", - "painting/vertices_unittests.cc", - "window/pointer_data_packet_converter_unittests.cc", + "ui_benchmarks.cc", ] deps = [ ":ui", ":ui_unittests_fixtures", - "//flutter/common", - "//flutter/shell/common:shell_test_fixture_sources", - "//flutter/testing", - "//flutter/testing:dart", + "//flutter/benchmarking", + "//flutter/shell/common", "//flutter/testing:fixture_test", - "//flutter/testing:opengl", - "//flutter/third_party/tonic", - "//third_party/dart/runtime/bin:elf_loader", ] } - executable("ui_benchmarks") { + source_set_maybe_fuchsia_legacy("ui_unittests_common") { testonly = true - configs += [ "//flutter:export_dynamic_symbols" ] + public_configs = [ "//flutter:export_dynamic_symbols" ] sources = [ - "ui_benchmarks.cc", + "painting/image_encoding_unittests.cc", + "painting/vertices_unittests.cc", + "window/pointer_data_packet_converter_unittests.cc", ] deps = [ - ":ui", ":ui_unittests_fixtures", - "//flutter/benchmarking", - "//flutter/shell/common:common", + "//flutter/common", + "//flutter/testing", + "//flutter/third_party/tonic", + "//third_party/dart/runtime/bin:elf_loader", + ] + + # TODO(): This test is hard-coded to use a TestGLSurface so it cannot run on fuchsia. + if (!is_fuchsia) { + sources += [ "painting/image_decoder_unittests.cc" ] + + deps += [ "//flutter/testing:opengl" ] + } + + deps_legacy_and_next = [ + ":ui", + "//flutter/shell/common:shell_test_fixture_sources", + "//flutter/testing:dart", "//flutter/testing:fixture_test", ] } + + if (is_fuchsia) { + executable("ui_unittests") { + testonly = true + + deps = [ + ":ui_unittests_common_fuchsia_legacy", + ] + } + executable("ui_unittests_next") { + testonly = true + + deps = [ + ":ui_unittests_common", + ] + } + } else { + executable("ui_unittests") { + testonly = true + + deps = [ + ":ui_unittests_common", + ] + } + } } diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn index a25b428e180fc0d65ca3b24da42935f0b27a3916..3cf9cb75739bd50b7bee68ab58d669e182126070 100644 --- a/runtime/BUILD.gn +++ b/runtime/BUILD.gn @@ -4,9 +4,6 @@ import("//flutter/common/config.gni") import("//flutter/testing/testing.gni") -if (is_fuchsia) { - import("//flutter/tools/fuchsia/fuchsia_archive.gni") -} source_set("test_font") { sources = [ @@ -105,107 +102,65 @@ source_set_maybe_fuchsia_legacy("runtime") { ] } -test_fixtures("runtime_fixtures") { - dart_main = "fixtures/runtime_test.dart" -} - -source_set_maybe_fuchsia_legacy("runtime_unittests_common") { - testonly = true - - sources = [ - "dart_isolate_unittests.cc", - "dart_lifecycle_unittests.cc", - "dart_service_isolate_unittests.cc", - "dart_vm_unittests.cc", - ] - - public_deps = [ - ":libdart", - ":runtime_fixtures", - "//flutter/common", - "//flutter/fml", - "//flutter/lib/snapshot", - "//flutter/testing", - "//flutter/third_party/tonic", - "//third_party/dart/runtime/bin:elf_loader", - "//third_party/skia", - ] - - deps_legacy_and_next = [ - ":runtime", - "//flutter/testing:dart", - "//flutter/testing:fixture_test", - ] -} - -if (is_fuchsia) { - executable("runtime_unittests") { - testonly = true - - configs += [ "//flutter:export_dynamic_symbols" ] - - deps = [ - ":runtime_unittests_common_fuchsia_legacy", - ] +if (enable_unittests) { + test_fixtures("runtime_fixtures") { + dart_main = "fixtures/runtime_test.dart" } - executable("runtime_unittests_next") { + source_set_maybe_fuchsia_legacy("runtime_unittests_common") { testonly = true - configs += [ "//flutter:export_dynamic_symbols" ] - - deps = [ - ":runtime_unittests_common", + sources = [ + "dart_isolate_unittests.cc", + "dart_lifecycle_unittests.cc", + "dart_service_isolate_unittests.cc", + "dart_vm_unittests.cc", ] - } -} else { - executable("runtime_unittests") { - testonly = true - - configs += [ "//flutter:export_dynamic_symbols" ] - deps = [ - ":runtime_unittests_common", - ] - } -} + public_configs = [ "//flutter:export_dynamic_symbols" ] -if (is_fuchsia) { - fuchsia_test_archive("runtime_tests") { - deps = [ + public_deps = [ + ":libdart", ":runtime_fixtures", - ":runtime_unittests", + "//flutter/common", + "//flutter/fml", + "//flutter/lib/snapshot", + "//flutter/testing", + "//flutter/third_party/tonic", + "//third_party/dart/runtime/bin:elf_loader", + "//third_party/skia", ] - binary = "runtime_unittests" - - # TODO(gw280): https://github.com/flutter/flutter/issues/50294 - # Right now we need to manually specify all the fixtures that are - # declared in the test_fixtures() call above. - resources = [ - { - path = "$target_gen_dir/assets/kernel_blob.bin" - dest = "assets/kernel_blob.bin" - }, + deps_legacy_and_next = [ + ":runtime", + "//flutter/testing:dart", + "//flutter/testing:fixture_test", ] } - fuchsia_test_archive("runtime_tests_next") { - deps = [ - ":runtime_fixtures", - ":runtime_unittests_next", - ] + if (is_fuchsia) { + executable("runtime_unittests") { + testonly = true - binary = "runtime_unittests_next" + deps = [ + ":runtime_unittests_common_fuchsia_legacy", + ] + } - # TODO(gw280): https://github.com/flutter/flutter/issues/50294 - # Right now we need to manually specify all the fixtures that are - # declared in the test_fixtures() call above. - resources = [ - { - path = "$target_gen_dir/assets/kernel_blob.bin" - dest = "assets/kernel_blob.bin" - }, - ] + executable("runtime_unittests_next") { + testonly = true + + deps = [ + ":runtime_unittests_common", + ] + } + } else { + executable("runtime_unittests") { + testonly = true + + deps = [ + ":runtime_unittests_common", + ] + } } } diff --git a/shell/common/BUILD.gn b/shell/common/BUILD.gn index 38c35a34e89d6bca8880439e1cb160004bbb2a7f..e4d1c956658b98efa102198df80056e0de28f651 100644 --- a/shell/common/BUILD.gn +++ b/shell/common/BUILD.gn @@ -2,27 +2,10 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//build/fuchsia/sdk.gni") import("//flutter/common/config.gni") import("//flutter/shell/gpu/gpu.gni") import("//flutter/testing/testing.gni") -import("//flutter/vulkan/config.gni") - -if (is_fuchsia) { - import("//build/fuchsia/sdk.gni") - import("//flutter/tools/fuchsia/fuchsia_archive.gni") -} - -config("vulkan_config") { - if (is_fuchsia) { - include_dirs = [ "$fuchsia_sdk_root/vulkan/include" ] - } else { - include_dirs = [ "//third_party/vulkan/src" ] - } - - if (is_fuchsia) { - defines = [ "VK_USE_PLATFORM_FUCHSIA=1" ] - } -} # Template to generate a dart embedder resource.cc file. # Required invoker inputs: @@ -167,25 +150,6 @@ template("shell_host_executable") { } } -test_fixtures("shell_unittests_fixtures") { - dart_main = "fixtures/shell_test.dart" - - fixtures = [ "fixtures/shelltest_screenshot.png" ] -} - -shell_host_executable("shell_benchmarks") { - sources = [ - "shell_benchmarks.cc", - ] - - deps = [ - ":shell_unittests_fixtures", - "//flutter/benchmarking", - "//flutter/testing:dart", - "//flutter/testing:testing_lib", - ] -} - if (enable_unittests) { declare_args() { test_enable_vulkan = is_fuchsia @@ -201,6 +165,25 @@ if (enable_unittests) { enable_metal = test_enable_metal } + test_fixtures("shell_unittests_fixtures") { + dart_main = "fixtures/shell_test.dart" + + fixtures = [ "fixtures/shelltest_screenshot.png" ] + } + + shell_host_executable("shell_benchmarks") { + sources = [ + "shell_benchmarks.cc", + ] + + deps = [ + ":shell_unittests_fixtures", + "//flutter/benchmarking", + "//flutter/testing:dart", + "//flutter/testing:testing_lib", + ] + } + source_set_maybe_fuchsia_legacy("shell_test_fixture_sources") { testonly = true @@ -315,62 +298,4 @@ if (enable_unittests) { ] } } - - if (is_fuchsia) { - fuchsia_test_archive("shell_tests") { - deps = [ - ":shell_unittests", - ":shell_unittests_fixtures", - ] - - binary = "shell_unittests" - - # TODO(gw280): https://github.com/flutter/flutter/issues/50294 - # Right now we need to manually specify all the fixtures that are - # declared in the test_fixtures() call above. - resources = [ - { - path = "$target_gen_dir/assets/kernel_blob.bin" - dest = "assets/kernel_blob.bin" - }, - { - path = "$target_gen_dir/assets/shelltest_screenshot.png" - dest = "assets/shelltest_screenshot.png" - }, - ] - - if (test_enable_vulkan) { - libraries = vulkan_validation_libs - resources += vulkan_icds - } - } - - fuchsia_test_archive("shell_tests_next") { - deps = [ - ":shell_unittests_fixtures", - ":shell_unittests_next", - ] - - binary = "shell_unittests_next" - - # TODO(gw280): https://github.com/flutter/flutter/issues/50294 - # Right now we need to manually specify all the fixtures that are - # declared in the test_fixtures() call above. - resources = [ - { - path = "$target_gen_dir/assets/kernel_blob.bin" - dest = "assets/kernel_blob.bin" - }, - { - path = "$target_gen_dir/assets/shelltest_screenshot.png" - dest = "assets/shelltest_screenshot.png" - }, - ] - - if (test_enable_vulkan) { - libraries = vulkan_validation_libs - resources += vulkan_icds - } - } - } } diff --git a/shell/platform/common/cpp/BUILD.gn b/shell/platform/common/cpp/BUILD.gn index 2027ac55f3de8f93366bacae8170b43f2f5c960c..d318a1a35c6c728cc8aaf2b89e9d5bff77649b1b 100644 --- a/shell/platform/common/cpp/BUILD.gn +++ b/shell/platform/common/cpp/BUILD.gn @@ -30,6 +30,13 @@ source_set("common_cpp_library_headers") { configs += [ ":desktop_library_implementation" ] } +copy("publish_headers") { + sources = _public_headers + outputs = [ + "$root_out_dir/{{source_file_part}}", + ] +} + source_set("common_cpp_input") { public = [ "text_input_model.h", @@ -90,55 +97,50 @@ source_set("common_cpp_core") { ] } -test_fixtures("common_cpp_core_fixtures") { - fixtures = [] -} - -executable("common_cpp_core_unittests") { - testonly = true - - sources = [ - "path_utils_unittests.cc", - ] - - deps = [ - ":common_cpp_core", - ":common_cpp_core_fixtures", - "//flutter/testing", - "//third_party/dart/runtime:libdart_jit", - ] - - public_configs = [ "//flutter:config" ] -} +if (enable_unittests) { + test_fixtures("common_cpp_core_fixtures") { + fixtures = [] + } -test_fixtures("common_cpp_fixtures") { - fixtures = [] -} + executable("common_cpp_core_unittests") { + testonly = true -executable("common_cpp_unittests") { - testonly = true + sources = [ + "path_utils_unittests.cc", + ] - sources = [ - "json_message_codec_unittests.cc", - "json_method_codec_unittests.cc", - "text_input_model_unittests.cc", - ] + deps = [ + ":common_cpp_core", + ":common_cpp_core_fixtures", + "//flutter/testing", + "//third_party/dart/runtime:libdart_jit", + ] - deps = [ - ":common_cpp", - ":common_cpp_fixtures", - ":common_cpp_input", - "//flutter/shell/platform/common/cpp/client_wrapper:client_wrapper", - "//flutter/shell/platform/common/cpp/client_wrapper:client_wrapper_library_stubs", - "//flutter/testing", - ] + public_configs = [ "//flutter:config" ] + } - public_configs = [ "//flutter:config" ] -} + test_fixtures("common_cpp_fixtures") { + fixtures = [] + } -copy("publish_headers") { - sources = _public_headers - outputs = [ - "$root_out_dir/{{source_file_part}}", - ] + executable("common_cpp_unittests") { + testonly = true + + sources = [ + "json_message_codec_unittests.cc", + "json_method_codec_unittests.cc", + "text_input_model_unittests.cc", + ] + + deps = [ + ":common_cpp", + ":common_cpp_fixtures", + ":common_cpp_input", + "//flutter/shell/platform/common/cpp/client_wrapper:client_wrapper", + "//flutter/shell/platform/common/cpp/client_wrapper:client_wrapper_library_stubs", + "//flutter/testing", + ] + + public_configs = [ "//flutter:config" ] + } } diff --git a/shell/platform/config.gni b/shell/platform/config.gni index 3684094eb7927a07a0841dc4dca16d64e65980b6..192af2cec7d49cf820c0dea042b2447be111f855 100644 --- a/shell/platform/config.gni +++ b/shell/platform/config.gni @@ -4,5 +4,5 @@ declare_args() { # Whether or not to include desktop embedding targets in the build. - enable_desktop_embeddings = !is_fuchsia_host + enable_desktop_embeddings = true } diff --git a/shell/platform/darwin/ios/BUILD.gn b/shell/platform/darwin/ios/BUILD.gn index 762d5e03bcd1646f3c9c68f6f9393e2467f04527..d1cf04b1b6d67ff44360de5d87775d1d744e166d 100644 --- a/shell/platform/darwin/ios/BUILD.gn +++ b/shell/platform/darwin/ios/BUILD.gn @@ -268,7 +268,7 @@ action("copy_framework_info_plist") { args = [ rebase_path(sources[0]), rebase_path(outputs[0]), - "--bitcode=$flutter_enable_bitcode", + "--bitcode=$enable_bitcode", ] } diff --git a/shell/platform/embedder/BUILD.gn b/shell/platform/embedder/BUILD.gn index 955c64157161498a4349dcb07f26d9b137c7e641..2ab3a0dd5115f6854c4f0cd93ca121e4d2d3f85e 100644 --- a/shell/platform/embedder/BUILD.gn +++ b/shell/platform/embedder/BUILD.gn @@ -229,7 +229,7 @@ if (is_mac && !embedder_for_target) { args = [ rebase_path(sources[0]), rebase_path(outputs[0]), - "--bitcode=$flutter_enable_bitcode", + "--bitcode=$enable_bitcode", ] } diff --git a/shell/platform/fuchsia/BUILD.gn b/shell/platform/fuchsia/BUILD.gn index bedafe92d06ff84dc0655e204aef87cb2882b7bc..e46ccff1f31bea147399e019522f57a8ad094574 100644 --- a/shell/platform/fuchsia/BUILD.gn +++ b/shell/platform/fuchsia/BUILD.gn @@ -2,90 +2,98 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +assert(is_fuchsia) + import("//build/fuchsia/sdk.gni") import("//flutter/common/config.gni") import("//flutter/tools/fuchsia/dart.gni") import("//flutter/tools/fuchsia/fuchsia_host_bundle.gni") -if (is_fuchsia) { - product_suffix = "" - is_product = false +product_suffix = "" +is_product = false - if (flutter_runtime_mode == "release") { - product_suffix = "product_" - is_product = true - } +if (flutter_runtime_mode == "release") { + product_suffix = "product_" + is_product = true +} - fuchsia_host_bundle("flutter_binaries") { - name = "flutter_binaries" +fuchsia_host_bundle("flutter_binaries") { + name = "flutter_binaries" - _flutter_tester_label = "//flutter/shell/testing:testing($host_toolchain)" + _flutter_tester_label = "//flutter/shell/testing:testing($host_toolchain)" - deps = [ - _flutter_tester_label, - ] + deps = [ + _flutter_tester_label, + ] - _flutter_tester_bin_path = - rebase_path(get_label_info(_flutter_tester_label, "root_out_dir") + - "/flutter_tester") + _flutter_tester_bin_path = + rebase_path(get_label_info(_flutter_tester_label, "root_out_dir") + + "/flutter_tester") - sources = [ - _flutter_tester_bin_path, - ] - } + sources = [ + _flutter_tester_bin_path, + ] +} - fuchsia_host_bundle("dart_binaries") { - name = "dart_binaries" - - _gen_snapshot_to_use = gen_snapshot + "($host_toolchain)" - if (is_product) { - _gen_snapshot_to_use = gen_snapshot_product + "($host_toolchain)" - } - - _kernel_compiler_label = "dart:kernel_compiler($host_toolchain)" - _frontend_server_label = - "//flutter/flutter_frontend_server:frontend_server($host_toolchain)" - _list_libraries_label = "dart:list_libraries($host_toolchain)" - - deps = [ - _frontend_server_label, - _gen_snapshot_to_use, - _kernel_compiler_label, - _list_libraries_label, - ] - - _gen_snapshot_bin_path = - rebase_path(get_label_info(_gen_snapshot_to_use, "root_out_dir") + "/" + - get_label_info(_gen_snapshot_to_use, "name")) - - _kernel_compiler_path = - rebase_path(get_label_info(_kernel_compiler_label, "root_gen_dir") + - "/kernel_compiler.dart.snapshot") - - _frontend_server_path = - rebase_path(get_label_info(_frontend_server_label, "root_gen_dir") + - "/frontend_server.dart.snapshot") - - _list_libraries_path = - rebase_path(get_label_info(_list_libraries_label, "root_gen_dir") + - "/list_libraries.dart.snapshot") - - sources = [ - _frontend_server_path, - _gen_snapshot_bin_path, - _kernel_compiler_path, - _list_libraries_path, - ] - } +fuchsia_host_bundle("dart_binaries") { + name = "dart_binaries" - group("fuchsia") { - deps = [ - ":dart_binaries", - ":flutter_binaries", - "dart_runner:dart_aot_${product_suffix}runner", - "dart_runner:dart_jit_${product_suffix}runner", - "flutter:flutter_aot_${product_suffix}runner", - "flutter:flutter_jit_${product_suffix}runner", - ] + _gen_snapshot_to_use = gen_snapshot + "($host_toolchain)" + if (is_product) { + _gen_snapshot_to_use = gen_snapshot_product + "($host_toolchain)" } + + _kernel_compiler_label = "dart:kernel_compiler($host_toolchain)" + _frontend_server_label = + "//flutter/flutter_frontend_server:frontend_server($host_toolchain)" + _list_libraries_label = "dart:list_libraries($host_toolchain)" + + deps = [ + _frontend_server_label, + _gen_snapshot_to_use, + _kernel_compiler_label, + _list_libraries_label, + ] + + _gen_snapshot_bin_path = + rebase_path(get_label_info(_gen_snapshot_to_use, "root_out_dir") + "/" + + get_label_info(_gen_snapshot_to_use, "name")) + + _kernel_compiler_path = + rebase_path(get_label_info(_kernel_compiler_label, "root_gen_dir") + + "/kernel_compiler.dart.snapshot") + + _frontend_server_path = + rebase_path(get_label_info(_frontend_server_label, "root_gen_dir") + + "/frontend_server.dart.snapshot") + + _list_libraries_path = + rebase_path(get_label_info(_list_libraries_label, "root_gen_dir") + + "/list_libraries.dart.snapshot") + + sources = [ + _frontend_server_path, + _gen_snapshot_bin_path, + _kernel_compiler_path, + _list_libraries_path, + ] +} + +group("fuchsia") { + deps = [ + ":dart_binaries", + ":flutter_binaries", + "dart_runner:dart_aot_${product_suffix}runner", + "dart_runner:dart_jit_${product_suffix}runner", + "flutter:flutter_aot_${product_suffix}runner", + "flutter:flutter_jit_${product_suffix}runner", + ] +} + +group("tests") { + testonly = true + + deps = [ + "flutter:tests", + ] } diff --git a/shell/platform/fuchsia/dart-pkg/zircon/sdk_ext/system.cc b/shell/platform/fuchsia/dart-pkg/zircon/sdk_ext/system.cc index d67360fe2d2a6cf3e911f2200c9812013140c302..3230b79a6b39f76ae7ab195d35549b7fb514cd74 100644 --- a/shell/platform/fuchsia/dart-pkg/zircon/sdk_ext/system.cc +++ b/shell/platform/fuchsia/dart-pkg/zircon/sdk_ext/system.cc @@ -21,11 +21,6 @@ #include "third_party/tonic/dart_binding_macros.h" #include "third_party/tonic/dart_class_library.h" -#if !defined(FUCHSIA_SDK) -#include -#include "lib/fsl/io/fd.h" -#endif // !defined(FUCHSIA_SDK) - using tonic::ToDart; namespace zircon { diff --git a/shell/platform/fuchsia/flutter/BUILD.gn b/shell/platform/fuchsia/flutter/BUILD.gn index 98befa7c703df93c0044a3ccab2bf67599de831c..ab119951f09df9cae92d0ed49d0cee5e59337816 100644 --- a/shell/platform/fuchsia/flutter/BUILD.gn +++ b/shell/platform/fuchsia/flutter/BUILD.gn @@ -366,77 +366,6 @@ executable("flutter_runner_tzdata_unittests") { ] } -fuchsia_archive("flutter_runner_tests") { - testonly = true - - deps = [ - ":flutter_runner_unittests", - ] - - binary = "$target_name" - - resources = [ - { - path = rebase_path("//third_party/icu/common/icudtl.dat") - dest = "icudtl.dat" - }, - { - path = rebase_path( - "//flutter/shell/platform/fuchsia/flutter/tests/tzdata/2019a/44/le/metaZones.res") - dest = "tzdata/metaZones.res" - }, - { - path = rebase_path( - "//flutter/shell/platform/fuchsia/flutter/tests/tzdata/2019a/44/le/timezoneTypes.res") - dest = "tzdata/timezoneTypes.res" - }, - { - path = rebase_path( - "//flutter/shell/platform/fuchsia/flutter/tests/tzdata/2019a/44/le/zoneinfo64.res") - dest = "tzdata/zoneinfo64.res" - }, - ] - - meta_dir = "//flutter/shell/platform/fuchsia/flutter/meta" - - libraries = common_libs - - meta = [ - { - path = rebase_path("meta/$target_name.cmx") - dest = "$target_name.cmx" - }, - ] -} - -fuchsia_archive("flutter_runner_tzdata_tests") { - testonly = true - - deps = [ - ":flutter_runner_tzdata_unittests", - ] - - binary = "$target_name" - - resources = [ - { - path = rebase_path("//third_party/icu/common/icudtl.dat") - dest = "icudtl.dat" - }, - ] - - meta_dir = "//flutter/shell/platform/fuchsia/flutter/meta" - - libraries = common_libs - - meta = [ - { - path = rebase_path("meta/$target_name.cmx") - dest = "$target_name.cmx" - }, - ] -} - executable("flutter_runner_scenic_unittests") { testonly = true @@ -520,6 +449,79 @@ executable("flutter_runner_scenic_unittests") { ] } +# When adding a new dep here, please also ensure the dep is added to +# testing/fuchsia/run_tests.sh and testing/fuchsia/test_fars +fuchsia_archive("flutter_runner_tests") { + testonly = true + + deps = [ + ":flutter_runner_unittests", + ] + + binary = "$target_name" + + resources = [ + { + path = rebase_path("//third_party/icu/common/icudtl.dat") + dest = "icudtl.dat" + }, + { + path = rebase_path( + "//flutter/shell/platform/fuchsia/flutter/tests/tzdata/2019a/44/le/metaZones.res") + dest = "tzdata/metaZones.res" + }, + { + path = rebase_path( + "//flutter/shell/platform/fuchsia/flutter/tests/tzdata/2019a/44/le/timezoneTypes.res") + dest = "tzdata/timezoneTypes.res" + }, + { + path = rebase_path( + "//flutter/shell/platform/fuchsia/flutter/tests/tzdata/2019a/44/le/zoneinfo64.res") + dest = "tzdata/zoneinfo64.res" + }, + ] + + meta_dir = "//flutter/shell/platform/fuchsia/flutter/meta" + + libraries = common_libs + + meta = [ + { + path = rebase_path("meta/$target_name.cmx") + dest = "$target_name.cmx" + }, + ] +} + +fuchsia_archive("flutter_runner_tzdata_tests") { + testonly = true + + deps = [ + ":flutter_runner_tzdata_unittests", + ] + + binary = "$target_name" + + resources = [ + { + path = rebase_path("//third_party/icu/common/icudtl.dat") + dest = "icudtl.dat" + }, + ] + + meta_dir = "//flutter/shell/platform/fuchsia/flutter/meta" + + libraries = common_libs + + meta = [ + { + path = rebase_path("meta/$target_name.cmx") + dest = "$target_name.cmx" + }, + ] +} + fuchsia_archive("flutter_runner_scenic_tests") { testonly = true @@ -547,3 +549,287 @@ fuchsia_archive("flutter_runner_scenic_tests") { }, ] } + +fuchsia_test_archive("fml_tests") { + deps = [ + "//flutter/fml:fml_unittests", + ] + + binary = "fml_unittests" +} + +fuchsia_test_archive("flow_tests") { + deps = [ + "//flutter/flow:flow_unittests", + ] + + binary = "flow_unittests" + + resources = [ + { + path = rebase_path( + "//flutter/testing/resources/performance_overlay_gold_60fps.png") + dest = "flutter/testing/resources/performance_overlay_gold_60fps.png" + }, + { + path = rebase_path( + "//flutter/testing/resources/performance_overlay_gold_90fps.png") + dest = "flutter/testing/resources/performance_overlay_gold_90fps.png" + }, + { + path = rebase_path( + "//flutter/testing/resources/performance_overlay_gold_120fps.png") + dest = "flutter/testing/resources/performance_overlay_gold_120fps.png" + }, + ] +} + +fuchsia_test_archive("flow_tests_next") { + deps = [ + "//flutter/flow:flow_unittests_next", + ] + + binary = "flow_unittests_next" + + resources = [ + { + path = rebase_path( + "//flutter/testing/resources/performance_overlay_gold_60fps.png") + dest = "flutter/testing/resources/performance_overlay_gold_60fps.png" + }, + { + path = rebase_path( + "//flutter/testing/resources/performance_overlay_gold_90fps.png") + dest = "flutter/testing/resources/performance_overlay_gold_90fps.png" + }, + { + path = rebase_path( + "//flutter/testing/resources/performance_overlay_gold_120fps.png") + dest = "flutter/testing/resources/performance_overlay_gold_120fps.png" + }, + ] +} + +fuchsia_test_archive("runtime_tests") { + deps = [ + "//flutter/runtime:runtime_fixtures", + "//flutter/runtime:runtime_unittests", + ] + + binary = "runtime_unittests" + + # TODO(gw280): https://github.com/flutter/flutter/issues/50294 + # Right now we need to manually specify all the fixtures that are + # declared in the test_fixtures() call above. + resources = [ + { + path = "$root_gen_dir/flutter/runtime/assets/kernel_blob.bin" + dest = "assets/kernel_blob.bin" + }, + ] +} + +fuchsia_test_archive("runtime_tests_next") { + deps = [ + "//flutter/runtime:runtime_fixtures", + "//flutter/runtime:runtime_unittests_next", + ] + + binary = "runtime_unittests_next" + + # TODO(gw280): https://github.com/flutter/flutter/issues/50294 + # Right now we need to manually specify all the fixtures that are + # declared in the test_fixtures() call above. + resources = [ + { + path = "$root_gen_dir/flutter/runtime/assets/kernel_blob.bin" + dest = "assets/kernel_blob.bin" + }, + ] +} + +fuchsia_test_archive("shell_tests") { + deps = [ + "//flutter/shell/common:shell_unittests", + "//flutter/shell/common:shell_unittests_fixtures", + ] + + binary = "shell_unittests" + + # TODO(gw280): https://github.com/flutter/flutter/issues/50294 + # Right now we need to manually specify all the fixtures that are + # declared in the test_fixtures() call above. + resources = [ + { + path = "$root_gen_dir/flutter/shell/common/assets/kernel_blob.bin" + dest = "assets/kernel_blob.bin" + }, + { + path = + "$root_gen_dir/flutter/shell/common/assets/shelltest_screenshot.png" + dest = "assets/shelltest_screenshot.png" + }, + ] + + libraries = vulkan_validation_libs + resources += vulkan_icds +} + +fuchsia_test_archive("shell_tests_next") { + deps = [ + "//flutter/shell/common:shell_unittests_fixtures", + "//flutter/shell/common:shell_unittests_next", + ] + + binary = "shell_unittests_next" + + # TODO(gw280): https://github.com/flutter/flutter/issues/50294 + # Right now we need to manually specify all the fixtures that are + # declared in the test_fixtures() call above. + resources = [ + { + path = "$root_gen_dir/flutter/shell/common/assets/kernel_blob.bin" + dest = "assets/kernel_blob.bin" + }, + { + path = + "$root_gen_dir/flutter/shell/common/assets/shelltest_screenshot.png" + dest = "assets/shelltest_screenshot.png" + }, + ] + + libraries = vulkan_validation_libs + resources += vulkan_icds +} + +fuchsia_test_archive("testing_tests") { + deps = [ + "//flutter/testing:testing_unittests", + ] + + binary = "testing_unittests" +} + +fuchsia_test_archive("txt_tests") { + deps = [ + "//flutter/third_party/txt:txt_unittests", + ] + + binary = "txt_unittests" + + resources = [ + { + path = rebase_path("//third_party/icu/common/icudtl.dat") + dest = "icudtl.dat" + }, + { + path = rebase_path("//third_party/icu/common/icudtl.dat") + dest = "icudtl2.dat" + }, + ] +} + +fuchsia_test_archive("ui_tests") { + deps = [ + "//flutter/lib/ui:ui_unittests", + "//flutter/lib/ui:ui_unittests_fixtures", + ] + + binary = "ui_unittests" + + # TODO(gw280): https://github.com/flutter/flutter/issues/50294 + # Right now we need to manually specify all the fixtures that are + # declared in the test_fixtures() call above. + resources = [ + { + path = "$root_gen_dir/flutter/lib/ui/assets/kernel_blob.bin" + dest = "assets/kernel_blob.bin" + }, + { + path = "$root_gen_dir/flutter/lib/ui/assets/DashInNooglerHat.jpg" + dest = "assets/DashInNooglerHat.jpg" + }, + { + path = "$root_gen_dir/flutter/lib/ui/assets/Horizontal.jpg" + dest = "assets/Horizontal.jpg" + }, + { + path = "$root_gen_dir/flutter/lib/ui/assets/Horizontal.png" + dest = "assets/Horizontal.png" + }, + { + path = "$root_gen_dir/flutter/lib/ui/assets/hello_loop_2.gif" + dest = "assets/hello_loop_2.gif" + }, + { + path = "$root_gen_dir/flutter/lib/ui/assets/hello_loop_2.webp" + dest = "assets/hello_loop_2.webp" + }, + ] + + libraries = vulkan_validation_libs + resources += vulkan_icds +} + +fuchsia_test_archive("ui_tests_next") { + deps = [ + "//flutter/lib/ui:ui_unittests_fixtures", + "//flutter/lib/ui:ui_unittests_next", + ] + + binary = "ui_unittests_next" + + # TODO(gw280): https://github.com/flutter/flutter/issues/50294 + # Right now we need to manually specify all the fixtures that are + # declared in the test_fixtures() call above. + resources = [ + { + path = "$root_gen_dir/flutter/lib/ui/assets/kernel_blob.bin" + dest = "assets/kernel_blob.bin" + }, + { + path = "$root_gen_dir/flutter/lib/ui/assets/DashInNooglerHat.jpg" + dest = "assets/DashInNooglerHat.jpg" + }, + { + path = "$root_gen_dir/flutter/lib/ui/assets/Horizontal.jpg" + dest = "assets/Horizontal.jpg" + }, + { + path = "$root_gen_dir/flutter/lib/ui/assets/Horizontal.png" + dest = "assets/Horizontal.png" + }, + { + path = "$root_gen_dir/flutter/lib/ui/assets/hello_loop_2.gif" + dest = "assets/hello_loop_2.gif" + }, + { + path = "$root_gen_dir/flutter/lib/ui/assets/hello_loop_2.webp" + dest = "assets/hello_loop_2.webp" + }, + ] + + libraries = vulkan_validation_libs + resources += vulkan_icds +} + +group("tests") { + testonly = true + + deps = [ + ":flow_tests", + ":flow_tests_next", + ":flutter_runner_scenic_tests", + ":flutter_runner_tests", + ":flutter_runner_tzdata_tests", + ":fml_tests", + ":runtime_tests", + ":runtime_tests_next", + ":shell_tests", + ":shell_tests_next", + ":testing_tests", + ":txt_tests", + ":ui_tests", + ":ui_tests_next", + ] +} diff --git a/shell/platform/fuchsia/flutter/flutter_app.gni b/shell/platform/fuchsia/flutter/flutter_app.gni index adbc005810910a3c1ca0d2d9c7d2762e93bd68f3..a3a444256fc48149e2ea4d3250a54713591f2a5c 100644 --- a/shell/platform/fuchsia/flutter/flutter_app.gni +++ b/shell/platform/fuchsia/flutter/flutter_app.gni @@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -assert(is_fuchsia || is_fuchsia_host) +assert(is_fuchsia) import("//build/package.gni") import("//build/tools/json_merge/json_merge.gni") diff --git a/shell/testing/BUILD.gn b/shell/testing/BUILD.gn index fce083fc12b1b680d98bcbfefdc08712f1681988..7efbb33fbf7b9cb1d67f314fa9b39e1fb7892ca0 100644 --- a/shell/testing/BUILD.gn +++ b/shell/testing/BUILD.gn @@ -27,8 +27,4 @@ executable("testing") { "//third_party/dart/runtime/bin:dart_io_api", "//third_party/skia", ] - - if (is_fuchsia) { - deps += [ "$fuchsia_sdk_root/pkg:scenic_cpp" ] - } } diff --git a/sky/BUILD.gn b/sky/BUILD.gn index 86594a80602d87d9754c7373d6f6571d0251357f..0009826371914b13552eac84b7f545c29e825465 100644 --- a/sky/BUILD.gn +++ b/sky/BUILD.gn @@ -6,10 +6,7 @@ group("sky") { testonly = true deps = [ + "//flutter/shell", "//flutter/sky/packages", ] - - if (!is_fuchsia) { - deps += [ "//flutter/shell" ] - } } diff --git a/testing/BUILD.gn b/testing/BUILD.gn index 1ec19a9c2028465520a96ae1b33bedf3fb7e5342..788728d86f24e0ac1e384904d419e709fb389318 100644 --- a/testing/BUILD.gn +++ b/testing/BUILD.gn @@ -134,57 +134,55 @@ if (enable_unittests) { "//third_party/swiftshader_flutter:swiftshader_gl", ] } + } - # All targets on all platforms should be able to use the Metal utilities. On - # platforms where Metal is not available, the tests must be skipped or - # implemented to use another available client rendering API. This is usually - # either OpenGL which is portably implemented via SwiftShader or the software - # backend. This way, all tests compile on all platforms but the Metal backend - # is exercised on platforms where Metal itself is available. - source_set("metal") { - testonly = true - - sources = [ - "test_metal_surface.cc", - "test_metal_surface.h", - ] + # All targets on all platforms should be able to use the Metal utilities. On + # platforms where Metal is not available, the tests must be skipped or + # implemented to use another available client rendering API. This is usually + # either OpenGL which is portably implemented via SwiftShader or the software + # backend. This way, all tests compile on all platforms but the Metal backend + # is exercised on platforms where Metal itself is available. + source_set("metal") { + testonly = true - defines = [] + sources = [ + "test_metal_surface.cc", + "test_metal_surface.h", + ] - if (shell_enable_metal) { - sources += [ "test_metal_surface_impl.mm" ] - defines += [ "TESTING_ENABLE_METAL" ] - } + defines = [] - deps = [ - ":skia", - "//flutter/fml", - ] + if (shell_enable_metal) { + sources += [ "test_metal_surface_impl.mm" ] + defines += [ "TESTING_ENABLE_METAL" ] } - test_fixtures("testing_fixtures") { - fixtures = [] - } + deps = [ + ":skia", + "//flutter/fml", + ] + } - # The //flutter/testing library provides utility methods to other test targets. - # This test target tests the testing utilities. - executable("testing_unittests") { - testonly = true + test_fixtures("testing_fixtures") { + fixtures = [] + } - sources = [ - "mock_canvas_unittests.cc", - "test_metal_surface_unittests.cc", - ] + # The //flutter/testing library provides utility methods to other test targets. + # This test target tests the testing utilities. + executable("testing_unittests") { + testonly = true - deps = [ - ":dart", - ":metal", - ":opengl", - ":skia", - ":testing", - ":testing_fixtures", - ":testing_lib", - ] - } + sources = [ + "mock_canvas_unittests.cc", + "test_metal_surface_unittests.cc", + ] + + deps = [ + ":metal", + ":skia", + ":testing", + ":testing_fixtures", + "//flutter/runtime:libdart", + ] } } diff --git a/testing/fuchsia/run_tests.sh b/testing/fuchsia/run_tests.sh index e6afefdd18c34d9360398be4618c8ea92f88e0c2..201692a9472454e2652f9aa6bb852ce92bbcd650 100755 --- a/testing/fuchsia/run_tests.sh +++ b/testing/fuchsia/run_tests.sh @@ -69,36 +69,37 @@ for i in {1..10}; do done echo "$(date) END:WAIT_DEVICE_READY ---------------------------------" -echo "$(date) START:EXTRACT_PACKAGES ---------------------------------" +echo "$(date) START:EXTRACT_PACKAGES -------------------------------" mkdir -p packages tar -xvzf $2 -C packages 1> /dev/null -echo "$(date) END:EXTRACT_PACKAGES -----------------------------------" +echo "$(date) END:EXTRACT_PACKAGES ---------------------------------" - -# TODO(gw280): Enable tests using JIT runner -echo "$(date) START:flutter_runner_tests ----------------------------" +echo "$(date) START:testing_tests -----------------------------------" ./fuchsia_ctl -d $device_name test \ - -f flutter_aot_runner-0.far \ - -f flutter_runner_tests-0.far \ - -t flutter_runner_tests \ - --identity-file $pkey \ - --timeout-seconds $test_timeout_seconds \ - --packages-directory packages + -f testing_tests-0.far \ + -t testing_tests \ + --identity-file $pkey \ + --timeout-seconds $test_timeout_seconds \ + --packages-directory packages +echo "$(date) DONE:testing_tests ------------------------------------" +# TODO(https://github.com/flutter/flutter/issues/61212): Re-enable ParagraphTest +# once it passes on Fuchsia. +echo "$(date) START:txt_tests ---------------------------------------" ./fuchsia_ctl -d $device_name test \ - -f flutter_aot_runner-0.far \ - -f flutter_runner_scenic_tests-0.far \ - -t flutter_runner_scenic_tests \ - --identity-file $pkey \ - --timeout-seconds $test_timeout_seconds \ - --packages-directory packages -echo "$(date) DONE:flutter_runner_tests ----------------------------" + -f txt_tests-0.far \ + -t txt_tests \ + -a "--gtest_filter=-ParagraphTest.*" \ + --identity-file $pkey \ + --timeout-seconds $test_timeout_seconds \ + --packages-directory packages +echo "$(date) DONE:txt_tests ----------------------------------------" -# TODO(https://github.com/flutter/flutter/issues/57709): Re-enable FileTest's -# once they pass on Fuchsia. +# TODO(https://github.com/flutter/flutter/issues/57709): Re-enable FileTest +# once it passes on Fuchsia. # TODO(https://github.com/flutter/flutter/issues/58211): Re-enable MessageLoop -# tests once they pass on Fuchsia. -echo "$(date) START:fml_tests ---------------------------------------" +# test once it passes on Fuchsia. +echo "$(date) START:fml_tests ----------------------------------------" ./fuchsia_ctl -d $device_name test \ -f fml_tests-0.far \ -t fml_tests \ @@ -106,7 +107,7 @@ echo "$(date) START:fml_tests ---------------------------------------" --identity-file $pkey \ --timeout-seconds $test_timeout_seconds \ --packages-directory packages -echo "$(date) DONE:fml_tests ---------------------------------------" +echo "$(date) DONE:fml_tests ----------------------------------------" echo "$(date) START:flow_tests --------------------------------------" @@ -116,6 +117,13 @@ echo "$(date) START:flow_tests --------------------------------------" --identity-file $pkey \ --timeout-seconds $test_timeout_seconds \ --packages-directory packages + +./fuchsia_ctl -d $device_name test \ + -f flow_tests_next-0.far \ + -t flow_tests_next \ + --identity-file $pkey \ + --timeout-seconds $test_timeout_seconds \ + --packages-directory packages echo "$(date) DONE:flow_tests ---------------------------------------" @@ -126,7 +134,30 @@ echo "$(date) START:runtime_tests -----------------------------------" --identity-file $pkey \ --timeout-seconds $test_timeout_seconds \ --packages-directory packages -echo "$(date) DONE:runtime_tests -----------------------------------" + +./fuchsia_ctl -d $device_name test \ + -f runtime_tests_next-0.far \ + -t runtime_tests_next \ + --identity-file $pkey \ + --timeout-seconds $test_timeout_seconds \ + --packages-directory packages +echo "$(date) DONE:runtime_tests ------------------------------------" + +echo "$(date) START:ui_tests ----------------------------------------" +./fuchsia_ctl -d $device_name test \ + -f ui_tests-0.far \ + -t ui_tests \ + --identity-file $pkey \ + --timeout-seconds $test_timeout_seconds \ + --packages-directory packages + +./fuchsia_ctl -d $device_name test \ + -f ui_tests_next-0.far \ + -t ui_tests_next \ + --identity-file $pkey \ + --timeout-seconds $test_timeout_seconds \ + --packages-directory packages +echo "$(date) DONE:ui_tests -----------------------------------------" # TODO(https://github.com/flutter/flutter/issues/53399): Re-enable # OnServiceProtocolGetSkSLsWorks, CanLoadSkSLsFromAsset, and @@ -139,4 +170,39 @@ echo "$(date) START:shell_tests -------------------------------------" --identity-file $pkey \ --timeout-seconds $test_timeout_seconds \ --packages-directory packages -echo "$(date) DONE:shell_tests -----------------------------------" + +./fuchsia_ctl -d $device_name test \ + -f shell_tests_next-0.far \ + -t shell_tests_next \ + -a "--gtest_filter=-ShellTest.CacheSkSLWorks:ShellTest.SetResourceCacheSize*:ShellTest.OnServiceProtocolGetSkSLsWorks:ShellTest.CanLoadSkSLsFromAsset:ShellTest.CanRemoveOldPersistentCache" \ + --identity-file $pkey \ + --timeout-seconds $test_timeout_seconds \ + --packages-directory packages +echo "$(date) DONE:shell_tests --------------------------------------" + +# TODO(gw280): Enable tests using JIT runner +echo "$(date) START:flutter_runner_tests ----------------------------" +./fuchsia_ctl -d $device_name test \ + -f flutter_aot_runner-0.far \ + -f flutter_runner_tests-0.far \ + -t flutter_runner_tests \ + --identity-file $pkey \ + --timeout-seconds $test_timeout_seconds \ + --packages-directory packages + +./fuchsia_ctl -d $device_name test \ + -f flutter_aot_runner-0.far \ + -f flutter_runner_scenic_tests-0.far \ + -t flutter_runner_scenic_tests \ + --identity-file $pkey \ + --timeout-seconds $test_timeout_seconds \ + --packages-directory packages + +./fuchsia_ctl -d $device_name test \ + -f flutter_aot_runner-0.far \ + -f flutter_runner_tzdata_tests-0.far \ + -t flutter_runner_tzdata_tests \ + --identity-file $pkey \ + --timeout-seconds $test_timeout_seconds \ + --packages-directory packages +echo "$(date) DONE:flutter_runner_tests -----------------------------" diff --git a/testing/fuchsia/test_fars b/testing/fuchsia/test_fars index 2c94af9c779561c30c431a31f216fe49b6f67a90..b26051c1ea87012dcc7bca79750a7a2949f24808 100644 --- a/testing/fuchsia/test_fars +++ b/testing/fuchsia/test_fars @@ -1,6 +1,14 @@ flutter_runner_tests-0.far flutter_runner_scenic_tests-0.far +flutter_runner_tzdata_tests-0.far fml_tests-0.far flow_tests-0.far runtime_tests-0.far shell_tests-0.far +testing_tests-0.far +txt_tests-0.far +ui_tests-0.far +flow_tests_next-0.far +runtime_tests_next-0.far +shell_tests_next-0.far +ui_tests_next-0.far diff --git a/third_party/txt/BUILD.gn b/third_party/txt/BUILD.gn index 56b73a020bd2abf1672776885860bd7c8bfc1dab..a0fc4eb69ac4fde6d6bb6864fd788405216ab76a 100644 --- a/third_party/txt/BUILD.gn +++ b/third_party/txt/BUILD.gn @@ -178,164 +178,166 @@ source_set("txt") { } } -txt_common_executable_deps = [ - "//third_party/dart/runtime:libdart_jit", # For logging. - "//flutter/fml", # For ICU initialization. -] - -source_set("txt_test_utils") { - sources = [ - "tests/txt_test_utils.cc", - "tests/txt_test_utils.h", - ] - - deps = [ - ":txt", - "//flutter/fml", - "//third_party/skia", +if (enable_unittests) { + txt_common_executable_deps = [ + "//third_party/dart/runtime:libdart_jit", # For logging. + "//flutter/fml", # For ICU initialization. ] -} -test_fixtures("txt_fixtures") { - fixtures = [ - "third_party/fonts/Bold.ttf", - "third_party/fonts/Bold.ttx", - "third_party/fonts/BoldItalic.ttf", - "third_party/fonts/BoldItalic.ttx", - "third_party/fonts/ColorEmojiFont.ttf", - "third_party/fonts/ColorEmojiFont.ttx", - "third_party/fonts/ColorTextMixedEmojiFont.ttf", - "third_party/fonts/ColorTextMixedEmojiFont.ttx", - "third_party/fonts/DroidSerif.ttf", - "third_party/fonts/Emoji.ttf", - "third_party/fonts/Emoji.ttx", - "third_party/fonts/HomemadeApple.ttf", - "third_party/fonts/Italic.ttf", - "third_party/fonts/Italic.ttx", - "third_party/fonts/Ja.ttf", - "third_party/fonts/Ja.ttx", - "third_party/fonts/Katibeh-Regular.ttf", - "third_party/fonts/Ko.ttf", - "third_party/fonts/Ko.ttx", - "third_party/fonts/MultiAxis.ttf", - "third_party/fonts/MultiAxis.ttx", - "third_party/fonts/NoCmapFormat14.ttf", - "third_party/fonts/NoCmapFormat14.ttx", - "third_party/fonts/NoGlyphFont.ttf", - "third_party/fonts/NoGlyphFont.ttx", - "third_party/fonts/NotoColorEmoji.ttf", - "third_party/fonts/NotoNaskhArabic-Regular.ttf", - "third_party/fonts/NotoSansCJK-Regular.ttc", - "third_party/fonts/NotoSansKhmer-Regular.ttf", - "third_party/fonts/Regular.ttf", - "third_party/fonts/Regular.ttx", - "third_party/fonts/Roboto-Black.ttf", - "third_party/fonts/Roboto-BlackItalic.ttf", - "third_party/fonts/Roboto-Bold.ttf", - "third_party/fonts/Roboto-BoldItalic.ttf", - "third_party/fonts/Roboto-Italic.ttf", - "third_party/fonts/Roboto-Light.ttf", - "third_party/fonts/Roboto-LightItalic.ttf", - "third_party/fonts/Roboto-Medium.ttf", - "third_party/fonts/Roboto-MediumItalic.ttf", - "third_party/fonts/Roboto-Regular.ttf", - "third_party/fonts/Roboto-Thin.ttf", - "third_party/fonts/Roboto-ThinItalic.ttf", - "third_party/fonts/SourceHanSerifCN-Bold.otf", - "third_party/fonts/SourceHanSerifCN-Regular.otf", - "third_party/fonts/TextEmojiFont.ttf", - "third_party/fonts/TextEmojiFont.ttx", - "third_party/fonts/UnicodeBMPOnly.ttf", - "third_party/fonts/UnicodeBMPOnly.ttx", - "third_party/fonts/UnicodeBMPOnly2.ttf", - "third_party/fonts/UnicodeBMPOnly2.ttx", - "third_party/fonts/UnicodeUCS4.ttf", - "third_party/fonts/UnicodeUCS4.ttx", - "third_party/fonts/VariationSelectorTest-Regular.ttf", - "third_party/fonts/VariationSelectorTest-Regular.ttx", - "third_party/fonts/ZhHans.ttf", - "third_party/fonts/ZhHans.ttx", - "third_party/fonts/ZhHant.ttf", - "third_party/fonts/ZhHant.ttx", - "third_party/fonts/ahem.ttf", - "third_party/fonts/emoji.xml", - "third_party/fonts/itemize.xml", - ] -} + test_fixtures("txt_fixtures") { + fixtures = [ + "third_party/fonts/Bold.ttf", + "third_party/fonts/Bold.ttx", + "third_party/fonts/BoldItalic.ttf", + "third_party/fonts/BoldItalic.ttx", + "third_party/fonts/ColorEmojiFont.ttf", + "third_party/fonts/ColorEmojiFont.ttx", + "third_party/fonts/ColorTextMixedEmojiFont.ttf", + "third_party/fonts/ColorTextMixedEmojiFont.ttx", + "third_party/fonts/DroidSerif.ttf", + "third_party/fonts/Emoji.ttf", + "third_party/fonts/Emoji.ttx", + "third_party/fonts/HomemadeApple.ttf", + "third_party/fonts/Italic.ttf", + "third_party/fonts/Italic.ttx", + "third_party/fonts/Ja.ttf", + "third_party/fonts/Ja.ttx", + "third_party/fonts/Katibeh-Regular.ttf", + "third_party/fonts/Ko.ttf", + "third_party/fonts/Ko.ttx", + "third_party/fonts/MultiAxis.ttf", + "third_party/fonts/MultiAxis.ttx", + "third_party/fonts/NoCmapFormat14.ttf", + "third_party/fonts/NoCmapFormat14.ttx", + "third_party/fonts/NoGlyphFont.ttf", + "third_party/fonts/NoGlyphFont.ttx", + "third_party/fonts/NotoColorEmoji.ttf", + "third_party/fonts/NotoNaskhArabic-Regular.ttf", + "third_party/fonts/NotoSansCJK-Regular.ttc", + "third_party/fonts/NotoSansKhmer-Regular.ttf", + "third_party/fonts/Regular.ttf", + "third_party/fonts/Regular.ttx", + "third_party/fonts/Roboto-Black.ttf", + "third_party/fonts/Roboto-BlackItalic.ttf", + "third_party/fonts/Roboto-Bold.ttf", + "third_party/fonts/Roboto-BoldItalic.ttf", + "third_party/fonts/Roboto-Italic.ttf", + "third_party/fonts/Roboto-Light.ttf", + "third_party/fonts/Roboto-LightItalic.ttf", + "third_party/fonts/Roboto-Medium.ttf", + "third_party/fonts/Roboto-MediumItalic.ttf", + "third_party/fonts/Roboto-Regular.ttf", + "third_party/fonts/Roboto-Thin.ttf", + "third_party/fonts/Roboto-ThinItalic.ttf", + "third_party/fonts/SourceHanSerifCN-Bold.otf", + "third_party/fonts/SourceHanSerifCN-Regular.otf", + "third_party/fonts/TextEmojiFont.ttf", + "third_party/fonts/TextEmojiFont.ttx", + "third_party/fonts/UnicodeBMPOnly.ttf", + "third_party/fonts/UnicodeBMPOnly.ttx", + "third_party/fonts/UnicodeBMPOnly2.ttf", + "third_party/fonts/UnicodeBMPOnly2.ttx", + "third_party/fonts/UnicodeUCS4.ttf", + "third_party/fonts/UnicodeUCS4.ttx", + "third_party/fonts/VariationSelectorTest-Regular.ttf", + "third_party/fonts/VariationSelectorTest-Regular.ttx", + "third_party/fonts/ZhHans.ttf", + "third_party/fonts/ZhHans.ttx", + "third_party/fonts/ZhHant.ttf", + "third_party/fonts/ZhHant.ttx", + "third_party/fonts/ahem.ttf", + "third_party/fonts/emoji.xml", + "third_party/fonts/itemize.xml", + ] + } -executable("txt_unittests") { - testonly = true + source_set("txt_test_utils") { + sources = [ + "tests/txt_test_utils.cc", + "tests/txt_test_utils.h", + ] - sources = [ - "tests/CmapCoverageTest.cpp", - "tests/EmojiTest.cpp", - "tests/FileUtils.cpp", - "tests/FileUtils.h", - "tests/FontTestUtils.h", - "tests/GraphemeBreakTests.cpp", - "tests/ICUTestBase.h", - "tests/LayoutUtilsTest.cpp", - "tests/MeasurementTests.cpp", - "tests/SparseBitSetTest.cpp", - "tests/UnicodeUtils.cpp", - "tests/UnicodeUtils.h", - "tests/UnicodeUtilsTest.cpp", - "tests/font_collection_unittests.cc", - "tests/paragraph_unittests.cc", - "tests/render_test.cc", - "tests/render_test.h", - "tests/txt_run_all_unittests.cc", + deps = [ + ":txt", + "//flutter/fml", + "//third_party/skia", + ] + } - # These tests require static fixtures. - # "tests/FontCollectionItemizeTest.cpp", - # "tests/FontCollectionTest.cpp", - # "tests/FontFamilyTest.cpp", - # "tests/FontLanguageListCacheTest.cpp", - # "tests/FontTestUtils.cpp", - # "tests/HbFontCacheTest.cpp", - # "tests/HyphenatorTest.cpp", - # "tests/LayoutTest.cpp", - ] + executable("txt_benchmarks") { + testonly = true - if (!is_win) { - sources += [ - "tests/MinikinFontForTest.cpp", - "tests/MinikinFontForTest.h", + sources = [ + "benchmarks/paint_record_benchmarks.cc", + "benchmarks/paragraph_benchmarks.cc", + "benchmarks/paragraph_builder_benchmarks.cc", + "benchmarks/styled_runs_benchmarks.cc", + "benchmarks/txt_run_all_benchmarks.cc", ] - } - configs += [ ":allow_posix_names" ] + deps = [ + ":txt", + ":txt_fixtures", + ":txt_test_utils", + "//flutter/testing:testing_lib", + "//third_party/benchmark", + ] + txt_common_executable_deps - deps = [ - ":txt", - ":txt_test_utils", - "//flutter/testing:testing_lib", - ":txt_fixtures", - ] + txt_common_executable_deps -} + if (flutter_enable_skshaper) { + sources += [ "benchmarks/skparagraph_benchmarks.cc" ] -executable("txt_benchmarks") { - testonly = true + deps += [ "//third_party/skia/modules/skparagraph" ] + } + } - sources = [ - "benchmarks/paint_record_benchmarks.cc", - "benchmarks/paragraph_benchmarks.cc", - "benchmarks/paragraph_builder_benchmarks.cc", - "benchmarks/styled_runs_benchmarks.cc", - "benchmarks/txt_run_all_benchmarks.cc", - ] + executable("txt_unittests") { + testonly = true - deps = [ - ":txt", - ":txt_test_utils", - "//flutter/testing:testing_lib", - "//third_party/benchmark", - ":txt_fixtures", - ] + txt_common_executable_deps + sources = [ + "tests/CmapCoverageTest.cpp", + "tests/EmojiTest.cpp", + "tests/FileUtils.cpp", + "tests/FileUtils.h", + "tests/FontTestUtils.h", + "tests/GraphemeBreakTests.cpp", + "tests/ICUTestBase.h", + "tests/LayoutUtilsTest.cpp", + "tests/MeasurementTests.cpp", + "tests/SparseBitSetTest.cpp", + "tests/UnicodeUtils.cpp", + "tests/UnicodeUtils.h", + "tests/UnicodeUtilsTest.cpp", + "tests/font_collection_unittests.cc", + "tests/paragraph_unittests.cc", + "tests/render_test.cc", + "tests/render_test.h", + "tests/txt_run_all_unittests.cc", - if (flutter_enable_skshaper) { - sources += [ "benchmarks/skparagraph_benchmarks.cc" ] + # These tests require static fixtures. + # "tests/FontCollectionItemizeTest.cpp", + # "tests/FontCollectionTest.cpp", + # "tests/FontFamilyTest.cpp", + # "tests/FontLanguageListCacheTest.cpp", + # "tests/FontTestUtils.cpp", + # "tests/HbFontCacheTest.cpp", + # "tests/HyphenatorTest.cpp", + # "tests/LayoutTest.cpp", + ] - deps += [ "//third_party/skia/modules/skparagraph" ] + if (!is_win) { + sources += [ + "tests/MinikinFontForTest.cpp", + "tests/MinikinFontForTest.h", + ] + } + + configs += [ ":allow_posix_names" ] + + deps = [ + ":txt", + ":txt_test_utils", + "//flutter/testing:testing_lib", + ":txt_fixtures", + ] + txt_common_executable_deps } } diff --git a/third_party/txt/tests/txt_run_all_unittests.cc b/third_party/txt/tests/txt_run_all_unittests.cc index 4b2eda98724eb025d239ee02832ece4580e39a71..fa80a811f01879143eab0daa0800f2898f5749a3 100644 --- a/third_party/txt/tests/txt_run_all_unittests.cc +++ b/third_party/txt/tests/txt_run_all_unittests.cc @@ -32,7 +32,11 @@ int main(int argc, char** argv) { return EXIT_FAILURE; } FML_DCHECK(txt::GetFontDir().length() > 0); +#if defined(OS_FUCHSIA) + fml::icu::InitializeICU("/pkg/data/icudtl.dat"); +#else fml::icu::InitializeICU("icudtl.dat"); +#endif SkGraphics::Init(); testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); diff --git a/vulkan/vulkan_interface.h b/vulkan/vulkan_interface.h index 13f4ad9ffc44b90c8bfcafa4e79430150b6d6b58..29561b149a72be04cae4dd54cfd3b0705b757729 100644 --- a/vulkan/vulkan_interface.h +++ b/vulkan/vulkan_interface.h @@ -10,10 +10,6 @@ #include "flutter/fml/build_config.h" #include "flutter/fml/logging.h" -#if !defined(FUCHSIA_SDK) -#define VULKAN_LINK_STATICALLY OS_FUCHSIA -#endif // !defined(FUCHSIA_SDK) - #if OS_ANDROID #ifndef VK_USE_PLATFORM_ANDROID_KHR #define VK_USE_PLATFORM_ANDROID_KHR 1