Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
dbbeccc4
P
Paddle
项目概览
Crayon鑫
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
dbbeccc4
编写于
5月 16, 2018
作者:
L
Lei Wang
提交者:
GitHub
5月 16, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Scripts: add a feature to run a single test. (#10678)
上级
63012df4
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
33 addition
and
6 deletion
+33
-6
paddle/scripts/paddle_build.sh
paddle/scripts/paddle_build.sh
+32
-6
paddle/scripts/paddle_docker_build.sh
paddle/scripts/paddle_docker_build.sh
+1
-0
未找到文件。
paddle/scripts/paddle_build.sh
浏览文件 @
dbbeccc4
...
@@ -20,19 +20,15 @@
...
@@ -20,19 +20,15 @@
#=================================================
#=================================================
function
print_usage
()
{
function
print_usage
()
{
RED
=
'\033[0;31m'
BLUE
=
'\033[0;34m'
BOLD
=
'\033[1m'
NONE
=
'\033[0m'
echo
-e
"
\n
${
RED
}
Usage
${
NONE
}
:
echo
-e
"
\n
${
RED
}
Usage
${
NONE
}
:
${
BOLD
}
$
0
${
NONE
}
[OPTION]"
${
BOLD
}$
{
SCRIPT_NAME
}
${
NONE
}
[OPTION]"
echo
-e
"
\n
${
RED
}
Options
${
NONE
}
:
echo
-e
"
\n
${
RED
}
Options
${
NONE
}
:
${
BLUE
}
build
${
NONE
}
: run build for x86 platform
${
BLUE
}
build
${
NONE
}
: run build for x86 platform
${
BLUE
}
build_android
${
NONE
}
: run build for android platform
${
BLUE
}
build_android
${
NONE
}
: run build for android platform
${
BLUE
}
build_ios
${
NONE
}
: run build for ios platform
${
BLUE
}
build_ios
${
NONE
}
: run build for ios platform
${
BLUE
}
test
${
NONE
}
: run all unit tests
${
BLUE
}
test
${
NONE
}
: run all unit tests
${
BLUE
}
single_test
${
NONE
}
: run a single unit test
${
BLUE
}
bind_test
${
NONE
}
: parallel tests bind to different GPU
${
BLUE
}
bind_test
${
NONE
}
: parallel tests bind to different GPU
${
BLUE
}
doc
${
NONE
}
: generate paddle documents
${
BLUE
}
doc
${
NONE
}
: generate paddle documents
${
BLUE
}
html
${
NONE
}
: convert C++ source code into HTML
${
BLUE
}
html
${
NONE
}
: convert C++ source code into HTML
...
@@ -45,7 +41,15 @@ function print_usage() {
...
@@ -45,7 +41,15 @@ function print_usage() {
}
}
function
init
()
{
function
init
()
{
RED
=
'\033[0;31m'
BLUE
=
'\033[0;34m'
BOLD
=
'\033[1m'
NONE
=
'\033[0m'
PADDLE_ROOT
=
"
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
/../../"
&&
pwd
)
"
PADDLE_ROOT
=
"
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
/../../"
&&
pwd
)
"
if
[
-z
"
${
SCRIPT_NAME
}
"
]
;
then
SCRIPT_NAME
=
$0
fi
}
}
function
cmake_gen
()
{
function
cmake_gen
()
{
...
@@ -309,6 +313,25 @@ EOF
...
@@ -309,6 +313,25 @@ EOF
fi
fi
}
}
function
single_test
()
{
TEST_NAME
=
$1
if
[
-z
"
${
TEST_NAME
}
"
]
;
then
echo
-e
"
${
RED
}
Usage:
${
NONE
}
"
echo
-e
"
${
BOLD
}${
SCRIPT_NAME
}${
NONE
}
${
BLUE
}
single_test
${
NONE
}
[test_name]"
exit
1
fi
mkdir
-p
${
PADDLE_ROOT
}
/build
cd
${
PADDLE_ROOT
}
/build
if
[
${
WITH_TESTING
:-
ON
}
==
"ON"
]
;
then
cat
<<
EOF
========================================
Running
${
TEST_NAME
}
...
========================================
EOF
ctest
--output-on-failure
-R
${
TEST_NAME
}
fi
}
function
bind_test
()
{
function
bind_test
()
{
# the number of process to run tests
# the number of process to run tests
NUM_PROC
=
6
NUM_PROC
=
6
...
@@ -491,6 +514,9 @@ function main() {
...
@@ -491,6 +514,9 @@ function main() {
test
)
test
)
run_test
run_test
;;
;;
single_test
)
single_test
$2
;;
bind_test
)
bind_test
)
bind_test
bind_test
;;
;;
...
...
paddle/scripts/paddle_docker_build.sh
浏览文件 @
dbbeccc4
...
@@ -63,6 +63,7 @@ EOL
...
@@ -63,6 +63,7 @@ EOL
${
DOCKER_CMD
}
run
-it
\
${
DOCKER_CMD
}
run
-it
\
--name
$CONTAINER_ID
\
--name
$CONTAINER_ID
\
${
DOCKER_ENV
}
\
${
DOCKER_ENV
}
\
-e
SCRIPT_NAME
=
$0
\
-v
$PADDLE_ROOT
:/paddle
\
-v
$PADDLE_ROOT
:/paddle
\
-v
${
HOME
}
/.ccache:/root/.ccache
\
-v
${
HOME
}
/.ccache:/root/.ccache
\
-w
/paddle
\
-w
/paddle
\
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录