Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
932b2dfe
Y
YTBP
项目概览
YottaChain
/
YTBP
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Y
YTBP
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
932b2dfe
编写于
4月 14, 2018
作者:
C
Ciju John
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add unit tests to code coverage build.
上级
841fc24c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
17 addition
and
15 deletion
+17
-15
tests/CMakeLists.txt
tests/CMakeLists.txt
+15
-15
tests/llvm-gcov.sh
tests/llvm-gcov.sh
+2
-0
未找到文件。
tests/CMakeLists.txt
浏览文件 @
932b2dfe
...
...
@@ -31,6 +31,8 @@ target_include_directories( chain_test PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/includ
add_dependencies
(
chain_test asserter test_api test_api_mem test_api_db test_api_multi_index exchange currency proxy identity identity_test stltest infinite eosio.system eosio.token eosio.bios test.inline multi_index_test noop dice eosio.msig
)
#
configure_file
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/llvm-gcov.sh
${
CMAKE_CURRENT_BINARY_DIR
}
/../llvm-gcov.sh COPYONLY
)
configure_file
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/p2p_tests/sync/test.sh
${
CMAKE_CURRENT_BINARY_DIR
}
/p2p_tests/sync/test.sh COPYONLY
)
configure_file
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/p2p_tests/dawn_515/test.sh
${
CMAKE_CURRENT_BINARY_DIR
}
/p2p_tests/dawn_515/test.sh COPYONLY
)
configure_file
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/trans_sync_across_mixed_cluster_test.sh
${
CMAKE_CURRENT_BINARY_DIR
}
/trans_sync_across_mixed_cluster_test.sh COPYONLY
)
...
...
@@ -68,7 +70,6 @@ add_test(NAME distributed-transactions-remote-test COMMAND tests/distributed-tra
if
(
ENABLE_COVERAGE_TESTING
)
set
(
Coverage_NAME
${
PROJECT_NAME
}
_coverage
)
set
(
Coverage_EXECUTABLE chain_test
)
if
(
NOT LCOV_PATH
)
message
(
FATAL_ERROR
"lcov not found! Aborting..."
)
...
...
@@ -78,27 +79,26 @@ if(ENABLE_COVERAGE_TESTING)
message
(
FATAL_ERROR
"genhtml not found! Aborting..."
)
endif
()
# NOT GENHTML_PATH
# no spaces allowed within tests list
set
(
ctest_tests 'chain_test_binaryen|chain_test_wavm|p2p_dawn515_test'
)
set
(
ctest_exclude_tests 'nodeos_run_test|nodeos_run_remote_test|nodeos_run_test-mongodb|distributed-transactions-test|distributed-transactions-remote-test'
)
# Setup target
add_custom_target
(
${
Coverage_NAME
}
# Cleanup lcov
COMMAND
${
LCOV_PATH
}
--directory . --zerocounters
# Create baseline to make sure untouched files show up in the report
COMMAND
${
LCOV_PATH
}
-c -i -d . -o
${
Coverage_NAME
}
.base
# Run tests
COMMAND
${
Coverage_EXECUTABLE
}
# Capturing lcov counters and generating report
COMMAND
${
LCOV_PATH
}
--directory . --capture --output-file
${
Coverage_NAME
}
.info
# add baseline counters
COMMAND
${
LCOV_PATH
}
-a
${
Coverage_NAME
}
.base -a
${
Coverage_NAME
}
.info --output-file
${
Coverage_NAME
}
.total
COMMAND
${
LCOV_PATH
}
--remove
${
Coverage_NAME
}
.total
${
COVERAGE_EXCLUDES
}
--output-file
${
PROJECT_BINARY_DIR
}
/
${
Coverage_NAME
}
.info.cleaned
COMMAND
${
GENHTML_PATH
}
-o
${
Coverage_NAME
}
${
PROJECT_BINARY_DIR
}
/
${
Coverage_NAME
}
.info.cleaned
COMMAND ctest -R
${
ctest_tests
}
-E
${
ctest_exclude_tests
}
COMMENT
"Capturing lcov counters and generating report"
COMMAND
${
LCOV_PATH
}
--directory . --capture --gcov-tool ./tests/llvm-gcov.sh --output-file
${
Coverage_NAME
}
.info
COMMENT
"Processing code coverage counters and generating report."
COMMAND
${
GENHTML_PATH
}
-o
${
Coverage_NAME
}
${
PROJECT_BINARY_DIR
}
/
${
Coverage_NAME
}
.info
COMMAND
${
CMAKE_COMMAND
}
-E remove
${
Coverage_NAME
}
.base
${
Coverage_NAME
}
.info
${
Coverage_NAME
}
.total
${
PROJECT_BINARY_DIR
}
/
${
Coverage_NAME
}
.info.cleaned
WORKING_DIRECTORY
${
PROJECT_BINARY_DIR
}
COMMENT
"Resetting code coverage counters to zero.
\n
Processing code coverage counters and generating report."
COMMENT
"Resetting code coverage counters to zero.
Processing code coverage counters and generating report."
)
# Show info where to find the report
...
...
tests/llvm-gcov.sh
0 → 100755
浏览文件 @
932b2dfe
#!/bin/bash
exec
llvm-cov gcov
"
$@
"
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录