0
私は、アンチユニットテストに追加したantプロジェクトを持っています。これはテストを実行するターゲットです。私は、エコー文はコンソールまたはレポートに印刷されませんant test-build
を実行するとアンチユニットテストのエコーが表示されない
<target name="test-build" depends="init-build">
<au:antunit>
<fileset file="test.xml"/>
<au:plainlistener/>
<au:xmllistener todir="${reports.antunit.dir}"/>
</au:antunit>
</target>
のtest.xmlこの
<project xmlns:au="antlib:org.apache.ant.antunit">
<include file="build.xml" as="main"/>
<target name="tearDown" depends="main.clean"/>
<target name="test-project-name">
<echo>project name is ${ant.project.name}</echo>
<au:assertTrue>
<equals arg1="${ant.project.name}" arg2="gradle-to-ant"/>
</au:assertTrue>
</target>
</project>
のように見えます。
test-build:
[au:antunit] Build File: /etc/user/john/projects/gradle-to-ant/test.xml
[au:antunit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.033 sec
[au:antunit] Target: test-project-name took 0.012 sec
BUILD SUCCESSFUL
Total time: 0 seconds
私はエコーpropsのような他のプロジェクトで使用さ見てきました。どのようにして、反戦テストでエコーを働かせることができますか?
、あなたは
antunit
タスクにlogforwarder
testlistenerを追加する必要がecho
の出力を確認したい場合は、私はまだこれを試すことができませんでしたが、私はそれが動作すると確信しています。私はまた、すべてのアサートマクロを表示するantlib.xmlも発見しました。これは、アンチユニットを学びたい人に役立ちます。また、抗日の開発に関与してくれてありがとう! –ようこそ。 AntUnitディストリビューションをApache(またはそのミラーの1つ)からダウンロードする場合は、マニュアルも含まれています。なんらかの理由で、これをデフォルトの配布ポイントと考えていますので、マニュアルをオンラインにすることは決してありません。 –
ああ、それはいいだろう。イムを使ってイニシャルをインストールするImこれがプロジェクトです。 github.com/moaxcp/gradle-to-ant –