activitycreator script is enhanced to generate 'tests' project along with the main project. The current behavior of generating Activity is extended by generating ActivityTest in 'tests/src' folder. The 'tests' folder follows the example provided asis in 'ApiDemos'. ApiDemos was used as reference project to mimic the project layout for building tests using Instrumentation.
From 'tests' project, type:
"adb shell am instrument -w [your.package].tests/android.test.InstrumentationTestRunner"
to run all tests using Android InstrumentationTestRunner.
NOTE: 'tests' is a separate AndroidProject by all means. It has its own AndroidManifest.xml, build.xml, src, res etc.,
AMEND:
Fixed style issues, javadoc
Fixed build.template to generate tests/build.xml
Removed build.tests.template since its obsolete now.
This change makes sure the srcdir is pointing to only the java source folder and not recursively compile all source folders under the current folder. This is useful in having multiple java source folders for main, tests etc., Only the compile target is being affected by this change.
NOTE: Now you can have project/tests and work with tests as a separate android project, only for testing. In any case pointing to source explicitly makes sure no side affects arise by recursive compiling.
If you run "make sdk" under the root path, there would be an error:
development/build/sdk.atree:122: couldn't locate source file:
development/emulator/prebuilt/android-arm/kernel-qemu
make: *** [out/host/darwin-x86/sdk/android-sdk_eng.Evan_mac-x86.zip]
Error 44
I guess the kernel-qemu path is wrong in the sdk.atree file.
With this patch, "make sdk" works ok.