A blog about my daily tech ramblings.

Wednesday, 30 September 2015

Building a C/C++ project on Travis CI

September 30, 2015 Posted by Sachin Handiekar , , No comments
Let's see how we can use Travis CI for building a C/C++ project on Travis CI. We'll use the consoleRadio C application which is used to stream Shoutcast Radio as an example

The .travis.yml file for the consoleRadio application looks like the following -

Installing a custom version of cmake
We can install a custom version of cmake in Travis CI, using the following script -

Building a library from source
A library/dependency in Travis CI can be build from source and installed on Travis CI env.  -

1. Let's build the mpg123 library from source and install it on Travis CI. In .travis.yml, we'll have the following config -


2. We'll create a bash script (installMPG123.sh) with the following content -

Tuesday, 8 September 2015

Friday, 4 September 2015

Conditionally ignoring tests in JUnit

September 04, 2015 Posted by Sachin Handiekar , No comments
We might require to ignore a jUnit test based on a certain condition. jUnit just comes up with a @Ignore annotation which can be used to ignore the test.

We can use the below code to check if the condition has been met or not to ignore a test.



Reference : http://stackoverflow.com/questions/1689242/conditionally-ignoring-tests-in-junit-4