On Mon, Dec 10, 2012 at 3:44 PM, darrinps <[email protected]> wrote: > For some reason, sometimes they seem to get their Is Library boolean set. So > I selected the Prefs project, then hit the Project button on the tool bar, > then went into Preferences, then unchecked the Is Library on the bottom > right.
Except that Prefs is a library project. tests/ inside of Prefs uses that library. > Once I did that, I was able to ATTEMPT to run the tests at least but got the > following error: Prefs does not specify a > android.test.InstrumentationTestRunner instrumentation or does not declare > uses-library android.test.runner in its AndroidManifest.xml Because Prefs is not a test project. > Looking at your manifest though I could not see this to be true about the > manifest file: > > <instrumentation > android:name="android.test.InstrumentationTestRunner" > android:targetPackage="com.commonsware.cwac.prefs.test"/> That is not in the Prefs project. That is in the tests/ sub-project. > Is yours filled out? In Run Configurations, the tests/ sub-project is set to have android.test.InstrumentationTestRunner as its "Instrumentation runner". At this juncture, you might consider switching gears and experimenting with: https://github.com/commonsguy/cw-omnibus/tree/master/Testing/JUnit and its tests/ subdirectory. The problem with the other examples that I cite is that they are testing Android library projects, which is eminently possible but not what you're seeking (AFAIK) and is perhaps leading you down the wrong path. The sample listed above is a regular Android project with a tests/ sub-project. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 4.4 Available! -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

