Peter,<div><br></div><div>Thanks for letting me know. I considered it a bug as well. On the topic of the config functions, I think other testing frameworks like Ruby's RSpec ignore them when no tests in the group exist. I assume this is to prevent hard to debug side-effects in tests and as a small optimization.</div>
<div><br></div><div>Jordan West</div><div><br><div class="gmail_quote">On Tue, Mar 29, 2011 at 1:56 AM, Peter Andersson <span dir="ltr"><<a href="mailto:pekadan@gmail.com">pekadan@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Jordan,<br>
<br>
I learned about this problem just the other day. I consider it a bug<br>
really. An empty group should be ignored, or possibly, the config<br>
functions for the group should be executed (even if there's no test<br>
case to configure for). I have written a ticket on it and a fix will<br>
come shortly.<br>
<br>
Thanks for reporting!<br>
<br>
Best regards,<br>
Peter<br>
<br>
Ericsson AB, Erlang/OTP<br>
<br>
2011/3/29 Jordan West <<a href="mailto:jwest@makingfun.com">jwest@makingfun.com</a>>:<br>
<div><div></div><div class="h5">> I've recently been using common_test on several new projects and am really<br>
> liking it. I ran across something today I found odd, however, and wanted to<br>
> know if it was the expected behavior. I was expecting that if I have a<br>
> group with no tests that group should, essentially, be ignored. This seems<br>
> to be the case if the group is contained in another but not if the group is<br>
> an element in the list returned by all/0. In the latter case the suite<br>
> errors out with "Error in suite detected: 'Invalid reference to group [GROUP<br>
> NAME] in [SUITE NAME]:all/0'".<br>
> Is this intentional and if so, why are sub-groups treated differently? Is<br>
> there a reason its not a warning instead? For the most part I'm just<br>
> curious. I do like setting up my groups sometimes ahead of writing tests and<br>
> ran into this when I tried to leave a top-level group empty for a short<br>
> while.<br>
> A minimal code example is below. I'm using R14B02 on OS-X with common_test<br>
> 1.5.3 (I installed today off the Erlang Factory USB stick, thanks for a<br>
> great conference everyone). Oh, and this is my first message to the list.<br>
> Hello, all.<br>
> %% a.erl<br>
> -module(a).<br>
> -compile(export_all).<br>
> my_fun() -><br>
> 1.<br>
> %% a_SUITE.erl<br>
> -module(a_SUITE).<br>
> -compile(export_all).<br>
> groups() -><br>
> [{group_1,<br>
> [shuffle],<br>
> [test_1, {group, group_3}]},<br>
> {group_2,<br>
> [shuffle],<br>
> []}, % this empty test list causes issues if empty<br>
> {group_3,<br>
> [],[]}]. % this empty test list seems to be able to be empty<br>
> all() -><br>
> [<br>
> {group, group_1},<br>
> {group, group_2} %% If this is remove the suite won't error out<br>
> ].<br>
> test_1(_) -><br>
> 1 = a:my_fun().<br>
>>> run_test -suite a_SUITE.erl<br>
> ...<br>
> Error in suite detected: 'Invalid reference to group group_2 in<br>
> a_SUITE:all/0'<br>
> Jordan West<br>
><br>
</div></div>> _______________________________________________<br>
> erlang-questions mailing list<br>
> <a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
> <a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
><br>
><br>
</blockquote></div><br></div>