我有许多并行运行的测试。每个测试都会生成一个范围报告文件,它是一个 html 文件。
我看不到如何在测试结束时合并这些文件?
所以我想这样做:
文件1.html:
<body>
content-1
</body>
文件2.html
<body>
content-2
</body>
结果应该是这样的:
合并.html
<body>
content-1
content-2
</body>
你有一个聪明的方法来做到这一点吗?
我有许多并行运行的测试。每个测试都会生成一个范围报告文件,它是一个 html 文件。
我看不到如何在测试结束时合并这些文件?
所以我想这样做:
文件1.html:
<body>
content-1
</body>
文件2.html
<body>
content-2
</body>
结果应该是这样的:
合并.html
<body>
content-1
content-2
</body>
你有一个聪明的方法来做到这一点吗?
<?xml version="1.0" encoding="UTF-8"?>
<project default="concat" name="My Project">
<property name="filesToMerge" value="/home/guest/Desktop/" />
<property name="mergeFile" value="/home/guest/Desktop/merge.html" />
<target name="concat">
<concat destfile="${mergeFile}">
<header filtering="no" trim="no" trimleading="yes">
<body>
</header>
<fileset dir="${filesToMerge}" />
<filterchain>
<linecontains negate="true">
<contains value="<body>" />
</linecontains>
<linecontains negate="true">
<contains value="</body>" />
</linecontains>
</filterchain>
<footer filtering="no" trim="yes" trimleading="yes">
</body>
</footer>
</concat>
</target>
</project>