mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Add desktop shell unittests to test script (flutter/engine#8600)
Builds the unit test on all platforms, and adds them to the aggregate test script.
This commit is contained in:
parent
bf6e2b2855
commit
e722bba483
@ -49,20 +49,15 @@ group("flutter") {
|
||||
"$flutter_root/fml:fml_unittests",
|
||||
"$flutter_root/runtime:runtime_unittests",
|
||||
"$flutter_root/shell/common:shell_unittests",
|
||||
"$flutter_root/shell/platform/common/cpp/client_wrapper:client_wrapper_unittests",
|
||||
"$flutter_root/shell/platform/embedder:embedder_unittests",
|
||||
"$flutter_root/shell/platform/glfw/client_wrapper:client_wrapper_glfw_unittests",
|
||||
"$flutter_root/third_party/txt:txt_unittests",
|
||||
]
|
||||
|
||||
if (!is_win) {
|
||||
public_deps += [ "$flutter_root/shell/common:shell_benchmarks" ]
|
||||
}
|
||||
|
||||
if (is_linux) {
|
||||
public_deps += [
|
||||
"$flutter_root/shell/platform/common/cpp/client_wrapper:client_wrapper_unittests",
|
||||
"$flutter_root/shell/platform/glfw/client_wrapper:client_wrapper_glfw_unittests",
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -68,6 +68,8 @@ source_set("client_wrapper_library_stubs") {
|
||||
"testing/stub_flutter_api.h",
|
||||
]
|
||||
|
||||
defines = [ "FLUTTER_DESKTOP_LIBRARY" ]
|
||||
|
||||
public_deps = [
|
||||
"$flutter_root/shell/platform/common/cpp:common_cpp_library_headers",
|
||||
]
|
||||
|
||||
@ -59,7 +59,7 @@ TEST(EncodableValueTest, LongValueFromInt) {
|
||||
}
|
||||
|
||||
TEST(EncodableValueTest, Long) {
|
||||
EncodableValue value(42l);
|
||||
EncodableValue value(INT64_C(42));
|
||||
VerifyType(value, EncodableValue::Type::kLong);
|
||||
|
||||
EXPECT_EQ(value.LongValue(), 42);
|
||||
@ -170,7 +170,7 @@ TEST(EncodableValueTest, List) {
|
||||
TEST(EncodableValueTest, Map) {
|
||||
EncodableMap encodables = {
|
||||
{EncodableValue(), EncodableValue(std::vector<int32_t>{1, 2, 3})},
|
||||
{EncodableValue(1), EncodableValue(10000l)},
|
||||
{EncodableValue(1), EncodableValue(INT64_C(10000))},
|
||||
{EncodableValue("two"), EncodableValue(7)},
|
||||
};
|
||||
EncodableValue value(encodables);
|
||||
@ -178,7 +178,7 @@ TEST(EncodableValueTest, Map) {
|
||||
|
||||
EncodableMap& map_value = value.MapValue();
|
||||
EXPECT_EQ(map_value[EncodableValue()].IsIntList(), true);
|
||||
EXPECT_EQ(map_value[EncodableValue(1)].LongValue(), 10000l);
|
||||
EXPECT_EQ(map_value[EncodableValue(1)].LongValue(), INT64_C(10000));
|
||||
EXPECT_EQ(map_value[EncodableValue("two")].IntValue(), 7);
|
||||
|
||||
// Ensure that it's a modifiable copy of the original map.
|
||||
@ -192,7 +192,8 @@ TEST(EncodableValueTest, EmptyTypeConstructor) {
|
||||
EXPECT_TRUE(EncodableValue(EncodableValue::Type::kNull).IsNull());
|
||||
EXPECT_EQ(EncodableValue(EncodableValue::Type::kBool).BoolValue(), false);
|
||||
EXPECT_EQ(EncodableValue(EncodableValue::Type::kInt).IntValue(), 0);
|
||||
EXPECT_EQ(EncodableValue(EncodableValue::Type::kLong).LongValue(), 0l);
|
||||
EXPECT_EQ(EncodableValue(EncodableValue::Type::kLong).LongValue(),
|
||||
INT64_C(0));
|
||||
EXPECT_EQ(EncodableValue(EncodableValue::Type::kDouble).DoubleValue(), 0.0);
|
||||
EXPECT_EQ(EncodableValue(EncodableValue::Type::kString).StringValue().size(),
|
||||
0u);
|
||||
@ -226,9 +227,9 @@ TEST(EncodableValueTest, Comparison) {
|
||||
EncodableValue(0),
|
||||
EncodableValue(100),
|
||||
// Long
|
||||
EncodableValue(-7l),
|
||||
EncodableValue(0l),
|
||||
EncodableValue(100l),
|
||||
EncodableValue(INT64_C(-7)),
|
||||
EncodableValue(INT64_C(0)),
|
||||
EncodableValue(INT64_C(100)),
|
||||
// Double
|
||||
EncodableValue(-7.0),
|
||||
EncodableValue(0.0),
|
||||
@ -243,11 +244,11 @@ TEST(EncodableValueTest, Comparison) {
|
||||
EncodableValue(std::vector<int32_t>{0, 1}),
|
||||
EncodableValue(std::vector<int32_t>{0, 100}),
|
||||
// LongList
|
||||
EncodableValue(std::vector<int64_t>{0, 1l}),
|
||||
EncodableValue(std::vector<int64_t>{0, 100l}),
|
||||
EncodableValue(std::vector<int64_t>{0, INT64_C(1)}),
|
||||
EncodableValue(std::vector<int64_t>{0, INT64_C(100)}),
|
||||
// DoubleList
|
||||
EncodableValue(std::vector<int64_t>{0, 1l}),
|
||||
EncodableValue(std::vector<int64_t>{0, 100l}),
|
||||
EncodableValue(std::vector<int64_t>{0, INT64_C(1)}),
|
||||
EncodableValue(std::vector<int64_t>{0, INT64_C(100)}),
|
||||
// List
|
||||
EncodableValue(EncodableList{EncodableValue(), EncodableValue(true)}),
|
||||
EncodableValue(EncodableList{EncodableValue(), EncodableValue(1.0)}),
|
||||
@ -289,7 +290,7 @@ TEST(EncodableValueTest, DeepCopy) {
|
||||
EncodableList encodables = {
|
||||
EncodableValue(EncodableMap{
|
||||
{EncodableValue(), EncodableValue(std::vector<int32_t>{1, 2, 3})},
|
||||
{EncodableValue(1), EncodableValue(10000l)},
|
||||
{EncodableValue(1), EncodableValue(INT64_C(0000))},
|
||||
{EncodableValue("two"), EncodableValue(7)},
|
||||
}),
|
||||
EncodableValue(EncodableList{
|
||||
|
||||
@ -72,7 +72,7 @@ TEST(StandardMessageCodec, CanEncodeAndDecodeInt32) {
|
||||
TEST(StandardMessageCodec, CanEncodeAndDecodeInt64) {
|
||||
std::vector<uint8_t> bytes = {0x04, 0xef, 0xcd, 0xab, 0x90,
|
||||
0x78, 0x56, 0x34, 0x12};
|
||||
CheckEncodeDecode(EncodableValue(0x1234567890abcdef), bytes);
|
||||
CheckEncodeDecode(EncodableValue(INT64_C(0x1234567890abcdef)), bytes);
|
||||
}
|
||||
|
||||
TEST(StandardMessageCodec, CanEncodeAndDecodeDouble) {
|
||||
|
||||
@ -52,6 +52,8 @@ source_set("client_wrapper_library_stubs_glfw") {
|
||||
"testing/stub_flutter_glfw_api.h",
|
||||
]
|
||||
|
||||
defines = [ "FLUTTER_DESKTOP_LIBRARY" ]
|
||||
|
||||
public_deps = [
|
||||
"$flutter_root/shell/platform/glfw:flutter_glfw_headers",
|
||||
]
|
||||
|
||||
@ -38,6 +38,12 @@ echo "Running runtime_unittests..."
|
||||
echo "Running shell_unittests..."
|
||||
"$HOST_DIR/shell_unittests"
|
||||
|
||||
echo "Running client_wrapper_unittests..."
|
||||
"$HOST_DIR/client_wrapper_unittests"
|
||||
|
||||
echo "Running client_wrapper_glfw_unittests..."
|
||||
"$HOST_DIR/client_wrapper_glfw_unittests"
|
||||
|
||||
echo "Running txt_unittests..."
|
||||
"$HOST_DIR/txt_unittests" --font-directory="$BUILDROOT_DIR/flutter/third_party/txt/third_party/fonts"
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user