Hi Gav:

If I understand what you are asking correctly, I think you need to use
the "android.test.suitebuilder.annotation.SmallTest" to annotate the
small tests in your suite. This annotation can be applied at the test
class or test method level. See the code in samples/ApiDemos/tests for
an example.

You can then use the command similar to the one you list below :
adb shell am instrument -w -e size small com.android.foo/
android.test.InstrumentationTestRunner

to run only the tests that have been annotated as a "SmallTest" in the
com.android.foo package.

I hope that helps.

Regards,
Brett.


On Apr 11, 3:21 pm, Gavin Aiken <gavin.ai...@imperial.ac.uk> wrote:
> Hi all,
>
> To build a test suite containing only small tests I looked at the source
> examples and found
> SmallTests.java<http://www.google.co.in/codesearch/p?hl=en#SS2by_AKaLs/tests/src/com/...>in
> the email app test source. I assumed that I would need to add a
> Predicate<%20http://www.google.co.in/codesearch/p?hl=en#uX1GffpyOZk/core/java/com/...>to
> such a class as this seems not to distinguish test sizes (Unless the
> test
> runner infers this from the name of the suite?).
>
> I could then add the predicate to a TestSuiteBuilder via
> 'addRequirements<%20http://developer.android.com/reference/android/test/suitebuilder/Test...>'
> but I couldn't work out how to build a predicate based on the annotation
> class SmallTest.
>
> Eventually I found the
> InstrumentationTestRunner<http://developer.android.com/reference/android/test/InstrumentationTe...>documentation
> and it seems that the command;
>
> adb shell am instrument -w -e size small
> com.android.foo/android.test.InstrumentationTestRunner
>
> Does the trick.
>
> I post this information for reference but also to ask if the former option
> is possible, i.e. if there is a simple predicate that I could create to
> isolate SmallTest annotated tests?
>
> Just for interests' sake :)
>
> Gav

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to