Test suite name locality

44 views
Skip to first unread message

Alexey Biryukov

unread,
Aug 5, 2013, 8:42:21 AM8/5/13
to igloo-...@googlegroups.com
First of all let me thank you, your work is impressive. Being under the impression, I have decided to give it a try and quickly ran into an issue.

Consider the following code (implementation details are omitted for sake of brevity).

 
Describe ( config_instance )
{
    Describe ( with_invisible_string_configuration_parameter )     {         Describe ( by_default )         {             It ( is_empty )             {}             It ( shows_empty_value )             {}       };         Describe ( when_assigned )         {             It ( holds_the_value )             {}             It ( shows_the_value )             {}       };     };     Describe ( with_visible_string_configuration_parameter )     {         Describe ( by_default )         {             It ( is_empty )             {}             It ( shows_empty_value )             {}         };         Describe ( when_assigned )         {             It ( holds_the_value )             {}             It ( shows_the_value )             {}         };     }; };

Surprisingly I have discovered that only a half of my testcases are actually executed. The problem came down to that test suite names are all global. There are 2 test suites called just "by_default" and 2 suites called "when_assigned", and only one of each of them gets registered - because its name has to be globally unique.

I have tried to play with SubContexts but they seem to be globally named the same way.

I would hate to have my suites named like by_default1 and by_default2 given they already reside in different super suites. They are scopes at last, aren't they?

I feel like I'm missing something important about your implementation. If I'm not, I would gladly accept a hint from you where I should start to bring testsuites name locality into Igloo.

Joakim Karlsson

unread,
Aug 5, 2013, 10:19:10 AM8/5/13
to igloo-...@googlegroups.com
Yes, this is a bug.

TestRunner::RegisterContext() only takes the string provided to the 'Describe' macro. We need to find a way to make it aware of parent contexts somehow. I'm not sure how at the moment.

Could you post this as an issue on Igloo's github page?

Thanks for the help.

/Joakim



--
You received this message because you are subscribed to the Google Groups "Igloo-testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to igloo-testin...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Joakim Karlsson

unread,
Aug 6, 2013, 3:47:53 AM8/6/13
to igloo-...@googlegroups.com
I think we can fix this by simply registering the context by name and __FILE__ and __LINE__. This way we each context should have something unique identifying them even when its local name isn't globally unique.

/Joakim

Joakim Karlsson

unread,
Aug 6, 2013, 4:03:19 AM8/6/13
to igloo-...@googlegroups.com
I've pushed an attempt to fix this on master. I built it with clang, but I need to verify that it builds on gcc and Visual Studio.

Could you check if this fixes the issue for you?

/Joakim

Alexey Biryukov

unread,
Aug 6, 2013, 8:31:02 AM8/6/13
to igloo-...@googlegroups.com
Hi Joakim,

I'm sorry I'm somewhat behind you... Ok, I would check that asap. Do you still want me to create a ticket?


Joakim Karlsson <joa...@jkarlsson.com> писал(а) в своём письме Tue, 06 Aug 2013 11:03:19 +0300:
--
Alexey Biryukov

Joakim Karlsson

unread,
Aug 6, 2013, 8:35:14 AM8/6/13
to igloo-...@googlegroups.com
I created a ticket for you.

Let me know if this helps.


Alexey Biryukov

unread,
Aug 6, 2013, 11:07:31 AM8/6/13
to igloo-...@googlegroups.com
Works like a charm. Thank you!


Joakim Karlsson <joa...@jkarlsson.com> писал(а) в своём письме Tue, 06 Aug 2013 15:35:14 +0300:

Joakim Karlsson

unread,
Aug 6, 2013, 11:44:26 AM8/6/13
to igloo-...@googlegroups.com
Great!

I just published a release containing the patch: https://github.com/joakimkarlsson/igloo/releases/tag/igloo.1.1.1

Thanks for the help.

/Joakim
Reply all
Reply to author
Forward
0 new messages