CMake, tests, headaches

So, JulTagger is proceeding rapidly, unfortunately yesterday I was shopping (or trying to find a book, to be more precise) and had not much time to work on it, although I worked a bit on RubyTag++ so that more bindings are now present.

With regard to RubyTag++, I thought last night that it would have been good if, instead of my silly simple test script (that uses my own MP3s and OGGs), I could write a series of battery tests so that i can just use “make test” to make sure I didn’t break anything while adding functionalities.

Not a bad idea… the first problem was to get an empty wave file so that it would be converted to mp3/ogg/flac to run the tests. I asked a friend for a simple 5 seconds wave file, but unfortunately he wasn’t able to get me a mute one (lovely when there’s no way to record the “null of universe”), so I did it the hacker’s way: took the header out of that file, created a new file, truncated it at the size of the original one, put the old header there. A simple bzip2 after, a 800KB wave file became a 122 bytes file.

Then it comes the time to get the tests written and run. Unfortunately the documentation about writing tests with CMake is quite vague, the man page does not really contain much useful things a part telling me to use ENABLE_TESTING() and ADD_TEST(), but how to tell it that for a test I need some files created seems to be a bit difficult.

Anyway, I’ll get a bigger headache later trying to grasp this, I just hope not to get one too big as tomorrow night I’ll be partying for the birthday of a friend of mine. Sometimes I get out of this room, and not to enter another machine room :P

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s