วันศุกร์ที่ 14 พฤศจิกายน พ.ศ. 2551

[ phpunit ] How to log test results and represent it in graphical format [ untested ]

This memo is from Pratikshya. Actually I have just copied and paste. try at your own risk.

The URL: http://www.phpunit.de/pocket_guide/3.1/en/logging.html contains the examples for logging the test results into various format. For representing the test result in graphical format, we need to install "Image_GraphViz" package. It can be done by executing:

$ sudo pear install Image_GraphViz


command inside php folder. Also additionally, graphviz should be installed. libgv-php5 can optionally be installed which is the Php5 bindings for graphviz (but not required to run dot command).

The log file is saved in .dot format. Now the result of the test file can be logged using the following command:

$ phpunit --log-graphviz testfile.dot testfile.php


Now the .dot file can be converted into graphical format using the following command:

$ dot -T png -o testfile.png testfile.dot

or

$ whateverCommandThatExportDotFormat| dot -Tsvg > whatever/path/to/picture.svg


Successful tests are displayed with a green border, failures and errors with a red border, and incomplete or skipped tests with a yellow border.

Similarly, for logging the file in XML format, following command can be used:

$ phpunit --log-xml testfile.dot testfile.php

ไม่มีความคิดเห็น:

LinkWithin

Related Posts Plugin for WordPress, Blogger...