commit | 986790ec7cf697385562a5a28828571e73a59107 | [log] [tgz] |
---|---|---|
author | Christian Williams & Phil Goodwin <pair+xian+phil@pivotallabs.com> | Tue Nov 02 16:46:59 2010 -0700 |
committer | Christian Williams & Phil Goodwin <pair+xian+phil@pivotallabs.com> | Tue Nov 02 16:46:59 2010 -0700 |
tree | 4922a4cdb200426fe54348cff9553f91624c8007 | |
parent | bf4aaea6d7e41c5aac03e3b0838c0b7c7d4a4ac4 [diff] |
Add jar-all ant target. Improve docs. Add eclipse launch target.
If you‘d like to quickly get started using Robolectric to test your app, these instructions are for you. We’ll show how to include a pre-built Robolectric jar. While it‘s possible to make some changes to how Robolectric works in this configuration, you won’t be able to make larger changes or contribute to the Robolectric project itself. This is a good place to get started even if you want to do more complicated work later.
IntelliJ currently has a bug which causes JUnit tests within Android projects to run very slowly. To get around this, we place our production and test code into a non-Android module, which allows the tests to build and run at maximum speed, and declare a dependency to this code from the main Android module, so we can build the final apk.
more details to come...
Create a test project alongside your app's project. For example, if your app is named MyApp, create a MyAppRobolectricTest project, and create a test source tree there.
Add the appropriate Android SDK jars to the test project's build path (e.g. {android sdk root}/platforms/android-8/android.jar and {android sdk root}/add-ons/addon_google_apis_google_inc_8/libs/maps.jar)
Download robolectric-all.jar place it in your test project and add it to the build path.
Add a new JUnit run/debug launch configuration to run the tests in the test folder.
If you find that you need to extend or modify Robolectric‘s Android simulation, or you’d like to contribute to the project, these instructions will help get you started.
more details to come...
Follow the instructions for Eclipse quick start above, but don't download the robolectric-all.jar. Instead, use git to clone the Robolectric repository:
git clone git@github.com:pivotal/robolectric.git
(You'll probably want to fork the repo on github first so you can submit pull requests back to us.)
Add robolectric as an Eclipse project and make your test project depend on it.
Add the Android SDK jars to the robolectric project also, as above.