コンテキスト: 再帰的に python を含むディレクトリunittest.TestCase
:
projectdir/build.xml
projectdir/src/x.java
projectdir/distribute/p.jar
projectdir/tests/a/test1.py
projectdir/tests/a/test2.py
projectdir/tests/b/test1.py
projectdir/tests/c/test1.py
projectdir/tests/javaunittests/test2.java
そして、アリに電話してもらいたい
python -m unittest discover -s a b c
今、私はを含むディレクトリのに変換しようとしていfileset
ましたか? dirset
アイデアは、python unittests を実行することです。
<apply command="python">
<arg line="-m unittest"/>
<arg value="-s"/>
<dirset include="${python_unittests}"/>
</apply>
where ${python_unittests}" would refer to a
fileset` (ただし、方法がわかりません) は次のようになります。
<fileset id="python_unittests" include="**/*.py">
<containsregexp expression="\(unittest.TestCase\)"/>
</fileset>
それとも私は間違っていますか、これを達成するためのより良い方法はありますか?