Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
iSulad
提交
19141100
I
iSulad
项目概览
openeuler
/
iSulad
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
iSulad
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
19141100
编写于
6月 16, 2020
作者:
O
openeuler-ci-bot
提交者:
Gitee
6月 16, 2020
浏览文件
操作
浏览文件
下载
差异文件
!464 iSulad: change llt to ut
Merge pull request !464 from Jackey_1024/0616
上级
099de498
96e2f477
变更
53
隐藏空白更改
内联
并排
Showing
53 changed file
with
200 addition
and
200 deletion
+200
-200
CMakeLists.txt
CMakeLists.txt
+4
-4
test/CMakeLists.txt
test/CMakeLists.txt
+1
-1
test/cmd/CMakeLists.txt
test/cmd/CMakeLists.txt
+1
-1
test/cmd/isula/CMakeLists.txt
test/cmd/isula/CMakeLists.txt
+1
-1
test/cmd/isula/extend/CMakeLists.txt
test/cmd/isula/extend/CMakeLists.txt
+1
-1
test/cmd/isula/extend/pause/CMakeLists.txt
test/cmd/isula/extend/pause/CMakeLists.txt
+3
-3
test/cmd/isula/extend/pause/pause_ut.cpp
test/cmd/isula/extend/pause/pause_ut.cpp
+0
-0
test/cmd/isula/extend/resume/CMakeLists.txt
test/cmd/isula/extend/resume/CMakeLists.txt
+3
-3
test/cmd/isula/extend/resume/resume_ut.cpp
test/cmd/isula/extend/resume/resume_ut.cpp
+0
-0
test/cmd/isula/infomation/CMakeLists.txt
test/cmd/isula/infomation/CMakeLists.txt
+1
-1
test/cmd/isula/infomation/info/CMakeLists.txt
test/cmd/isula/infomation/info/CMakeLists.txt
+3
-3
test/cmd/isula/infomation/info/info_ut.cpp
test/cmd/isula/infomation/info/info_ut.cpp
+0
-0
test/cmd/isula/infomation/ps/CMakeLists.txt
test/cmd/isula/infomation/ps/CMakeLists.txt
+3
-3
test/cmd/isula/infomation/ps/ps_ut.cpp
test/cmd/isula/infomation/ps/ps_ut.cpp
+1
-1
test/cmd/isulad-shim/CMakeLists.txt
test/cmd/isulad-shim/CMakeLists.txt
+3
-3
test/cmd/isulad-shim/isulad-shim_ut.cpp
test/cmd/isulad-shim/isulad-shim_ut.cpp
+1
-1
test/cutils/CMakeLists.txt
test/cutils/CMakeLists.txt
+1
-1
test/cutils/utils_array/CMakeLists.txt
test/cutils/utils_array/CMakeLists.txt
+3
-3
test/cutils/utils_array/utils_array_ut.cpp
test/cutils/utils_array/utils_array_ut.cpp
+1
-1
test/cutils/utils_convert/CMakeLists.txt
test/cutils/utils_convert/CMakeLists.txt
+3
-3
test/cutils/utils_convert/utils_convert_ut.cpp
test/cutils/utils_convert/utils_convert_ut.cpp
+1
-1
test/cutils/utils_string/CMakeLists.txt
test/cutils/utils_string/CMakeLists.txt
+3
-3
test/cutils/utils_string/utils_string_ut.cpp
test/cutils/utils_string/utils_string_ut.cpp
+19
-19
test/image/CMakeLists.txt
test/image/CMakeLists.txt
+1
-1
test/image/oci/CMakeLists.txt
test/image/oci/CMakeLists.txt
+1
-1
test/image/oci/oci_config_merge/CMakeLists.txt
test/image/oci/oci_config_merge/CMakeLists.txt
+4
-4
test/image/oci/oci_config_merge/oci_config_merge_ut.cpp
test/image/oci/oci_config_merge/oci_config_merge_ut.cpp
+3
-3
test/image/oci/oci_ut_common.cpp
test/image/oci/oci_ut_common.cpp
+2
-2
test/image/oci/oci_ut_common.h
test/image/oci/oci_ut_common.h
+5
-5
test/path/CMakeLists.txt
test/path/CMakeLists.txt
+3
-3
test/path/path_ut.cpp
test/path/path_ut.cpp
+15
-15
test/runtime/CMakeLists.txt
test/runtime/CMakeLists.txt
+1
-1
test/runtime/isula/CMakeLists.txt
test/runtime/isula/CMakeLists.txt
+4
-4
test/runtime/isula/isula_rt_ops_ut.cpp
test/runtime/isula/isula_rt_ops_ut.cpp
+2
-2
test/runtime/lcr/CMakeLists.txt
test/runtime/lcr/CMakeLists.txt
+4
-4
test/runtime/lcr/lcr_rt_ops_ut.cpp
test/runtime/lcr/lcr_rt_ops_ut.cpp
+2
-2
test/services/CMakeLists.txt
test/services/CMakeLists.txt
+1
-1
test/services/execution/CMakeLists.txt
test/services/execution/CMakeLists.txt
+1
-1
test/services/execution/execute/CMakeLists.txt
test/services/execution/execute/CMakeLists.txt
+1
-1
test/services/execution/execute/execution_extend/CMakeLists.txt
...ervices/execution/execute/execution_extend/CMakeLists.txt
+3
-3
test/services/execution/execute/execution_extend/execution_extend_ut.cpp
...xecution/execute/execution_extend/execution_extend_ut.cpp
+1
-1
test/services/execution/spec/CMakeLists.txt
test/services/execution/spec/CMakeLists.txt
+5
-5
test/services/execution/spec/selinux_label_mock_ut.cpp
test/services/execution/spec/selinux_label_mock_ut.cpp
+0
-0
test/services/execution/spec/selinux_label_ut.cpp
test/services/execution/spec/selinux_label_ut.cpp
+0
-0
test/services/graphdriver/CMakeLists.txt
test/services/graphdriver/CMakeLists.txt
+1
-1
test/services/graphdriver/driver/CMakeLists.txt
test/services/graphdriver/driver/CMakeLists.txt
+3
-3
test/services/graphdriver/driver/driver_ut.cpp
test/services/graphdriver/driver/driver_ut.cpp
+8
-8
test/specs/CMakeLists.txt
test/specs/CMakeLists.txt
+1
-1
test/specs/specs/CMakeLists.txt
test/specs/specs/CMakeLists.txt
+4
-4
test/specs/specs/specs_ut.cpp
test/specs/specs/specs_ut.cpp
+8
-8
test/specs/specs_extend/CMakeLists.txt
test/specs/specs_extend/CMakeLists.txt
+4
-4
test/specs/specs_extend/specs_extend_ut.cpp
test/specs/specs_extend/specs_extend_ut.cpp
+13
-13
test/test.sh
test/test.sh
+42
-42
未找到文件。
CMakeLists.txt
浏览文件 @
19141100
...
...
@@ -53,7 +53,7 @@ configure_file(
# parse .proto files
include
(
cmake/protoc.cmake
)
#
ll
t and coverage
#
unit tes
t and coverage
SET
(
CMAKE_VERBOSE_MAKEFILE OFF
)
IF
(
ENABLE_COVERAGE
)
MESSAGE
(
STATUS
"Enable coverage compile option"
)
...
...
@@ -72,11 +72,11 @@ IF(CMAKE_BUILD_TYPE STREQUAL Debug)
ENDIF
()
add_subdirectory
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/src
)
OPTION
(
ENABLE_
LLT
"ll
t switch"
OFF
)
IF
(
ENABLE_
LL
T
)
OPTION
(
ENABLE_
UT
"u
t switch"
OFF
)
IF
(
ENABLE_
U
T
)
enable_testing
()
add_subdirectory
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/test
)
ENDIF
(
ENABLE_
LL
T
)
ENDIF
(
ENABLE_
U
T
)
# install all files
install
(
FILES
${
CMAKE_BINARY_DIR
}
/conf/isulad.pc
...
...
test/CMakeLists.txt
浏览文件 @
19141100
project
(
iSulad_
LL
T
)
project
(
iSulad_
U
T
)
function
(
gmock_find_library _name
)
find_library
(
${
_name
}
...
...
test/cmd/CMakeLists.txt
浏览文件 @
19141100
project
(
iSulad_
LL
T
)
project
(
iSulad_
U
T
)
add_subdirectory
(
isula
)
add_subdirectory
(
isulad-shim
)
test/cmd/isula/CMakeLists.txt
浏览文件 @
19141100
project
(
iSulad_
LL
T
)
project
(
iSulad_
U
T
)
add_subdirectory
(
infomation
)
add_subdirectory
(
extend
)
test/cmd/isula/extend/CMakeLists.txt
浏览文件 @
19141100
project
(
iSulad_
LL
T
)
project
(
iSulad_
U
T
)
add_subdirectory
(
pause
)
add_subdirectory
(
resume
)
test/cmd/isula/extend/pause/CMakeLists.txt
浏览文件 @
19141100
project
(
iSulad_
LL
T
)
project
(
iSulad_
U
T
)
SET
(
EXE pause_
ll
t
)
SET
(
EXE pause_
u
t
)
add_executable
(
${
EXE
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../../../src/cutils/utils_string.c
...
...
@@ -27,7 +27,7 @@ add_executable(${EXE}
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../../../src/cmd/isula/extend/pause.c
# ${CMAKE_CURRENT_SOURCE_DIR}/../../../../mocks/LcrcConnectMock.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../../mocks/grpc_client_mock.cc
pause_
llt.cc
)
pause_
ut.cpp
)
target_include_directories
(
${
EXE
}
PUBLIC
${
GTEST_INCLUDE_DIR
}
...
...
test/cmd/isula/extend/pause/pause_
llt.cc
→
test/cmd/isula/extend/pause/pause_
ut.cpp
浏览文件 @
19141100
文件已移动
test/cmd/isula/extend/resume/CMakeLists.txt
浏览文件 @
19141100
project
(
iSulad_
LL
T
)
project
(
iSulad_
U
T
)
SET
(
EXE resume_
ll
t
)
SET
(
EXE resume_
u
t
)
add_executable
(
${
EXE
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../../../src/cutils/utils_string.c
...
...
@@ -27,7 +27,7 @@ add_executable(${EXE}
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../../../src/cmd/isula/extend/resume.c
# ${CMAKE_CURRENT_SOURCE_DIR}/../../../../mocks/LcrcConnectMock.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../../mocks/grpc_client_mock.cc
resume_
llt.cc
)
resume_
ut.cpp
)
target_include_directories
(
${
EXE
}
PUBLIC
${
GTEST_INCLUDE_DIR
}
...
...
test/cmd/isula/extend/resume/resume_
llt.cc
→
test/cmd/isula/extend/resume/resume_
ut.cpp
浏览文件 @
19141100
文件已移动
test/cmd/isula/infomation/CMakeLists.txt
浏览文件 @
19141100
project
(
iSulad_
LL
T
)
project
(
iSulad_
U
T
)
add_subdirectory
(
ps
)
add_subdirectory
(
info
)
test/cmd/isula/infomation/info/CMakeLists.txt
浏览文件 @
19141100
project
(
iSulad_
LL
T
)
project
(
iSulad_
U
T
)
SET
(
EXE info_
ll
t
)
SET
(
EXE info_
u
t
)
add_executable
(
${
EXE
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../../../src/cutils/utils_string.c
...
...
@@ -27,7 +27,7 @@ add_executable(${EXE}
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../../../src/connect/client/isula_connect.c
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../../../src/cmd/isula/information/info.c
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../../mocks/grpc_client_mock.cc
info_
llt.cc
)
info_
ut.cpp
)
target_include_directories
(
${
EXE
}
PUBLIC
${
GTEST_INCLUDE_DIR
}
...
...
test/cmd/isula/infomation/info/info_
llt.cc
→
test/cmd/isula/infomation/info/info_
ut.cpp
浏览文件 @
19141100
文件已移动
test/cmd/isula/infomation/ps/CMakeLists.txt
浏览文件 @
19141100
project
(
iSulad_
LL
T
)
project
(
iSulad_
U
T
)
SET
(
EXE ps_
ll
t
)
SET
(
EXE ps_
u
t
)
add_executable
(
${
EXE
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../../../src/cutils/utils_string.c
...
...
@@ -26,7 +26,7 @@ add_executable(${EXE}
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../../../src/connect/client/isula_connect.c
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../../../src/cmd/isula/information/ps.c
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../../mocks/grpc_client_mock.cc
ps_
llt.cc
)
ps_
ut.cpp
)
target_include_directories
(
${
EXE
}
PUBLIC
${
GTEST_INCLUDE_DIR
}
...
...
test/cmd/isula/infomation/ps/ps_
llt.cc
→
test/cmd/isula/infomation/ps/ps_
ut.cpp
浏览文件 @
19141100
/*
* Copyright (c) Huawei Technologies Co., Ltd. 2019-2020. All rights reserved.
* Description: ps
ll
t
* Description: ps
unit tes
t
* Author: wujing
* Create: 2019-12-19
*/
...
...
test/cmd/isulad-shim/CMakeLists.txt
浏览文件 @
19141100
project
(
iSulad_
LL
T
)
project
(
iSulad_
U
T
)
SET
(
EXE isulad-shim_
ll
t
)
SET
(
EXE isulad-shim_
u
t
)
add_executable
(
${
EXE
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../src/cmd/isulad-shim/process.c
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../src/cmd/isulad-shim/common.c
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../src/cmd/isulad-shim/terminal.c
isulad-shim_
llt.cc
)
isulad-shim_
ut.cpp
)
target_include_directories
(
${
EXE
}
PUBLIC
${
GTEST_INCLUDE_DIR
}
...
...
test/cmd/isulad-shim/isulad-shim_
llt.cc
→
test/cmd/isulad-shim/isulad-shim_
ut.cpp
浏览文件 @
19141100
/*
* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
* Description: isulad-shim
ll
t
* Description: isulad-shim
unit tes
t
* Author: leizhongkai
* Create: 2020-02-25
*/
...
...
test/cutils/CMakeLists.txt
浏览文件 @
19141100
project
(
iSulad_
LL
T
)
project
(
iSulad_
U
T
)
add_subdirectory
(
utils_string
)
add_subdirectory
(
utils_convert
)
...
...
test/cutils/utils_array/CMakeLists.txt
浏览文件 @
19141100
project
(
iSulad_
LL
T
)
project
(
iSulad_
U
T
)
SET
(
EXE utils_array_
ll
t
)
SET
(
EXE utils_array_
u
t
)
add_executable
(
${
EXE
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../src/cutils/utils_string.c
...
...
@@ -14,7 +14,7 @@ add_executable(${EXE}
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../src/map/map.c
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../src/map/rb_tree.c
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../src/cutils/path.c
utils_array_
llt.cc
)
utils_array_
ut.cpp
)
target_include_directories
(
${
EXE
}
PUBLIC
${
GTEST_INCLUDE_DIR
}
...
...
test/cutils/utils_array/utils_array_
llt.cc
→
test/cutils/utils_array/utils_array_
ut.cpp
浏览文件 @
19141100
...
...
@@ -8,7 +8,7 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* See the Mulan PSL v2 for more details.
* Description: utils_array
ll
t
* Description: utils_array
unit tes
t
* Author: tanyifeng
* Create: 2019-09-24
*/
...
...
test/cutils/utils_convert/CMakeLists.txt
浏览文件 @
19141100
project
(
iSulad_
LL
T
)
project
(
iSulad_
U
T
)
SET
(
EXE utils_convert_
ll
t
)
SET
(
EXE utils_convert_
u
t
)
add_executable
(
${
EXE
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../src/cutils/utils_string.c
...
...
@@ -14,7 +14,7 @@ add_executable(${EXE}
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../src/cutils/path.c
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../src/map/map.c
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../src/map/rb_tree.c
utils_convert_
llt.cc
)
utils_convert_
ut.cpp
)
target_include_directories
(
${
EXE
}
PUBLIC
${
GTEST_INCLUDE_DIR
}
...
...
test/cutils/utils_convert/utils_convert_
llt.cc
→
test/cutils/utils_convert/utils_convert_
ut.cpp
浏览文件 @
19141100
...
...
@@ -8,7 +8,7 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* See the Mulan PSL v2 for more details.
* Description: utils_convert
ll
t
* Description: utils_convert
unit tes
t
* Author: tanyifeng
* Create: 2019-07-08
*/
...
...
test/cutils/utils_string/CMakeLists.txt
浏览文件 @
19141100
project
(
iSulad_
LL
T
)
project
(
iSulad_
U
T
)
SET
(
EXE utils_string_
ll
t
)
SET
(
EXE utils_string_
u
t
)
add_executable
(
${
EXE
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../src/cutils/utils_string.c
...
...
@@ -14,7 +14,7 @@ add_executable(${EXE}
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../src/map/map.c
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../src/map/rb_tree.c
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../src/cutils/path.c
utils_string_
llt.cc
)
utils_string_
ut.cpp
)
target_include_directories
(
${
EXE
}
PUBLIC
${
GTEST_INCLUDE_DIR
}
...
...
test/cutils/utils_string/utils_string_
llt.cc
→
test/cutils/utils_string/utils_string_
ut.cpp
浏览文件 @
19141100
...
...
@@ -8,7 +8,7 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* See the Mulan PSL v2 for more details.
* Description: utils_string
ll
t
* Description: utils_string
unit tes
t
* Author: tanyifeng
* Create: 2019-07-08
*/
...
...
@@ -27,7 +27,7 @@ extern "C" {
DEFINE_WRAPPER
(
calloc
,
void
*
,
(
size_t
nmemb
,
size_t
size
),
(
nmemb
,
size
));
}
TEST
(
utils_string_
ll
t
,
test_strings_count
)
TEST
(
utils_string_
u
t
,
test_strings_count
)
{
ASSERT_EQ
(
strings_count
(
"aaaaaaaaaaaaaaaaaaaa"
,
'a'
),
20
);
ASSERT_EQ
(
strings_count
(
"a"
,
'a'
),
1
);
...
...
@@ -35,7 +35,7 @@ TEST(utils_string_llt, test_strings_count)
ASSERT_EQ
(
strings_count
(
nullptr
,
'c'
),
0
);
}
TEST
(
utils_string_
ll
t
,
test_strings_contains_any
)
TEST
(
utils_string_
u
t
,
test_strings_contains_any
)
{
ASSERT_EQ
(
strings_contains_any
(
"1234567890abcdefgh!@"
,
"ijklmnopq#123456789"
),
true
);
ASSERT_EQ
(
strings_contains_any
(
"1234567890abcdefgh!@"
,
"ijklmnopqrstuvw)(*x&-"
),
false
);
...
...
@@ -47,7 +47,7 @@ TEST(utils_string_llt, test_strings_contains_any)
}
TEST
(
utils_string_
ll
t
,
test_strings_to_lower
)
TEST
(
utils_string_
u
t
,
test_strings_to_lower
)
{
char
*
result
=
nullptr
;
...
...
@@ -86,7 +86,7 @@ TEST(utils_string_llt, test_strings_to_lower)
MOCK_CLEAR
(
util_strdup_s
);
}
TEST
(
utils_string_
ll
t
,
test_strings_to_upper
)
TEST
(
utils_string_
u
t
,
test_strings_to_upper
)
{
char
*
result
=
nullptr
;
...
...
@@ -125,7 +125,7 @@ TEST(utils_string_llt, test_strings_to_upper)
}
TEST
(
utils_string_
ll
t
,
test_strings_in_slice
)
TEST
(
utils_string_
u
t
,
test_strings_in_slice
)
{
const
char
*
array_long
[]
=
{
"abcd"
,
"1234"
,
nullptr
,
""
,
"&^%abc"
};
size_t
array_long_len
=
sizeof
(
array_long
)
/
sizeof
(
array_long
[
0
]);
...
...
@@ -143,7 +143,7 @@ TEST(utils_string_llt, test_strings_in_slice)
ASSERT_FALSE
(
strings_in_slice
(
nullptr
,
0
,
nullptr
));
}
TEST
(
utils_string_
ll
t
,
test_util_parse_byte_size_string
)
TEST
(
utils_string_
u
t
,
test_util_parse_byte_size_string
)
{
int64_t
converted
=
0
;
int
ret
;
...
...
@@ -279,7 +279,7 @@ TEST(utils_string_llt, test_util_parse_byte_size_string)
MOCK_CLEAR
(
util_strdup_s
);
}
TEST
(
utils_string_
ll
t
,
test_util_string_split_multi
)
TEST
(
utils_string_
u
t
,
test_util_string_split_multi
)
{
char
**
result
=
nullptr
;
...
...
@@ -363,7 +363,7 @@ TEST(utils_string_llt, test_util_string_split_multi)
MOCK_CLEAR
(
calloc
);
}
TEST
(
utils_string_
ll
t
,
test_util_string_split
)
TEST
(
utils_string_
u
t
,
test_util_string_split
)
{
char
**
result
=
nullptr
;
...
...
@@ -437,7 +437,7 @@ TEST(utils_string_llt, test_util_string_split)
MOCK_CLEAR
(
calloc
);
}
TEST
(
utils_string_
ll
t
,
test_str_skip_str
)
TEST
(
utils_string_
u
t
,
test_str_skip_str
)
{
const
char
*
str
=
"abcdefghij1234567890"
;
const
char
*
substr
=
"abcdefgh"
;
...
...
@@ -465,7 +465,7 @@ TEST(utils_string_llt, test_str_skip_str)
ASSERT_STREQ
(
result
,
nullptr
);
}
TEST
(
utils_string_
ll
t
,
test_util_string_delchar
)
TEST
(
utils_string_
u
t
,
test_util_string_delchar
)
{
char
*
result
=
nullptr
;
...
...
@@ -490,7 +490,7 @@ TEST(utils_string_llt, test_util_string_delchar)
MOCK_CLEAR
(
util_strdup_s
);
}
TEST
(
utils_string_
ll
t
,
test_util_trim_newline
)
TEST
(
utils_string_
u
t
,
test_util_trim_newline
)
{
char
s_all
[
]
=
{
'\n'
,
'\n'
,
'\n'
,
'\n'
,
'\0'
};
char
s_tail
[
]
=
{
'\n'
,
'a'
,
'\n'
,
'b'
,
'\n'
,
'\0'
};
...
...
@@ -514,7 +514,7 @@ TEST(utils_string_llt, test_util_trim_newline)
ASSERT_STREQ
(
s_nullptr
,
nullptr
);
}
TEST
(
utils_string_
ll
t
,
test_util_trim_space
)
TEST
(
utils_string_
u
t
,
test_util_trim_space
)
{
char
s_all
[
]
=
{
'\f'
,
'\n'
,
'\r'
,
'\t'
,
'\v'
,
' '
,
'\0'
};
char
s_head
[
]
=
{
'\f'
,
'\n'
,
'\r'
,
'a'
,
'b'
,
'c'
,
'\0'
};
...
...
@@ -551,7 +551,7 @@ TEST(utils_string_llt, test_util_trim_space)
ASSERT_STREQ
(
result
,
nullptr
);
}
TEST
(
utils_string_
ll
t
,
test_util_trim_quotation
)
TEST
(
utils_string_
u
t
,
test_util_trim_quotation
)
{
char
s_all
[
]
=
{
'"'
,
'"'
,
'"'
,
'\n'
,
'"'
,
'\0'
};
char
s_head
[
]
=
{
'"'
,
'"'
,
'a'
,
'b'
,
'c'
,
'\0'
};
...
...
@@ -592,7 +592,7 @@ TEST(utils_string_llt, test_util_trim_quotation)
ASSERT_STREQ
(
result
,
nullptr
);
}
TEST
(
utils_string_
ll
t
,
test_str_array_dup
)
TEST
(
utils_string_
u
t
,
test_str_array_dup
)
{
const
char
*
array_long
[]
=
{
"abcd"
,
"1234"
,
nullptr
,
""
,
"&^%abc"
};
size_t
array_long_len
=
sizeof
(
array_long
)
/
sizeof
(
array_long
[
0
]);
...
...
@@ -627,7 +627,7 @@ TEST(utils_string_llt, test_str_array_dup)
ASSERT_EQ
(
result
,
nullptr
);
}
TEST
(
utils_string_
ll
t
,
test_util_string_join
)
TEST
(
utils_string_
u
t
,
test_util_string_join
)
{
const
char
*
array_long
[]
=
{
"abcd"
,
"1234"
,
"5678"
,
""
,
"&^%abc"
};
size_t
array_long_len
=
sizeof
(
array_long
)
/
sizeof
(
array_long
[
0
]);
...
...
@@ -662,7 +662,7 @@ TEST(utils_string_llt, test_util_string_join)
ASSERT_STREQ
(
result
,
nullptr
);
}
TEST
(
utils_string_
ll
t
,
test_util_string_append
)
TEST
(
utils_string_
u
t
,
test_util_string_append
)
{
char
*
result
=
nullptr
;
...
...
@@ -707,7 +707,7 @@ TEST(utils_string_llt, test_util_string_append)
MOCK_CLEAR
(
calloc
);
}
TEST
(
utils_string_
ll
t
,
test_dup_array_of_strings
)
TEST
(
utils_string_
u
t
,
test_dup_array_of_strings
)
{
const
char
*
array_long
[]
=
{
"abcd"
,
"1234"
,
nullptr
,
""
,
"&^%abc"
};
size_t
array_long_len
=
sizeof
(
array_long
)
/
sizeof
(
array_long
[
0
]);
...
...
@@ -757,7 +757,7 @@ TEST(utils_string_llt, test_dup_array_of_strings)
MOCK_CLEAR
(
calloc
);
}
TEST
(
utils_string_
ll
t
,
test_parse_percent_string
)
TEST
(
utils_string_
u
t
,
test_parse_percent_string
)
{
long
converted
=
0
;
int
ret
=
0
;
...
...
test/image/CMakeLists.txt
浏览文件 @
19141100
project
(
iSulad_
LL
T
)
project
(
iSulad_
U
T
)
add_subdirectory
(
oci
)
test/image/oci/CMakeLists.txt
浏览文件 @
19141100
project
(
iSulad_
LL
T
)
project
(
iSulad_
U
T
)
add_subdirectory
(
oci_config_merge
)
test/image/oci/oci_config_merge/CMakeLists.txt
浏览文件 @
19141100
project
(
iSulad_
LL
T
)
project
(
iSulad_
U
T
)
SET
(
EXE oci_config_merge_
ll
t
)
SET
(
EXE oci_config_merge_
u
t
)
add_executable
(
${
EXE
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../../src/image/oci/oci_config_merge.c
...
...
@@ -22,13 +22,13 @@ add_executable(${EXE}
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../../src/services/execution/spec/sysinfo.c
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../../src/cmd/commander.c
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../../src/cmd/isulad/arguments.c
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../../test/image/oci/oci_
llt_common.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../../test/image/oci/oci_
ut_common.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../../test/mocks/containers_store_mock.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../../test/mocks/namespace_mock.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../../test/mocks/container_unix_mock.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../../src/services/execution/spec/specs_mount.c
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../../test/mocks/selinux_label_mock.cc
oci_config_merge_
llt.cc
)
oci_config_merge_
ut.cpp
)
target_include_directories
(
${
EXE
}
PUBLIC
${
GTEST_INCLUDE_DIR
}
...
...
test/image/oci/oci_config_merge/oci_config_merge_
llt.cc
→
test/image/oci/oci_config_merge/oci_config_merge_
ut.cpp
浏览文件 @
19141100
...
...
@@ -8,7 +8,7 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* See the Mulan PSL v2 for more details.
* Description: oci_config_merge
ll
t
* Description: oci_config_merge
unit tes
t
* Author: wangfengtu
* Create: 2019-08-20
*/
...
...
@@ -21,7 +21,7 @@
#include "isula_libutils/imagetool_image.h"
#include "isula_libutils/container_config.h"
#include "oci_config_merge.h"
#include "oci_
ll
t_common.h"
#include "oci_
u
t_common.h"
#define IMAGETOOL_IMAGE_FILE "image/oci/oci_config_merge/imagetool_image.json"
#define OCI_RUNTIME_SPEC_FILE "image/oci/oci_config_merge/oci_runtime_spec.json"
...
...
@@ -68,7 +68,7 @@ void *util_smart_calloc_s_fail(size_t size, size_t len)
}
}
TEST
(
oci_config_merge_
ll
t
,
test_oci_image_merge_config
)
TEST
(
oci_config_merge_
u
t
,
test_oci_image_merge_config
)
{
char
*
imagetool_image_file
=
NULL
;
imagetool_image
*
tool_image
=
NULL
;
...
...
test/image/oci/oci_
llt_common.cc
→
test/image/oci/oci_
ut_common.cpp
浏览文件 @
19141100
...
...
@@ -8,7 +8,7 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* See the Mulan PSL v2 for more details.
* Description: oci_rootfs_remove
ll
t
* Description: oci_rootfs_remove
unit tes
t
* Author: wangfengtu
* Create: 2019-08-29
*/
...
...
@@ -18,7 +18,7 @@
#include <unistd.h>
#include <limits.h>
#include "utils.h"
#include "oci_
ll
t_common.h"
#include "oci_
u
t_common.h"
int
execvp_success
(
const
char
*
file
,
char
*
const
argv
[])
{
...
...
test/image/oci/oci_
ll
t_common.h
→
test/image/oci/oci_
u
t_common.h
浏览文件 @
19141100
...
...
@@ -8,24 +8,24 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* See the Mulan PSL v2 for more details.
* Description: oci_rootfs_remove
ll
t
* Description: oci_rootfs_remove
unit tes
t
* Author: wangfengtu
* Create: 2019-08-29
*/
#ifndef __OCI_
LL
T_COMMON_H
#define __OCI_
LL
T_COMMON_H
#ifndef __OCI_
U
T_COMMON_H
#define __OCI_
U
T_COMMON_H
#include <stdlib.h>
#include <stdio.h>
#include "utils.h"
#include "oci_
ll
t_common.h"
#include "oci_
u
t_common.h"
#ifdef __cplusplus
extern
"C"
{
#endif
#define DECLARE_OCI_
LL
T_COMMON_WRAPPER \
#define DECLARE_OCI_
U
T_COMMON_WRAPPER \
extern "C" {\
DECLARE_WRAPPER_V(conf_get_graph_rootpath, char *, ());\
DEFINE_WRAPPER_V(conf_get_graph_rootpath, char *, (), ());\
...
...
test/path/CMakeLists.txt
浏览文件 @
19141100
project
(
iSulad_
LL
T
)
project
(
iSulad_
U
T
)
SET
(
EXE path_
ll
t
)
SET
(
EXE path_
u
t
)
add_executable
(
${
EXE
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../src/cutils/utils.c
...
...
@@ -14,7 +14,7 @@ add_executable(${EXE}
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../src/cutils/utils_regex.c
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../src/cutils/utils_verify.c
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../src/sha256/sha256.c
path_
llt.cc
)
path_
ut.cpp
)
target_include_directories
(
${
EXE
}
PUBLIC
${
CMAKE_CURRENT_SOURCE_DIR
}
/../include
...
...
test/path/path_
llt.cc
→
test/path/path_
ut.cpp
浏览文件 @
19141100
...
...
@@ -8,7 +8,7 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* See the Mulan PSL v2 for more details.
* Description: path
ll
t
* Description: path
unit tes
t
* Author: jikui
* Create: 2019-08-22
*/
...
...
@@ -87,7 +87,7 @@ static ssize_t readlink_specify(const char *path, char *buf, size_t bufsize)
return
linkpath_length
;
}
TEST
(
path_
ll
t
,
test_cleanpath
)
TEST
(
path_
u
t
,
test_cleanpath
)
{
char
*
result
=
nullptr
;
std
::
string
str
;
...
...
@@ -123,7 +123,7 @@ TEST(path_llt, test_cleanpath)
ASSERT_STREQ
(
result
,
nullptr
);
}
TEST
(
path_
ll
t
,
test_specify_current_dir
)
TEST
(
path_
u
t
,
test_specify_current_dir
)
{
ASSERT_FALSE
(
specify_current_dir
(
nullptr
));
ASSERT_TRUE
(
specify_current_dir
(
""
));
...
...
@@ -135,7 +135,7 @@ TEST(path_llt, test_specify_current_dir)
ASSERT_FALSE
(
specify_current_dir
(
"home"
));
}
TEST
(
path_
ll
t
,
test_follow_symlink_in_scope
)
TEST
(
path_
u
t
,
test_follow_symlink_in_scope
)
{
std
::
string
fullpath
,
rootpath
;
char
*
res
=
nullptr
;
...
...
@@ -173,22 +173,22 @@ TEST(path_llt, test_follow_symlink_in_scope)
free
(
res
);
res
=
nullptr
;
fullpath
=
"/tmp/just_for_
ll
t/link"
;
fullpath
=
"/tmp/just_for_
u
t/link"
;
rootpath
=
"/tmp"
;
const
char
*
path
=
"/tmp/just_for_
ll
t"
;
const
char
*
path
=
"/tmp/just_for_
u
t"
;
const
char
*
path_file
=
"./testdir/test/../file"
;
const
char
*
path_link
=
"/tmp/just_for_
ll
t/link"
;
const
char
*
path_link
=
"/tmp/just_for_
u
t/link"
;
ASSERT_EQ
(
create_tmp_symbolic_link
(
path
,
path_file
,
path_link
),
0
);
MOCK_SET_V
(
readlink
,
readlink_specify
);
res
=
follow_symlink_in_scope
(
fullpath
.
c_str
(),
rootpath
.
c_str
());
ASSERT_STREQ
(
res
,
"/tmp/just_for_
ll
t/dir/file"
);
ASSERT_STREQ
(
res
,
"/tmp/just_for_
u
t/dir/file"
);
MOCK_CLEAR
(
readlink
);
ASSERT_EQ
(
util_recursive_rmdir
(
"/tmp/just_for_
ll
t"
,
0
),
0
);
ASSERT_EQ
(
util_recursive_rmdir
(
"/tmp/just_for_
u
t"
,
0
),
0
);
free
(
res
);
res
=
nullptr
;
}
TEST
(
path_
ll
t
,
test_split_dir_and_base_name
)
TEST
(
path_
u
t
,
test_split_dir_and_base_name
)
{
char
*
dir
=
nullptr
;
char
*
base
=
nullptr
;
...
...
@@ -226,7 +226,7 @@ TEST(path_llt, test_split_dir_and_base_name)
base
=
nullptr
;
}
TEST
(
path_
ll
t
,
test_filepath_split
)
TEST
(
path_
u
t
,
test_filepath_split
)
{
char
*
dir
=
nullptr
;
char
*
base
=
nullptr
;
...
...
@@ -272,7 +272,7 @@ TEST(path_llt, test_filepath_split)
base
=
nullptr
;
}
TEST
(
path_
ll
t
,
test_get_resource_path
)
TEST
(
path_
u
t
,
test_get_resource_path
)
{
char
*
res
=
nullptr
;
...
...
@@ -307,7 +307,7 @@ TEST(path_llt, test_get_resource_path)
res
=
nullptr
;
}
TEST
(
path_
ll
t
,
test_resolve_path
)
TEST
(
path_
u
t
,
test_resolve_path
)
{
std
::
string
rootpath
,
path
;
char
*
resolvedpath
=
nullptr
;
...
...
@@ -336,7 +336,7 @@ TEST(path_llt, test_resolve_path)
abspath
=
nullptr
;
}
TEST
(
path_
ll
t
,
test_has_trailing_path_separator
)
TEST
(
path_
u
t
,
test_has_trailing_path_separator
)
{
ASSERT_FALSE
(
has_trailing_path_separator
(
nullptr
));
ASSERT_FALSE
(
has_trailing_path_separator
(
""
));
...
...
@@ -344,7 +344,7 @@ TEST(path_llt, test_has_trailing_path_separator)
ASSERT_FALSE
(
has_trailing_path_separator
(
"/home"
));
}
TEST
(
path_
ll
t
,
test_preserve_trailing_dot_or_separator
)
TEST
(
path_
u
t
,
test_preserve_trailing_dot_or_separator
)
{
std
::
string
cleanedpath
,
originalpath
;
char
*
res
=
nullptr
;
...
...
test/runtime/CMakeLists.txt
浏览文件 @
19141100
project
(
iSulad_
LL
T
)
project
(
iSulad_
U
T
)
add_subdirectory
(
lcr
)
add_subdirectory
(
isula
)
test/runtime/isula/CMakeLists.txt
浏览文件 @
19141100
project
(
iSulad_
LL
T
)
project
(
iSulad_
U
T
)
SET
(
EXE isula_rt_ops_
ll
t
)
SET
(
EXE isula_rt_ops_
u
t
)
add_executable
(
${
EXE
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../src/cutils/utils.c
...
...
@@ -17,14 +17,14 @@ add_executable(${EXE}
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../src/services/execution/spec/sysinfo.c
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../src/cmd/commander.c
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../src/cmd/isulad/arguments.c
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../test/image/oci/oci_
llt_common.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../test/image/oci/oci_
ut_common.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../test/mocks/containers_store_mock.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../test/mocks/namespace_mock.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../test/mocks/container_unix_mock.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../test/mocks/engine_mock.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../test/mocks/isulad_config_mock.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../src/runtime/isula/isula_rt_ops.c
isula_rt_ops_
llt.cc
)
isula_rt_ops_
ut.cpp
)
target_include_directories
(
${
EXE
}
PUBLIC
${
GTEST_INCLUDE_DIR
}
...
...
test/runtime/isula/isula_rt_ops_
llt.cc
→
test/runtime/isula/isula_rt_ops_
ut.cpp
浏览文件 @
19141100
...
...
@@ -8,7 +8,7 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* See the Mulan PSL v2 for more details.
* Description: isula runtime ops
ll
t
* Description: isula runtime ops
unit tes
t
* Author: jingrui
* Create: 2020-02-15
*/
...
...
@@ -57,7 +57,7 @@ public:
NiceMock
<
MockIsuladConf
>
m_isulad_conf
;
};
TEST
(
isula_rt_ops_
ll
t
,
test_rt_isula_detect
)
TEST
(
isula_rt_ops_
u
t
,
test_rt_isula_detect
)
{
// All parameter NULL
ASSERT_FALSE
(
rt_isula_detect
(
NULL
));
...
...
test/runtime/lcr/CMakeLists.txt
浏览文件 @
19141100
project
(
iSulad_
LL
T
)
project
(
iSulad_
U
T
)
SET
(
EXE lcr_rt_ops_
ll
t
)
SET
(
EXE lcr_rt_ops_
u
t
)
add_executable
(
${
EXE
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../src/cutils/utils.c
...
...
@@ -19,14 +19,14 @@ add_executable(${EXE}
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../src/services/execution/spec/sysinfo.c
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../src/cmd/commander.c
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../src/cmd/isulad/arguments.c
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../test/image/oci/oci_
llt_common.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../test/image/oci/oci_
ut_common.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../test/mocks/containers_store_mock.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../test/mocks/namespace_mock.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../test/mocks/container_unix_mock.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../test/mocks/engine_mock.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../test/mocks/isulad_config_mock.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../src/runtime/lcr/lcr_rt_ops.c
lcr_rt_ops_
llt.cc
)
lcr_rt_ops_
ut.cpp
)
target_include_directories
(
${
EXE
}
PUBLIC
${
GTEST_INCLUDE_DIR
}
...
...
test/runtime/lcr/lcr_rt_ops_
llt.cc
→
test/runtime/lcr/lcr_rt_ops_
ut.cpp
浏览文件 @
19141100
...
...
@@ -8,7 +8,7 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* See the Mulan PSL v2 for more details.
* Description: lcr runtime ops
ll
t
* Description: lcr runtime ops
unit tes
t
* Author: lifeng
* Create: 2020-02-15
*/
...
...
@@ -57,7 +57,7 @@ public:
NiceMock
<
MockIsuladConf
>
m_isulad_conf
;
};
TEST
(
lcr_rt_ops_
ll
t
,
test_rt_lcr_detect
)
TEST
(
lcr_rt_ops_
u
t
,
test_rt_lcr_detect
)
{
// All parameter NULL
ASSERT_FALSE
(
rt_lcr_detect
(
NULL
));
...
...
test/services/CMakeLists.txt
浏览文件 @
19141100
project
(
iSulad_
LL
T
)
project
(
iSulad_
U
T
)
add_subdirectory
(
graphdriver
)
add_subdirectory
(
execution
)
test/services/execution/CMakeLists.txt
浏览文件 @
19141100
project
(
iSulad_
LL
T
)
project
(
iSulad_
U
T
)
add_subdirectory
(
spec
)
add_subdirectory
(
execute
)
test/services/execution/execute/CMakeLists.txt
浏览文件 @
19141100
project
(
iSulad_
LL
T
)
project
(
iSulad_
U
T
)
add_subdirectory
(
execution_extend
)
test/services/execution/execute/execution_extend/CMakeLists.txt
浏览文件 @
19141100
project
(
iSulad_
LL
T
)
project
(
iSulad_
U
T
)
SET
(
EXE execution_extend_
ll
t
)
SET
(
EXE execution_extend_
u
t
)
add_executable
(
${
EXE
}
...
...
@@ -41,7 +41,7 @@ add_executable(${EXE}
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../../mocks/driver_mock.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../../mocks/restartmanager_mock.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../../mocks/specs_mock.cc
execution_extend_
llt.cc
)
execution_extend_
ut.cpp
)
target_include_directories
(
${
EXE
}
PUBLIC
${
GTEST_INCLUDE_DIR
}
...
...
test/services/execution/execute/execution_extend/execution_extend_
llt.cc
→
test/services/execution/execute/execution_extend/execution_extend_
ut.cpp
浏览文件 @
19141100
...
...
@@ -10,7 +10,7 @@
* See the Mulan PSL v2 for more details.
* Author: jikui
* Create: 2020-02-25
* Description: provide execution_extend
ll
t test
* Description: provide execution_extend
uni
t test
******************************************************************************/
#include "execution_extend.h"
...
...
test/services/execution/spec/CMakeLists.txt
浏览文件 @
19141100
project
(
iSulad_
LL
T
)
project
(
iSulad_
U
T
)
SET
(
EXE selinux_label_
ll
t
)
SET
(
MOCK_EXE selinux_label_mock_
ll
t
)
SET
(
EXE selinux_label_
u
t
)
SET
(
MOCK_EXE selinux_label_mock_
u
t
)
add_executable
(
${
EXE
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../../src/cutils/utils.c
...
...
@@ -18,7 +18,7 @@ add_executable(${EXE}
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../../src/libisulad.c
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../mocks/namespace_mock.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../../src/services/execution/spec/selinux_label.c
selinux_label_
llt.cc
)
selinux_label_
ut.cpp
)
add_executable
(
${
MOCK_EXE
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../../src/cutils/utils.c
...
...
@@ -37,7 +37,7 @@ add_executable(${MOCK_EXE}
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../mocks/syscall_mock.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../mocks/selinux_mock.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../../src/services/execution/spec/selinux_label.c
selinux_label_mock_
llt.cc
)
selinux_label_mock_
ut.cpp
)
target_include_directories
(
${
EXE
}
PUBLIC
${
GTEST_INCLUDE_DIR
}
...
...
test/services/execution/spec/selinux_label_mock_
llt.cc
→
test/services/execution/spec/selinux_label_mock_
ut.cpp
浏览文件 @
19141100
文件已移动
test/services/execution/spec/selinux_label_
llt.cc
→
test/services/execution/spec/selinux_label_
ut.cpp
浏览文件 @
19141100
文件已移动
test/services/graphdriver/CMakeLists.txt
浏览文件 @
19141100
project
(
iSulad_
LL
T
)
project
(
iSulad_
U
T
)
add_subdirectory
(
driver
)
test/services/graphdriver/driver/CMakeLists.txt
浏览文件 @
19141100
project
(
iSulad_
LL
T
)
project
(
iSulad_
U
T
)
SET
(
EXE driver_
ll
t
)
SET
(
EXE driver_
u
t
)
add_executable
(
${
EXE
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../../src/cutils/utils.c
...
...
@@ -20,7 +20,7 @@ add_executable(${EXE}
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../../src/services/graphdriver/driver.c
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../../src/services/graphdriver/devmapper/driver_devmapper.c
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../../src/libisulad.c
driver_
llt.cc
)
driver_
ut.cpp
)
target_include_directories
(
${
EXE
}
PUBLIC
${
GTEST_INCLUDE_DIR
}
...
...
test/services/graphdriver/driver/driver_
llt.cc
→
test/services/graphdriver/driver/driver_
ut.cpp
浏览文件 @
19141100
...
...
@@ -8,7 +8,7 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* See the Mulan PSL v2 for more details.
* Description: driver
ll
t
* Description: driver
unit tes
t
* Author: wangfengtu
* Create: 2020-02-19
*/
...
...
@@ -63,13 +63,13 @@ public:
};
// All parameter NULL
TEST
(
graphdriver_init_
ll
t
,
test_graphdriver_init_1
)
TEST
(
graphdriver_init_
u
t
,
test_graphdriver_init_1
)
{
ASSERT_TRUE
(
graphdriver_init
(
NULL
,
NULL
,
0
)
==
NULL
);
}
// All parameter correct
TEST
(
graphdriver_init_
ll
t
,
test_graphdriver_init_2
)
TEST
(
graphdriver_init_
u
t
,
test_graphdriver_init_2
)
{
struct
graphdriver
*
driver
=
NULL
;
char
**
options
=
NULL
;
...
...
@@ -86,7 +86,7 @@ TEST(graphdriver_init_llt, test_graphdriver_init_2)
}
// Parameter dm.fs invalid
TEST
(
graphdriver_init_
ll
t
,
test_graphdriver_init_3
)
TEST
(
graphdriver_init_
u
t
,
test_graphdriver_init_3
)
{
struct
graphdriver
*
driver
=
NULL
;
char
**
options
=
NULL
;
...
...
@@ -100,7 +100,7 @@ TEST(graphdriver_init_llt, test_graphdriver_init_3)
}
// Parameter dm.thinpooldev invalid
TEST
(
graphdriver_init_
ll
t
,
test_graphdriver_init_4
)
TEST
(
graphdriver_init_
u
t
,
test_graphdriver_init_4
)
{
struct
graphdriver
*
driver
=
NULL
;
char
**
options
=
NULL
;
...
...
@@ -114,7 +114,7 @@ TEST(graphdriver_init_llt, test_graphdriver_init_4)
}
// Parameter dm.min_free_space invalid
TEST
(
graphdriver_init_
ll
t
,
test_graphdriver_init_5
)
TEST
(
graphdriver_init_
u
t
,
test_graphdriver_init_5
)
{
struct
graphdriver
*
driver
=
NULL
;
char
**
options
=
NULL
;
...
...
@@ -134,7 +134,7 @@ TEST(graphdriver_init_llt, test_graphdriver_init_5)
}
// Parameter dm.basesize invalid
TEST
(
graphdriver_init_
ll
t
,
test_graphdriver_init_6
)
TEST
(
graphdriver_init_
u
t
,
test_graphdriver_init_6
)
{
struct
graphdriver
*
driver
=
NULL
;
char
**
options
=
NULL
;
...
...
@@ -148,7 +148,7 @@ TEST(graphdriver_init_llt, test_graphdriver_init_6)
}
// None exist parameter
TEST
(
graphdriver_init_
ll
t
,
test_graphdriver_init_7
)
TEST
(
graphdriver_init_
u
t
,
test_graphdriver_init_7
)
{
struct
graphdriver
*
driver
=
NULL
;
char
**
options
=
NULL
;
...
...
test/specs/CMakeLists.txt
浏览文件 @
19141100
project
(
iSulad_
LL
T
)
project
(
iSulad_
U
T
)
add_subdirectory
(
specs
)
add_subdirectory
(
specs_extend
)
test/specs/specs/CMakeLists.txt
浏览文件 @
19141100
project
(
iSulad_
LL
T
)
project
(
iSulad_
U
T
)
SET
(
EXE specs_
ll
t
)
SET
(
EXE specs_
u
t
)
add_executable
(
${
EXE
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../src/cutils/utils.c
...
...
@@ -23,14 +23,14 @@ add_executable(${EXE}
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../src/services/execution/spec/sysinfo.c
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../src/cmd/commander.c
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../src/cmd/isulad/arguments.c
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../test/image/oci/oci_
llt_common.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../test/image/oci/oci_
ut_common.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../test/mocks/containers_store_mock.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../test/mocks/namespace_mock.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../test/mocks/container_unix_mock.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../test/mocks/engine_mock.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../test/mocks/selinux_label_mock.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../test/mocks/isulad_config_mock.cc
specs_
llt.cc
)
specs_
ut.cpp
)
target_include_directories
(
${
EXE
}
PUBLIC
${
GTEST_INCLUDE_DIR
}
...
...
test/specs/specs/specs_
llt.cc
→
test/specs/specs/specs_
ut.cpp
浏览文件 @
19141100
...
...
@@ -8,7 +8,7 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* See the Mulan PSL v2 for more details.
* Description: specs
ll
t
* Description: specs
unit tes
t
* Author: lifeng
* Create: 2020-02-18
*/
...
...
@@ -21,7 +21,7 @@
#include "specs.h"
#include "isula_libutils/host_config.h"
#include "isula_libutils/container_config.h"
#include "oci_
ll
t_common.h"
#include "oci_
u
t_common.h"
#include <gtest/gtest.h>
#include <gmock/gmock.h>
#include "isulad_config_mock.h"
...
...
@@ -58,13 +58,13 @@ public:
#define HOST_CONFIG_FILE "specs/specs/hostconfig.json"
#define OCI_RUNTIME_SPEC_FILE "specs/specs/oci_runtime_spec.json"
TEST
(
merge_conf_cgroup_
ll
t
,
test_merge_conf_cgroup_1
)
TEST
(
merge_conf_cgroup_
u
t
,
test_merge_conf_cgroup_1
)
{
// All parameter NULL
ASSERT_NE
(
merge_conf_cgroup
(
NULL
,
NULL
),
0
);
}
TEST
(
merge_conf_cgroup_
ll
t
,
test_merge_conf_cgroup_2
)
TEST
(
merge_conf_cgroup_
u
t
,
test_merge_conf_cgroup_2
)
{
oci_runtime_spec
*
oci_spec
=
NULL
;
...
...
@@ -76,7 +76,7 @@ TEST(merge_conf_cgroup_llt, test_merge_conf_cgroup_2)
oci_spec
=
NULL
;
}
TEST
(
merge_conf_cgroup_
ll
t
,
test_merge_conf_cgroup_3
)
TEST
(
merge_conf_cgroup_
u
t
,
test_merge_conf_cgroup_3
)
{
char
*
host_config_file
=
NULL
;
host_config
*
host_spec
=
NULL
;
...
...
@@ -96,7 +96,7 @@ TEST(merge_conf_cgroup_llt, test_merge_conf_cgroup_3)
host_spec
=
NULL
;
}
TEST
(
merge_conf_cgroup_
ll
t
,
test_merge_conf_cgroup
)
TEST
(
merge_conf_cgroup_
u
t
,
test_merge_conf_cgroup
)
{
char
*
host_config_file
=
NULL
;
host_config
*
host_spec
=
NULL
;
...
...
@@ -124,7 +124,7 @@ TEST(merge_conf_cgroup_llt, test_merge_conf_cgroup)
oci_spec
=
NULL
;
}
TEST
(
merge_conf_cgroup_
ll
t
,
test_merge_conf_cgroup_cpu
)
TEST
(
merge_conf_cgroup_
u
t
,
test_merge_conf_cgroup_cpu
)
{
char
*
host_config_file
=
NULL
;
host_config
*
host_spec
=
NULL
;
...
...
@@ -177,7 +177,7 @@ TEST(merge_conf_cgroup_llt, test_merge_conf_cgroup_cpu)
oci_spec
=
NULL
;
}
TEST
(
merge_conf_cgroup_
ll
t
,
test_merge_conf_cgroup_mem
)
TEST
(
merge_conf_cgroup_
u
t
,
test_merge_conf_cgroup_mem
)
{
char
*
host_config_file
=
NULL
;
host_config
*
host_spec
=
NULL
;
...
...
test/specs/specs_extend/CMakeLists.txt
浏览文件 @
19141100
project
(
iSulad_
LL
T
)
project
(
iSulad_
U
T
)
SET
(
EXE specs_extend_
ll
t
)
SET
(
EXE specs_extend_
u
t
)
add_executable
(
${
EXE
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../src/cutils/utils.c
...
...
@@ -23,14 +23,14 @@ add_executable(${EXE}
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../src/services/execution/spec/sysinfo.c
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../src/cmd/commander.c
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../src/cmd/isulad/arguments.c
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../test/image/oci/oci_
llt_common.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../test/image/oci/oci_
ut_common.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../test/mocks/containers_store_mock.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../test/mocks/namespace_mock.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../test/mocks/container_unix_mock.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../test/mocks/engine_mock.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../test/mocks/selinux_label_mock.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../../test/mocks/isulad_config_mock.cc
specs_extend_
llt.cc
)
specs_extend_
ut.cpp
)
target_include_directories
(
${
EXE
}
PUBLIC
${
GTEST_INCLUDE_DIR
}
...
...
test/specs/specs_extend/specs_extend_
llt.cc
→
test/specs/specs_extend/specs_extend_
ut.cpp
浏览文件 @
19141100
...
...
@@ -8,7 +8,7 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* See the Mulan PSL v2 for more details.
* Description: specs extend
ll
t
* Description: specs extend
unit tes
t
* Author: lifeng
* Create: 2020-02-18
*/
...
...
@@ -21,7 +21,7 @@
#include "specs.h"
#include "isula_libutils/host_config.h"
#include "isula_libutils/container_config.h"
#include "oci_
ll
t_common.h"
#include "oci_
u
t_common.h"
#include <gtest/gtest.h>
#include <gmock/gmock.h>
#include "isulad_config_mock.h"
...
...
@@ -44,7 +44,7 @@ using namespace std;
#define HOOKS_CONFIG_FILE "specs/specs_extend/hooks.json"
TEST
(
make_sure_oci_spec_linux_
ll
t
,
test_make_sure_oci_spec_linux
)
TEST
(
make_sure_oci_spec_linux_
u
t
,
test_make_sure_oci_spec_linux
)
{
oci_runtime_spec
*
oci_spec
=
NULL
;
oci_spec
=
(
oci_runtime_spec
*
)
util_common_calloc_s
(
sizeof
(
oci_runtime_spec
));
...
...
@@ -55,7 +55,7 @@ TEST(make_sure_oci_spec_linux_llt, test_make_sure_oci_spec_linux)
oci_spec
=
NULL
;
}
TEST
(
make_sure_oci_spec_process_
ll
t
,
test_make_sure_oci_spec_process
)
TEST
(
make_sure_oci_spec_process_
u
t
,
test_make_sure_oci_spec_process
)
{
oci_runtime_spec
*
oci_spec
=
NULL
;
oci_spec
=
(
oci_runtime_spec
*
)
util_common_calloc_s
(
sizeof
(
oci_runtime_spec
));
...
...
@@ -66,7 +66,7 @@ TEST(make_sure_oci_spec_process_llt, test_make_sure_oci_spec_process)
oci_spec
=
NULL
;
}
TEST
(
make_sure_oci_spec_linux_resources_
ll
t
,
test_make_sure_oci_spec_linux_resources
)
TEST
(
make_sure_oci_spec_linux_resources_
u
t
,
test_make_sure_oci_spec_linux_resources
)
{
oci_runtime_spec
*
oci_spec
=
NULL
;
oci_spec
=
(
oci_runtime_spec
*
)
util_common_calloc_s
(
sizeof
(
oci_runtime_spec
));
...
...
@@ -78,7 +78,7 @@ TEST(make_sure_oci_spec_linux_resources_llt, test_make_sure_oci_spec_linux_resou
oci_spec
=
NULL
;
}
TEST
(
make_sure_oci_spec_linux_resources_blkio_
ll
t
,
test_make_sure_oci_spec_linux_resources_blkio
)
TEST
(
make_sure_oci_spec_linux_resources_blkio_
u
t
,
test_make_sure_oci_spec_linux_resources_blkio
)
{
oci_runtime_spec
*
oci_spec
=
NULL
;
oci_spec
=
(
oci_runtime_spec
*
)
util_common_calloc_s
(
sizeof
(
oci_runtime_spec
));
...
...
@@ -91,12 +91,12 @@ TEST(make_sure_oci_spec_linux_resources_blkio_llt, test_make_sure_oci_spec_linux
oci_spec
=
NULL
;
}
TEST
(
merge_hooks_
ll
t
,
test_merge_hooks_invalid
)
TEST
(
merge_hooks_
u
t
,
test_merge_hooks_invalid
)
{
ASSERT_NE
(
merge_hooks
(
nullptr
,
nullptr
),
0
);
}
TEST
(
merge_hooks_
llt
,
test_merge_hooks_ll
t_2
)
TEST
(
merge_hooks_
ut
,
test_merge_hooks_u
t_2
)
{
oci_runtime_spec
*
oci_spec
=
NULL
;
...
...
@@ -108,7 +108,7 @@ TEST(merge_hooks_llt, test_merge_hooks_llt_2)
oci_spec
=
NULL
;
}
TEST
(
merge_hooks_
llt
,
test_merge_hooks_ll
t_3
)
TEST
(
merge_hooks_
ut
,
test_merge_hooks_u
t_3
)
{
char
*
hooks_config_file
=
NULL
;
oci_runtime_spec_hooks
*
hooks_spec
=
NULL
;
...
...
@@ -127,7 +127,7 @@ TEST(merge_hooks_llt, test_merge_hooks_llt_3)
hooks_spec
=
NULL
;
}
TEST
(
merge_hooks_
llt
,
test_merge_hooks_ll
t_4
)
TEST
(
merge_hooks_
ut
,
test_merge_hooks_u
t_4
)
{
char
*
hooks_config_file
=
NULL
;
oci_runtime_spec_hooks
*
hooks_spec
=
NULL
;
...
...
@@ -155,7 +155,7 @@ TEST(merge_hooks_llt, test_merge_hooks_llt_4)
free_oci_runtime_spec
(
oci_spec
);
oci_spec
=
NULL
;
}
TEST
(
merge_hooks_
llt
,
test_merge_hooks_ll
t_prestart
)
TEST
(
merge_hooks_
ut
,
test_merge_hooks_u
t_prestart
)
{
char
*
hooks_config_file
=
NULL
;
oci_runtime_spec_hooks
*
hooks_spec
=
NULL
;
...
...
@@ -193,7 +193,7 @@ TEST(merge_hooks_llt, test_merge_hooks_llt_prestart)
oci_spec
=
NULL
;
}
TEST
(
merge_hooks_
llt
,
test_merge_hooks_ll
t_poststart
)
TEST
(
merge_hooks_
ut
,
test_merge_hooks_u
t_poststart
)
{
char
*
hooks_config_file
=
NULL
;
oci_runtime_spec_hooks
*
hooks_spec
=
NULL
;
...
...
@@ -240,7 +240,7 @@ TEST(merge_hooks_llt, test_merge_hooks_llt_poststart)
oci_spec
=
NULL
;
}
TEST
(
merge_hooks_
llt
,
test_merge_hooks_ll
t_poststop
)
TEST
(
merge_hooks_
ut
,
test_merge_hooks_u
t_poststop
)
{
char
*
hooks_config_file
=
NULL
;
oci_runtime_spec_hooks
*
hooks_spec
=
NULL
;
...
...
test/test.sh
浏览文件 @
19141100
...
...
@@ -19,8 +19,8 @@
function
usage
()
{
echo
"Usage: sh
ll
t.sh [OPTIONS]"
echo
"Use
llt.sh to control ll
t operation"
echo
"Usage: sh
tes
t.sh [OPTIONS]"
echo
"Use
test.sh to control unit tes
t operation"
echo
""
echo
"Misc:"
echo
" -h, --help Print this help, then exit"
...
...
@@ -31,8 +31,8 @@ function usage()
echo
" -e, --empty Enable compile empty(make clean)"
echo
echo
"TestRun Options"
echo
" -r, --run-
llt <option> Run all llt, eg: -r, -rscreen(default), -rxml, --run-llt, --run-llt=screen, --run-ll
t=xml"
echo
" -s, --specify-
llt FILE Only Run specify llt executable FILE, eg: -smain_llt, --specify-llt=main_ll
t"
echo
" -r, --run-
ut <option> Run all unit test, eg: -r, -rscreen(default), -rxml, --run-ut, --run-ut=screen, --run-u
t=xml"
echo
" -s, --specify-
ut FILE Only Run specify unit test executable FILE, eg: -smain_ut, --specify-ut=main_u
t"
echo
echo
"Coverage Options"
echo
" -t, --cover-report <option> Enable coverage report. eg: -t, -thtml(default), -ttxt, --cover-report, --cover-report=html, --cover-report=txt"
...
...
@@ -40,7 +40,7 @@ function usage()
echo
}
ARGS
=
`
getopt
-o
"hcer::m::t::s:f:"
-l
"help,cmake::,empty,cover-report::,run-
llt::,specify-llt:,cover-file:"
-n
"run_ll
t.sh"
--
"
$@
"
`
ARGS
=
`
getopt
-o
"hcer::m::t::s:f:"
-l
"help,cmake::,empty,cover-report::,run-
ut::,specify-ut:,cover-file:"
-n
"run_tes
t.sh"
--
"
$@
"
`
if
[
$?
!=
0
]
;
then
usage
exit
...
...
@@ -53,7 +53,7 @@ if [ x"$ARGS" = x" --" ]; then
COMPILE_ENABLE
=
no
COVERAGE_ENABLE
=
no
EMPTY_ENABLE
=
no
RUN_
LL
T
=
yes
RUN_
U
T
=
yes
RUN_MODE
=
screen
#value: screen or xml
COVER_REPORT_ENABLE
=
no
fi
...
...
@@ -76,8 +76,8 @@ while true; do
-e
|
--empty
)
EMPTY_ENABLE
=
yes
shift
;;
-r
|
--run-
ll
t
)
RUN_
LL
T
=
yes
-r
|
--run-
u
t
)
RUN_
U
T
=
yes
case
"
$2
"
in
""
)
RUN_MODE
=
screen
;
shift
2
;;
screen
)
RUN_MODE
=
screen
;
shift
2
;;
...
...
@@ -92,8 +92,8 @@ while true; do
txt
)
COVER_STYLE
=
txt
;
shift
2
;;
*
)
echo
"Error param:
$2
"
;
exit
1
;;
esac
;;
-s
|
--specify-
ll
t
)
SPECIFY_
LL
T
=
$2
-s
|
--specify-
u
t
)
SPECIFY_
U
T
=
$2
shift
2
;;
-f
|
--cover-file
)
COVER_FILE
=
$2
...
...
@@ -103,9 +103,9 @@ while true; do
esac
done
function
ll
t_empty
()
function
u
t_empty
()
{
echo
----------------------
ll
t empty begin
----------------------
echo
----------------------
unit
tes
t
empty begin
----------------------
set
-x
make clean
find
-name
"*.gcda"
|xargs
rm
-f
...
...
@@ -121,13 +121,13 @@ function llt_empty()
rm
coverage
-rf
rm
test_result.log
-f
set
+x
echo
----------------------
ll
t empty end
------------------------
echo
----------------------
unit
tes
t
empty end
------------------------
}
function
ll
t_cmake
()
function
u
t_cmake
()
{
ret
=
0
local
CMAKE_OPTION
=
"-DCMAKE_BUILD_TYPE=Debug -DENABLE_
LL
T=ON"
echo
----------------------
ll
t cmake begin
----------------------
local
CMAKE_OPTION
=
"-DCMAKE_BUILD_TYPE=Debug -DENABLE_
U
T=ON"
echo
----------------------
unit
tes
t
cmake begin
----------------------
cd
..
if
[
x
"
${
COVERAGE_ENABLE
}
"
=
x
"yes"
]
;
then
CMAKE_OPTION
=
"
${
CMAKE_OPTION
}
-DENABLE_COVERAGE=1"
...
...
@@ -138,18 +138,18 @@ function llt_cmake()
cmake
.
${
CMAKE_OPTION
}
ret
=
$?
cd
-
echo
----------------------
ll
t cmake end
------------------------
echo
----------------------
unit
tes
t
cmake end
------------------------
echo
return
$ret
}
function
ll
t_compile
()
function
u
t_compile
()
{
ret
=
0
echo
----------------------
ll
t compile begin
----------------------
make
-j
echo
----------------------
unit
tes
t
compile begin
----------------------
make
-j
$(
nproc
)
ret
=
$?
echo
----------------------
ll
t compile end
------------------------
echo
----------------------
unit
tes
t
compile end
------------------------
echo
return
$ret
}
...
...
@@ -180,9 +180,9 @@ function xml_add_succeed()
done <
${
xmlfile
}
}
function
ll
t_run_all_test()
function
u
t_run_all_test()
{
echo ----------------------
ll
t run begin --------------------------
echo ----------------------
unit tes
t run begin --------------------------
if [ x"
${
RUN_MODE
}
" = x"
screen
" ]; then
RUN_MODE=0
elif [ x"
${
RUN_MODE
}
" = x"
xml
" ]; then
...
...
@@ -195,23 +195,23 @@ function llt_run_all_test()
exit 1
fi
if [ x"
${
SPECIFY_
LL
T
}
" = x"" ]; then
SPECIFY_
LLT=
`
find
-name
"*_ll
t"
`
# run all test
if [ x"
${
SPECIFY_
U
T
}
" = x"" ]; then
SPECIFY_
UT=
`
find
-name
"*_u
t"
`
# run all test
else
SPECIFY_
LLT=
`
find
-name
"
${
SPECIFY_LL
T
}
"
`
SPECIFY_
UT=
`
find
-name
"
${
SPECIFY_U
T
}
"
`
fi
TEST_LOG=test_result.log
>
$TEST_LOG
ret=0
for TEST in
$SPECIFY_
LL
T
for TEST in
$SPECIFY_
U
T
do
echo
$TEST
tret=0
if [
$RUN_MODE
-eq 1 ];then
xmlfile=
${
TEST
##*/
}
xmlfile=
${
xmlfile
%_
ll
t
}
-Results.xml
xmlfile=
${
xmlfile
%_
u
t
}
-Results.xml
$TEST
--gtest_output=xml:
${
xmlfile
}
tret=
$?
xml_add_succeed
${
xmlfile
}
...
...
@@ -227,18 +227,18 @@ function llt_run_all_test()
fi
done
echo ""
echo '######################test result begin######################'
echo '######################
unit
test result begin######################'
cat
$TEST_LOG
echo '#######################test result end#######################'
echo '#######################
unit
test result end#######################'
echo ""
echo ----------------------
ll
t run end --------------------------
echo ----------------------
unit tes
t run end --------------------------
echo
return
$ret
}
function
ll
t_coverage()
function
u
t_coverage()
{
echo ------------------
ll
t generate coverage begin --------------
echo ------------------
unit tes
t generate coverage begin --------------
if [ x"
${
COVER_STYLE
}
" = x"
txt
" ]; then
GCDAS=
`
find
-name
"
${
COVER_FILE
}
.gcda"
`
if [ x"
$GCDAS
" = x"" ]; then
...
...
@@ -279,10 +279,10 @@ function llt_coverage()
done
fi
#lcov -c
${
LCOV_CMD
}
-o coverage/coverage.info --exclude '*_
llt.c
' --include '*.c' --include '*.cpp' --include '*.cc' --rc lcov_branch_coverage=1 --ignore-errors gcov --ignore-errors source --ignore-errors graph
#lcov -c
${
LCOV_CMD
}
-o coverage/coverage.info --exclude '*_
ut.cpp
' --include '*.c' --include '*.cpp' --include '*.cc' --rc lcov_branch_coverage=1 --ignore-errors gcov --ignore-errors source --ignore-errors graph
lcov --help | grep "
\-\-exclude
"
if [[
$?
-eq 0 ]]; then
lcov -c
${
LCOV_CMD
}
-b
$(
dirname
$(
pwd
))
--no-external --exclude '*_
llt*.cc
' -o coverage/coverage.info --rc lcov_branch_coverage=1 --ignore-errors gcov --ignore-errors source --ignore-errors graph
lcov -c
${
LCOV_CMD
}
-b
$(
dirname
$(
pwd
))
--no-external --exclude '*_
ut.cpp
' -o coverage/coverage.info --rc lcov_branch_coverage=1 --ignore-errors gcov --ignore-errors source --ignore-errors graph
else
lcov -c
${
LCOV_CMD
}
-b
$(
dirname
$(
pwd
))
--no-external -o coverage/coverage.info --rc lcov_branch_coverage=1 --ignore-errors gcov --ignore-errors source --ignore-errors graph
fi
...
...
@@ -299,36 +299,36 @@ function llt_coverage()
fi
chmod 755 -R coverage
fi
echo ------------------
ll
t generate coverage end ----------------
echo ------------------
unit tes
t generate coverage end ----------------
}
if [ x"
${
CMAKE_ENABLE
}
" = x"
yes
" ]; then
ll
t_cmake
u
t_cmake
if [[
$?
-ne 0 ]];then
exit 1
fi
fi
if [ x"
${
EMPTY_ENABLE
}
" = x"
yes
" ]; then
ll
t_empty
u
t_empty
fi
if [ x"
${
COMPILE_ENABLE
}
" = x"
yes
" ]; then
ll
t_compile
u
t_compile
if [[
$?
-ne 0 ]];then
exit 1
fi
fi
if [ x"
${
RUN_
LL
T
}
" = x"
yes
" ]; then
ll
t_run_all_test
if [ x"
${
RUN_
U
T
}
" = x"
yes
" ]; then
u
t_run_all_test
if [[
$?
-ne 0 ]];then
exit 1
fi
fi
if [ x"
${
COVER_REPORT_ENABLE
}
" = x"
yes
" ]; then
ll
t_coverage
u
t_coverage
if [[
$?
-ne 0 ]];then
exit 1
fi
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录