aboutsummaryrefslogtreecommitdiffstats
path: root/sdkmanager/app/tests
diff options
context:
space:
mode:
authorJohnnie Birch <johnnie.l.birch.jr@intel.com>2011-02-03 18:56:59 -0800
committerJohnnie Birch <johnnie.l.birch.jr@intel.com>2011-03-01 11:08:33 -0800
commit38b72b64c1c066658266e07fdb1ea0717025183b (patch)
tree982ebeb8216ee816cff3c2556f964ef6c7f1b60b /sdkmanager/app/tests
parent2695266bdddb8d827ea682a7e310e19919a73826 (diff)
downloadsdk-38b72b64c1c066658266e07fdb1ea0717025183b.zip
sdk-38b72b64c1c066658266e07fdb1ea0717025183b.tar.gz
sdk-38b72b64c1c066658266e07fdb1ea0717025183b.tar.bz2
AVD and ADT eclipse plugin to support processor-specific platform images and emulators.
This is a first (and largest) patch in a series of patches over the next month to extend the AVD and ADT eclipse plugin to support processor-specific platform images and emulators. This patch is intended to co-exist with patches to create x86 emulator environments and overall SDK support. There is an overall expectation that the sdk building process will be updated to meet the following expectations... It is not in the scope of these UI patches to change the overall sdk building structure. expectation #1: tools/emulator[.exe] -- ARM tools/emulator-x86[.exe] -- x86 tools/emulator-foo[.exe] -- an arbitrary additional architecture (extensible) expectation #2: platforms/android-XXX/images/arm - location of kernel/images for ARM platforms/android-XXX/images/x86 - location of kernel/images for x86 platforms/android-XXX/images/foo - location of kernel/images for arbitrary architecture expectation #3 In the event that add-ons are in the SDK, add-ons/addon_XXX/images/arm - location of kernel/images for ARM add-ons/addon_XXX/images/x86 - location of kernel/images for x86 add-ons/addon_XXX/images/foo - location of kernel/images for arbitrary architecture NOTE: For "earlier"/legacy api levels, it is assumed that it is ARM only and the images will be in platforms/android-XXX/images and add-ons/addon_XXX/images When an API level is chosen in AVD, it scans the appropriate API directories and determines if the image directory is "legacy" or if it has subdirectories. In the latter case, it populates the list of potential processors using these directory names (and some prettyprinting for well known architectures) tested using "android" command line to start AVD on linux and windows tested using Eclipse plugin AVD integration on linux and windows REMINDER: You need to change the directory layout of images and add the right emulator-XXX[.exe] to test it If one uses the "android" command line to create an AVD from the command line, the processor type is assumed to be arm today. A future patch will be needed to add command line processor type selectivity Change-Id: Ifd7c39bf93c6e926f62407bfed024d2789efb41a
Diffstat (limited to 'sdkmanager/app/tests')
-rw-r--r--sdkmanager/app/tests/Android.mk28
-rw-r--r--sdkmanager/app/tests/com/android/sdkmanager/AvdManagerTest.java12
-rw-r--r--sdkmanager/app/tests/com/android/sdkmanager/MainTest.java7
3 files changed, 40 insertions, 7 deletions
diff --git a/sdkmanager/app/tests/Android.mk b/sdkmanager/app/tests/Android.mk
new file mode 100644
index 0000000..dda405a
--- /dev/null
+++ b/sdkmanager/app/tests/Android.mk
@@ -0,0 +1,28 @@
+# Copyright (C) 2011 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+LOCAL_PATH := $(call my-dir)
+
+
+include $(CLEAR_VARS)
+
+# Only compile source java files in this lib.
+LOCAL_SRC_FILES := $(call all-subdir-java-files)
+
+LOCAL_MODULE := app-tests
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_JAVA_LIBRARIES := sdkmanager sdklib-tests junit
+
+include $(BUILD_HOST_JAVA_LIBRARY)
diff --git a/sdkmanager/app/tests/com/android/sdkmanager/AvdManagerTest.java b/sdkmanager/app/tests/com/android/sdkmanager/AvdManagerTest.java
index 3260024..cc8d6a4 100644
--- a/sdkmanager/app/tests/com/android/sdkmanager/AvdManagerTest.java
+++ b/sdkmanager/app/tests/com/android/sdkmanager/AvdManagerTest.java
@@ -24,6 +24,7 @@ import com.android.sdklib.SdkManager;
import com.android.sdklib.internal.avd.AvdManager;
import com.android.sdklib.internal.project.ProjectProperties;
import com.android.sdklib.mock.MockLog;
+import com.android.sdklib.SdkConstants;
import java.io.File;
import java.util.Map;
@@ -58,9 +59,9 @@ public class AvdManagerTest extends TestCase {
public void testCreateAvdWithoutSnapshot() {
mAvdManager.createAvd(
- mAvdFolder, this.getName(), mTarget, null, null, null, false, false, mLog);
-
- assertEquals("[P Created AVD '" + this.getName() + "' based on Android 0.0\n]",
+ mAvdFolder, this.getName(), mTarget, SdkConstants.ABI_ARMEABI,
+ null, null, null, false, false, mLog);
+ assertEquals("[P Created AVD '" + this.getName() + "' based on Android 0.0, ARM (armeabi) processor\n]",
mLog.toString());
assertTrue("Expected config.ini in " + mAvdFolder,
new File(mAvdFolder, "config.ini").exists());
@@ -78,9 +79,10 @@ public class AvdManagerTest extends TestCase {
public void testCreateAvdWithSnapshot() {
mAvdManager.createAvd(
- mAvdFolder, this.getName(), mTarget, null, null, null, false, true, mLog);
+ mAvdFolder, this.getName(), mTarget, SdkConstants.ABI_ARMEABI,
+ null, null, null, false, true, mLog);
- assertEquals("[P Created AVD '" + this.getName() + "' based on Android 0.0\n]",
+ assertEquals("[P Created AVD '" + this.getName() + "' based on Android 0.0, ARM (armeabi) processor\n]",
mLog.toString());
assertTrue("Expected snapshots.img in " + mAvdFolder,
new File(mAvdFolder, "snapshots.img").exists());
diff --git a/sdkmanager/app/tests/com/android/sdkmanager/MainTest.java b/sdkmanager/app/tests/com/android/sdkmanager/MainTest.java
index 29516e3..e4352ff 100644
--- a/sdkmanager/app/tests/com/android/sdkmanager/MainTest.java
+++ b/sdkmanager/app/tests/com/android/sdkmanager/MainTest.java
@@ -23,6 +23,7 @@ import com.android.sdklib.IAndroidTarget;
import com.android.sdklib.SdkManager;
import com.android.sdklib.internal.avd.AvdManager;
import com.android.sdklib.mock.MockLog;
+import com.android.sdklib.SdkConstants;
import java.io.File;
@@ -68,7 +69,8 @@ public class MainTest extends TestCase {
Main main = new Main();
main.setLogger(mLog);
mAvdManager.createAvd(
- mAvdFolder, this.getName(), mTarget, null, null, null, false, false, mLog);
+ mAvdFolder, this.getName(), mTarget, SdkConstants.ABI_ARMEABI,
+ null, null, null, false, false, mLog);
mLog.clear();
main.displayAvdList(mAvdManager);
assertEquals(
@@ -85,7 +87,8 @@ public class MainTest extends TestCase {
Main main = new Main();
main.setLogger(mLog);
mAvdManager.createAvd(
- mAvdFolder, this.getName(), mTarget, null, null, null, false, true, mLog);
+ mAvdFolder, this.getName(), mTarget, SdkConstants.ABI_ARMEABI,
+ null, null, null, false, true, mLog);
mLog.clear();
main.displayAvdList(mAvdManager);
assertEquals(