InstrumentationTestRunner是你用來編寫Android的單元測試。
從文檔:
Typical Usage
Write TestCases that perform unit, functional, or performance tests against the classes in your package.
Typically these are subclassed from:
ActivityInstrumentationTestCase2
ActivityUnitTestCase
AndroidTestCase
ApplicationTestCase
InstrumentationTestCase
ProviderTestCase
ServiceTestCase
SingleLaunchActivityTestCase
In an appropriate AndroidManifest.xml, define the this instrumentation with the appropriate android:targetPackage set.
Run the instrumentation using "adb shell am instrument -w", with no optional arguments, to run all tests (except performance tests).
Run the instrumentation using "adb shell am instrument -w", with the argument '-e func true' to run all functional tests. These are tests that derive from InstrumentationTestCase.
Run the instrumentation using "adb shell am instrument -w", with the argument '-e unit true' to run all unit tests. These are tests that do notderive from InstrumentationTestCase (and are not performance tests).
Run the instrumentation using "adb shell am instrument -w", with the argument '-e class' set to run an individual TestCase.
它應該是指向哪個包?活動在哪裏,或者申請是在哪裏?附:愛手柄。 –
通常活動的地方和應用程序的位置是相同的。在我的應用程序中,我也有相同的測試應用程序。我想它是想知道應用程序包,因爲至少它需要在查找活動之前訪問應用程序。 – Shellum
編譯...我們會看看是否是這種情況:) –