Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_43355755
engine
提交
805a8874
E
engine
项目概览
weixin_43355755
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
805a8874
编写于
5月 06, 2020
作者:
R
Robert Ancell
提交者:
GitHub
5月 06, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add first Linux shell tests (#18159)
上级
cf13c7f7
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
72 addition
and
1 deletion
+72
-1
BUILD.gn
BUILD.gn
+4
-0
ci/licenses_golden/licenses_flutter
ci/licenses_golden/licenses_flutter
+1
-0
shell/platform/linux/BUILD.gn
shell/platform/linux/BUILD.gn
+26
-0
shell/platform/linux/fl_dart_project_test.cc
shell/platform/linux/fl_dart_project_test.cc
+37
-0
shell/platform/linux/public/flutter_linux/fl_dart_project.h
shell/platform/linux/public/flutter_linux/fl_dart_project.h
+1
-1
testing/run_tests.py
testing/run_tests.py
+3
-0
未找到文件。
BUILD.gn
浏览文件 @
805a8874
...
...
@@ -106,6 +106,10 @@ group("flutter") {
"//flutter/shell/platform/windows/client_wrapper:client_wrapper_windows_unittests",
]
}
if (is_linux) {
public_deps +=
[ "//flutter/shell/platform/linux:flutter_linux_unittests" ]
}
}
}
}
...
...
ci/licenses_golden/licenses_flutter
浏览文件 @
805a8874
...
...
@@ -1174,6 +1174,7 @@ FILE: ../../../flutter/shell/platform/glfw/text_input_plugin.h
FILE: ../../../flutter/shell/platform/linux/fl_binary_messenger.cc
FILE: ../../../flutter/shell/platform/linux/fl_binary_messenger_private.h
FILE: ../../../flutter/shell/platform/linux/fl_dart_project.cc
FILE: ../../../flutter/shell/platform/linux/fl_dart_project_test.cc
FILE: ../../../flutter/shell/platform/linux/fl_engine.cc
FILE: ../../../flutter/shell/platform/linux/fl_engine_private.h
FILE: ../../../flutter/shell/platform/linux/fl_renderer.cc
...
...
shell/platform/linux/BUILD.gn
浏览文件 @
805a8874
...
...
@@ -5,6 +5,7 @@
assert(is_linux)
import("//flutter/shell/platform/glfw/config.gni")
import("//flutter/testing/testing.gni")
group("linux") {
deps = [
...
...
@@ -80,6 +81,31 @@ source_set("flutter_linux") {
]
}
test_fixtures("flutter_linux_fixtures") {
fixtures = []
}
executable("flutter_linux_unittests") {
testonly = true
sources = [
"fl_dart_project_test.cc",
]
public_configs = [ "//flutter:config" ]
configs += [ "//flutter/shell/platform/linux/config:gtk" ]
# Set flag to allow public headers to be directly included (library users should not do this)
defines = [ "FLUTTER_LINUX_COMPILATION" ]
deps = [
":flutter_linux",
":flutter_linux_fixtures",
"//flutter/testing",
]
}
shared_library("flutter_linux_gtk") {
deps = [
":flutter_linux",
...
...
shell/platform/linux/fl_dart_project_test.cc
0 → 100644
浏览文件 @
805a8874
// 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.
#include "flutter/shell/platform/linux/public/flutter_linux/fl_dart_project.h"
#include "gtest/gtest.h"
#include <gmodule.h>
TEST
(
FlDartProjectTest
,
GetPath
)
{
g_autoptr
(
FlDartProject
)
project
=
fl_dart_project_new
(
"/projects/my_dart_project"
);
EXPECT_STREQ
(
fl_dart_project_get_path
(
project
),
"/projects/my_dart_project"
);
}
TEST
(
FlDartProjectTest
,
GetPathRelative
)
{
g_autoptr
(
FlDartProject
)
project
=
fl_dart_project_new
(
"foo"
);
g_autofree
gchar
*
exe_path
=
g_file_read_link
(
"/proc/self/exe"
,
nullptr
);
ASSERT_TRUE
(
exe_path
!=
nullptr
);
g_autofree
gchar
*
dir
=
g_path_get_dirname
(
exe_path
);
g_autofree
gchar
*
expected_path
=
g_build_filename
(
dir
,
"foo"
,
nullptr
);
EXPECT_STREQ
(
fl_dart_project_get_path
(
project
),
expected_path
);
}
TEST
(
FlDartProjectTest
,
GetAssetsPath
)
{
g_autoptr
(
FlDartProject
)
project
=
fl_dart_project_new
(
"/projects/my_dart_project"
);
g_autofree
gchar
*
assets_path
=
fl_dart_project_get_assets_path
(
project
);
EXPECT_STREQ
(
assets_path
,
"/projects/my_dart_project/flutter_assets"
);
}
TEST
(
FlDartProjectTest
,
GetIcuDataPath
)
{
g_autoptr
(
FlDartProject
)
project
=
fl_dart_project_new
(
"/projects/my_dart_project"
);
g_autofree
gchar
*
assets_path
=
fl_dart_project_get_icu_data_path
(
project
);
EXPECT_STREQ
(
assets_path
,
"/projects/my_dart_project/icudtl.dat"
);
}
shell/platform/linux/public/flutter_linux/fl_dart_project.h
浏览文件 @
805a8874
...
...
@@ -71,7 +71,7 @@ const gchar* fl_dart_project_get_path(FlDartProject* project);
* application.
*
* Returns: (type filename): a file path, e.g.
* "/projects/my_dart_project/assets"
* "/projects/my_dart_project/
flutter_
assets"
*/
gchar
*
fl_dart_project_get_assets_path
(
FlDartProject
*
project
);
...
...
testing/run_tests.py
浏览文件 @
805a8874
...
...
@@ -153,6 +153,9 @@ def RunCCTests(build_dir, filter):
if
IsLinux
():
RunEngineExecutable
(
build_dir
,
'txt_unittests'
,
filter
,
shuffle_flags
)
if
IsLinux
():
RunEngineExecutable
(
build_dir
,
'flutter_linux_unittests'
,
filter
,
shuffle_flags
)
def
RunEngineBenchmarks
(
build_dir
,
filter
):
print
(
"Running Engine Benchmarks."
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录