Conflict with Cairo

13 views
Skip to first unread message

Rex

unread,
Jun 8, 2010, 7:10:50 PM6/8/10
to Igloo-testing
Hey,

I was trying igloo with a gtkmm application and igloo's "Context"
macro seemed to conflict with Cairo. I could get it to work by
renaming the macro, but I was wondering if there's a better way to fix
the problem. Has anyone else had this problem?

Kim Gräsman

unread,
Jun 9, 2010, 9:25:57 AM6/9/10
to igloo-...@googlegroups.com
Hi Rex,

Hmm, I can't see a way around that other than #undef:ing Igloo's Context.

If you check registration.h, Context/Spec and TestFixture/TestMethod
are all aliases for properly name-decorated macros.

We've been considering "externalising" the macros further, so you
explicitly have to choose which syntax you want (by including
different headers), add your own or just use the raw
IGLOO_xxx_REGISTRATION macros.

- Kim

Rex Fernando

unread,
Jun 9, 2010, 4:27:49 PM6/9/10
to igloo-...@googlegroups.com
Ok, thanks; I guess I'll just use TestFixture/TestMethod.

Igloo is very nice, by the way; it's the most elegant unit testing library in C++ I've seen.

Kim Gräsman

unread,
Jun 10, 2010, 10:03:54 AM6/10/10
to igloo-...@googlegroups.com
Hi Rex,

Thanks!

We'll talk through the issue of the word "Context", which I can
imagine is more pervasive in other frameworks than any of the others,
and see if we can come up with another term, as well as some mechanism
for protecting us from this kind of problem.

Cheers,
- Kim

Joakim Karlsson

unread,
Jun 9, 2010, 2:14:11 AM6/9/10
to igloo-...@googlegroups.com
Hi,

I believe we need to rethink our naming strategy, and use names that
minimizes the risk of collisions.

Any ideas?

/Joakim

Joakim Karlsson

unread,
Jun 10, 2010, 12:52:47 PM6/10/10
to igloo-...@googlegroups.com
Hi all,

Thanks for the feedback, Rex!

I've pushed a change where igloo.h has been split up into igloo.h and
igloo_framework.h.

igloo_framework.h includes everything except the registration macro
aliases, and igloo.h includes igloo_framework.h plus the aliases.

That way, we give users the opportunity to include the core igloo
framework and then use a custom alias scheme if needed.

It would be nice if we could come up with a naming scheme that doesn't
cause collisions and still is concise and readable.

/Joakim

Rex Fernando

unread,
Jun 14, 2010, 2:40:55 PM6/14/10
to igloo-...@googlegroups.com
That sounds good.

As far as another naming scheme, here are my thoughts: Context and Spec seem like pretty standard words in BDD frameworks, so it would be nice to keep them. We just have to figure out a way to keep them from conflicting with other libraries. In the project I'm using Igloo to test, I renamed Context to Igloo_Context and Spec to Igloo_Spec; the test definitions end up slightly less pretty but are definitely still readable.

Rex
Reply all
Reply to author
Forward
0 new messages