PhpRiot
News Archive
PhpRiot Newsletter
Your Email Address:

More information

Headless testing of RCP application

Note: This article was originally published at Planet PHP on 10 October 2010.
Planet PHP
A week ago or so I needed to add a Unit Test invocation as part of my Eclipse RCP application headless build. My original PDE build configuration consisted of a single target for .product with "runPackager=true". I was too lazy to create an additional one for the test feature that contains Unit Tests plug-ins (which would cost me in a longer build time, BTW).

So, I decided to include the test feature in a .product, and remove dependency on it after all tests were executed. This simple piece of Ant code does whole the magic:

file="${reposDir}/content.xml"
match=""
replace=""
byline="true" /

It needs to be executed twice: once in a prePackage target, and another time in a postBuild target in order to fix the resulted p2 repository as well.