stuartmorgan 4266f8583f
Add desktop shell unittests to test script (#8600)
Builds the unit test on all platforms, and adds them to the aggregate test script.
2019-04-16 22:37:39 -07:00

102 lines
2.9 KiB
Plaintext

# Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("publish.gni")
_wrapper_includes = [
"include/flutter/basic_message_channel.h",
"include/flutter/binary_messenger.h",
"include/flutter/encodable_value.h",
"include/flutter/engine_method_result.h",
"include/flutter/json_message_codec.h",
"include/flutter/json_method_codec.h",
"include/flutter/json_type.h",
"include/flutter/message_codec.h",
"include/flutter/method_call.h",
"include/flutter/method_channel.h",
"include/flutter/method_codec.h",
"include/flutter/method_result.h",
"include/flutter/plugin_registrar.h",
"include/flutter/standard_message_codec.h",
"include/flutter/standard_method_codec.h",
]
# TODO: Once the wrapper API is more stable, consolidate to as few files as is
# reasonable (without forcing different kinds of clients to take unnecessary
# code) to simplify use.
_wrapper_sources = [
"byte_stream_wrappers.h",
"engine_method_result.cc",
"json_message_codec.cc", # TODO combine into a single json_codec.cc.
"json_method_codec.cc", # TODO combine into a single json_codec.cc.
"plugin_registrar.cc",
"standard_codec_serializer.h",
"standard_codec.cc",
]
# Client library build for internal use by the shell implementation.
source_set("client_wrapper") {
sources = _wrapper_sources
public = _wrapper_includes
deps = [
"$flutter_root/shell/platform/common/cpp:common_cpp_library_headers",
"//third_party/rapidjson",
]
defines = [ "USE_RAPID_JSON" ]
configs += [
"$flutter_root/shell/platform/common/cpp:desktop_library_implementation",
]
public_configs = [
"$flutter_root/shell/platform/common/cpp:relative_flutter_library_headers",
]
}
# Copies the client wrapper code to the output directory.
publish_client_wrapper("publish_wrapper") {
public = _wrapper_includes
sources = _wrapper_sources + [ "README" ]
}
source_set("client_wrapper_library_stubs") {
sources = [
"testing/stub_flutter_api.cc",
"testing/stub_flutter_api.h",
]
defines = [ "FLUTTER_DESKTOP_LIBRARY" ]
public_deps = [
"$flutter_root/shell/platform/common/cpp:common_cpp_library_headers",
]
}
executable("client_wrapper_unittests") {
testonly = true
# TODO: Add more unit tests.
sources = [
"encodable_value_unittests.cc",
"method_call_unittests.cc",
"plugin_registrar_unittests.cc",
"standard_message_codec_unittests.cc",
"standard_method_codec_unittests.cc",
"testing/encodable_value_utils.cc",
"testing/encodable_value_utils.h",
]
deps = [
":client_wrapper",
":client_wrapper_library_stubs",
"$flutter_root/testing",
# TODO: Consider refactoring flutter_root/testing so that there's a testing
# target that doesn't require a Dart runtime to be linked in.
"//third_party/dart/runtime:libdart_jit",
]
}