簡體   English   中英

如何將PHPUnit測試保存為單獨的TAP結果

[英]How to save PHPUnit tests as individual TAP results

我有一個jenkins設置,可以用PHPUnit運行一些單元測試。

我希望將每個單元測試用例保存為單獨的點擊結果文件。

例如, testOneTest.phptestTwoTest.php的結果將分別保存為testOneTest.taptestTwoTest.tap 這樣可以在Jenkins UI中更好地顯示構建結果。

我已經為PHPUnit定義了XML配置文件 ,但是從文檔中,我只能看到保存為單擊結果文件的選項:

<log type="tap" target="/tmp/logfile.tap"/>

是否可以保存多個TAP結果? 干杯。

如果使用XML配置文件 ,則只需創建兩個具有不同輸出名稱的不同配置文件。 根據您調用phpunit的方式,它看起來可能像這樣:

1> phpunit -c /your/xml/configfile1.xml testOneTest.php
2> phpunit -c /your/xml/configfile2.xml testTwoTest.php

您也可以只將輸出參數提供給phpunit:

1> phpunit --log-tap /tmp/logfile1.tap testOneTest.php
2> phpunit --log-tap /tmp/logfile2.tap testTwoTest.php 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM