Posts about technology and arts.
I'm preparing a plug-in API proposal for TestLink, and thought that the best way to learn how to write a good plug-in API would be by looking at other application's plug-in API's.
This post contains information that I gathered for creating this new API, but that may also be useful for other programmers. I used Wordpress, Mantis and Jenkins in this study. Let me know if you find any mistakes or if you have any other suggestions.
I always read the messages in the Apache dev mailing lists, including Apache Commons dev mailing list. And you should too. There are always interesting discussions. Sometimes you participate, other times you only watch what's happening, but in the end you always learn something new.
After the last post about GoogleTest and TestLink using Jenkins TestLink Plug-in, I received an e-mail asking about coverage with GoogleTest and Jenkins. I’ve just updated the Makefile in the samples directory, of the GoogleTest TAP listener project, to output coverage data.
Basically, you have to add the compiler flags
-fprofile-arcs -ftest-coverage and link the executable with
-lgcov. Take a look at the project’s Makefile and you’ll notice how simple it is. In order to have Jenkins
interpreting your coverage report, you’ll have to convert it to cobertura
XML. There is a Python utility that can be used for this: gcovr.
Download it and copy it to somewhere where Jenkins can execute it (e.g.:
Now, if you’ve followed the instructions from the previous post, you should have a job that reports your GoogleTest
tests from Jenkins to TestLink using the plug-in, and is downloading the source code from GitHub. Add an extra build
step (Shell) to execute
For this simple guide we will use the samples that come with GTest TAP Listener. You can get the code from GitHub with
git clone git://github.com/kinow/gtest-tap-listener.git. Take a look at
gtest-tap-listener/samples/src/, there you will find two C++ files:
gtest_main.cc has the main function, and executes the test suite. And
gtest_testHelloWorld.cc has the test cases and tests. Take note of the test case and tests names.
It is a conference on pattern languages of programming. About six months ago I saw a tweet by Eduardo Guerra asking if anyone had some cases where certain patterns were applied. It was a big coincidence, since I was working on Apache Commons Functor and some Jenkins plugins, both projects with cases that could be used in his paper.
So I joined Guerra and gave my small contribution to the paper that has been accepted for this edition of SugarLoafPlop. Guerra also went there to give a talk and participate in an open discussion about several papers, including ours.
I simply love when these things happen, it was great work with Guerra, and even better for being able to use Open Source examples in our paper.