1 Star 0 Fork 13

甜玉米 / Berry

forked from Gitee 极速下载 / Berry 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
testall.be 1.03 KB
一键复制 编辑 原始数据 按行查看 历史
skiars 提交于 2020-08-14 21:58 . fix some bugs & update testcases
#! ./berry
import os
os.system('lcov', '-q -c -i -d . -o init.info')
var exec = './berry'
var path = 'tests'
var testcases = os.listdir(path)
var total = 0, failed = 0
for i : testcases
if os.path.splitext(i)[1] == '.be'
print('\033[0;36mrun testcase: ' + i + '\033[0m')
var ret = os.system(exec, os.path.join(path, i))
if ret != 0
print('\033[0;31mreturn code:', ret, '\033[0m')
failed += 1
end
total += 1
end
end
print('\033[0;32mtest results: ' +
str(total) + ' total, ' + str(failed) + ' failed' +
(failed ? '' : ' (all tests passed)') +
'.\033[0m')
if failed != 0
os.exit(-1)
end
var cmds = [
'lcov -q -c -d ./ -o cover.info',
'lcov -q -a init.info -a cover.info -o total.info',
'lcov --remove total.info */usr/include/* -o final.info',
'genhtml -q -o test_report --legend --title "lcov" --prefix=./ final.info',
'rm -f init.info cover.info total.info final.info'
]
for cmd : cmds
if os.system(cmd)
os.exit(-1)
end
end
C/C++
1
https://gitee.com/sweet_corn/Berry.git
git@gitee.com:sweet_corn/Berry.git
sweet_corn
Berry
Berry
master

搜索帮助