Note that there are some explanatory texts on larger screens.

plurals
  1. POIs it possible to run a single Android CTS test case from Eclipse?
    primarykey
    data
    text
    <p>I am currently dealing with some CTS issues for our own device. It comes to my mind that if we can run a single CTS test case just from Eclipse, that would be very helpful for debugging the CTS issues. For example, I have create an Android test project, with the manifest file:</p> <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="android.content.pm.cts" android:versionCode="1" android:versionName="1.0" &gt; &lt;uses-sdk android:minSdkVersion="15" /&gt; &lt;instrumentation android:name="android.test.InstrumentationTestRunner" android:targetPackage="android.content.pm" /&gt; &lt;application android:icon="@drawable/ic_launcher" android:label="@string/app_name" &gt; &lt;uses-library android:name="android.test.runner" /&gt; &lt;/application&gt; &lt;/manifest&gt; </code></pre> <p>And the source code:</p> <pre><code> package android.content.pm.cts; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.content.pm.ResolveInfo.DisplayNameComparator; import android.test.AndroidTestCase; public class ResolveInfo_DisplayNameComparatorTest extends AndroidTestCase { private static final String MAIN_ACTION_NAME = "android.intent.action.MAIN"; private static final String SERVICE_NAME = "android.content.pm.cts.activity.PMTEST_SERVICE"; public void testDisplayNameComparator() { PackageManager pm = getContext().getPackageManager(); DisplayNameComparator dnc = new DisplayNameComparator(pm); Intent intent = new Intent(MAIN_ACTION_NAME); ResolveInfo activityInfo = pm.resolveActivity(intent, 0); intent = new Intent(SERVICE_NAME); ResolveInfo serviceInfo = pm.resolveService(intent, PackageManager.GET_RESOLVED_FILTER); assertTrue(dnc.compare(activityInfo, serviceInfo) &lt; 0); assertTrue(dnc.compare(activityInfo, activityInfo) == 0); assertTrue(dnc.compare(serviceInfo, activityInfo) &gt; 0); } } </code></pre> <p>When I right click on the project and select "run as android junit test" it just report: Test run failed: Unable to find instrumentation target package: android.content.pm</p> <p>I know that I might be totally wrong from the beginning. So could anyone please point out a correct way out for me? Thanks a lot!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload