Run multiple test suites?

13 views
Skip to first unread message

mosesoak

unread,
Jul 20, 2011, 2:26:34 PM7/20/11
to ProjectSprouts
Hey Luke, I have a "core library" that my main app links to, and I'd
love it if I could just run tests from the main app project.

So far I've built the tests in both projects, since the core library
can remain independent and maintain its own test suite.

So: is there an easy way to run multiple test suites from the main
app's runner?

If not, it seems the logical thing to do would be to just tweak the
AllTests class in the main app to include all the tests from the core
library's AllTests. But that class shows a warning that it will be
overwritten when generating new test cases. Or maybe it would be
possible to use the Reflection tools in asunit to generate some sort
of combined AllTests class to pass to core.start().

Ideas? Thanks!
:-)

Luke Bayes

unread,
Jul 20, 2011, 3:09:29 PM7/20/11
to project...@googlegroups.com
Hey Moses,

This sounds like a helpful feature to me. I would think that you would
want to simply add to the number of paths that the test suite
generator looks in. This would automatically pull in (and run) the
test cases from other locations.

Here's the AsUnit test suite generator:

https://github.com/patternpark/asunit/blob/master/asunit-4.0/sprout/lib/asunit4/suite_class_generator.rb

Here's the method that the test suite generator's template uses to get
the collection of test cases:

https://github.com/lukebayes/sprout-flashsdk/blob/master/lib/flashsdk/generators/flash_helper.rb#L88

My first guess is that you might want to create your own
suite_class_generator, and load it from your gemfile.

Your version could override the test_case_classes or test_glob method
to include the other directories.

That should get you going for now.


Thanks,

Luke

> --
> You received this message because you are subscribed to the Google Groups "ProjectSprouts" group.
> To post to this group, send email to project...@googlegroups.com
> To unsubscribe from this group, send email to projectsprout...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/projectsprouts?hl=en
>
> For other info you can visit our project at: http://projectsprouts.org, or on Github at: http://github.com/lukebayes/project-sprouts
>

Luke Bayes

unread,
Jul 20, 2011, 3:18:15 PM7/20/11
to project...@googlegroups.com
Hey Moses,

I went digging around in the generators and started thinking that we
were losing the outermost command line parameters when one generator
called another, but it turns out that is not the case.

Here's the underlying implementation that the generators use when
calling another generator:

https://github.com/lukebayes/project-sprouts/blob/master/lib/sprout/generator/base.rb#L170

We can 'override' any parameters we wish, but the original parameters
will be forwarded all the way down.

I'd actually consider making the 'test' parameter a Strings type
instead of String. Then, the consumption of this parameter would have
to change in a handful of locations, but assuming you define it
multiple times, the template would search multiple paths for it.

This change might impact other folks (like the robotlegs people -
Kristofer?), so does anyone have thoughts or opinions?

Anyone want to try it out and see what happens?


Thanks,

Luke

Reply all
Reply to author
Forward
0 new messages