提交 f0c130a5 编写于 作者: 些猜's avatar 些猜

新增了对新旧REPORT文本比较功能

Signed-off-by: 些猜's avatarcaifuzhou <504631861@qq.com>
上级 72540e74
......@@ -33,12 +33,13 @@
此bat将从WSL映射目录传输文件到单板目录下,由于WSL无法直接访问windows端口,所以在WSL中直接使用可能无法传输用例。
5. 若要单独执行测试用例,需要先将common目录下的`runtest`与用例传输到单板,再通过命令执行,结果将打印出来
4. 若要单独执行测试用例,需要先将common目录下的`runtest`与用例传输到单板,再通过命令执行,结果将打印出来
```shell
./runtest -w '' {filename}
```
5. runtest.bat执行结束前会将输出的REPORT与在libc-test/report_base下的REPORT相比较,如果比较出不同将会在scripts下
生成一个result.html文件,否则不生成。
### 三、增加用例
......
import difflib
import os
def compare_file():
if os.path.exists(r'result.html'):
os.remove(r'result.html')
f = open(r'../libc-test/REPORT','r')
a = f.readlines()
f.close()
f = open(r'REPORT','r')
b = f.readlines()
f.close()
if a != b:
compare = difflib.HtmlDiff()
c = compare.make_file(a,b)
f = open(r'result.html','w')
f.write(c)
f.close
if __name__ == '__main__':
compare_file()
\ No newline at end of file
......@@ -104,6 +104,16 @@ set /a endS=%time:~6,2%
set /a endM=%time:~3,2%
set /a diffS_=%endS%-%startS%
set /a diffM_=%endM%-%startM%
@REM REPORT文件比较
start python %LOCAL%\third_party\musl\scripts\compare.py
if exist "%LOCAL%\third_party\musl\scripts\\result.html" (
echo Test failed,please checking result.html!
) else (
echo Test successful!
)
echo file compareing finished
echo All items finished.
echo Time cost:%diffM_%m%diffS_%s .
echo.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册