Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
畅游知识海洋
json
提交
75f4678b
J
json
项目概览
畅游知识海洋
/
json
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
json
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
75f4678b
编写于
10月 05, 2017
作者:
N
Niels Lohmann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
🔨
added filter script for branch coverage
上级
c204ac82
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
786 addition
and
1 deletion
+786
-1
test/CMakeLists.txt
test/CMakeLists.txt
+3
-1
test/thirdparty/imapdl/filterbr.py
test/thirdparty/imapdl/filterbr.py
+109
-0
test/thirdparty/imapdl/gpl-3.0.txt
test/thirdparty/imapdl/gpl-3.0.txt
+674
-0
未找到文件。
test/CMakeLists.txt
浏览文件 @
75f4678b
...
...
@@ -41,10 +41,12 @@ if(JSON_Coverage)
find_program
(
GCOV_BIN NAMES gcov-
${
GCC_VERSION
}
gcov HINTS
${
COMPILER_PATH
}
)
# add target to collect coverage information and generate HTML file
# (filter script from https://stackoverflow.com/a/43726240/266378)
add_custom_target
(
lcov_html
COMMAND lcov --directory . --capture --output-file json.info --gcov-tool
${
GCOV_BIN
}
--rc lcov_branch_coverage=1
COMMAND lcov -e json.info
${
CMAKE_SOURCE_DIR
}
/src/json.hpp --output-file json.info.filtered --rc lcov_branch_coverage=1
COMMAND genhtml --title
"JSON for Modern C++"
--legend --demangle-cpp --output-directory html --show-details --branch-coverage json.info.filtered
COMMAND
${
CMAKE_SOURCE_DIR
}
/test/thirdparty/imapdl/filterbr.py json.info.filtered > json.info.filtered.noexcept
COMMAND genhtml --title
"JSON for Modern C++"
--legend --demangle-cpp --output-directory html --show-details --branch-coverage json.info.filtered.noexcept
COMMENT
"Generating HTML report test/html/index.html"
)
endif
()
...
...
test/thirdparty/imapdl/filterbr.py
0 → 100755
浏览文件 @
75f4678b
#!/usr/bin/env python3
# 2017, Georg Sauthoff <mail@gms.tf>, GPLv3
import
sys
def
skip_comments
(
lines
):
state
=
0
for
line
in
lines
:
n
=
len
(
line
)
l
=
''
p
=
0
while
p
<
n
:
if
state
==
0
:
a
=
line
.
find
(
'//'
,
p
)
b
=
line
.
find
(
'/*'
,
p
)
if
a
>
-
1
and
(
a
<
b
or
b
==
-
1
):
l
+=
line
[
p
:
a
]
p
=
n
elif
b
>
-
1
and
(
b
<
a
or
a
==
-
1
):
l
+=
line
[
p
:
b
]
p
=
b
+
2
state
=
1
else
:
l
+=
line
[
p
:]
p
=
n
elif
state
==
1
:
a
=
line
.
rfind
(
'*/'
,
p
)
if
a
==
-
1
:
p
=
n
else
:
p
=
a
+
2
state
=
0
yield
l
def
cond_lines
(
lines
):
state
=
0
pcnt
=
0
for
nr
,
line
in
enumerate
(
lines
,
1
):
if
not
line
:
continue
n
=
len
(
line
)
p
=
0
do_yield
=
False
while
p
<
n
:
if
state
==
0
:
p
=
line
.
find
(
'if'
,
p
)
if
p
==
-
1
:
p
=
n
continue
if
(
p
==
0
or
not
line
[
p
-
1
].
isalpha
())
\
and
(
p
+
2
==
len
(
line
)
or
not
line
[
p
+
2
].
isalpha
()):
do_yield
=
True
state
=
1
p
+=
2
elif
state
==
1
:
do_yield
=
True
p
=
line
.
find
(
'('
,
p
)
if
p
==
-
1
:
p
=
n
else
:
p
+=
1
state
=
2
pcnt
=
1
elif
state
==
2
:
do_yield
=
True
for
p
in
range
(
p
,
n
):
if
line
[
p
]
==
'('
:
pcnt
+=
1
elif
line
[
p
]
==
')'
:
pcnt
-=
1
if
not
pcnt
:
state
=
0
break
p
+=
1
if
do_yield
:
yield
nr
def
cond_lines_from_file
(
filename
):
with
open
(
filename
)
as
f
:
yield
from
cond_lines
(
skip_comments
(
f
))
def
filter_lcov_trace
(
lines
):
nrs
=
set
()
for
line
in
lines
:
if
line
.
startswith
(
'SF:'
):
nrs
=
set
(
cond_lines_from_file
(
line
[
3
:
-
1
]))
elif
line
.
startswith
(
'BRDA:'
):
xs
=
line
[
5
:].
split
(
','
)
nr
=
int
(
xs
[
0
])
if
xs
else
0
if
nr
not
in
nrs
:
continue
yield
line
def
filter_lcov_trace_file
(
s_filename
,
d_file
):
with
open
(
s_filename
)
as
f
:
for
l
in
filter_lcov_trace
(
f
):
print
(
l
,
end
=
''
,
file
=
d_file
)
if
__name__
==
'__main__'
:
#for l in cond_lines_from_file(sys.argv[1]):
# print(l)
filter_lcov_trace_file
(
sys
.
argv
[
1
],
sys
.
stdout
)
#with open(sys.argv[1]) as f:
# for l in skip_comments(f):
# print(l)
test/thirdparty/imapdl/gpl-3.0.txt
0 → 100644
浏览文件 @
75f4678b
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录