Commit Graph

22 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
6686257924 Add --no-hidden-api-checks to runtest
New test tools are adding --no-hidden-api-checks when tests have
hidden-api-checks=false in their AndroidTest.xml, however this is not
supported by runtest. As only runtest is available in AOSP, this leaves
no option to make tests of internal classes pass.

Add an option to disable the check in runtest so we can still run tests in
AOSP.

Test: runtest frameworks-net still fails
Test: runtest --no-hidden-api-checks frameworks-net now passes
Change-Id: I9be9674d0bf2588ff509121273379f08d4cb3aea
2018-06-06 10:49:08 +09:00
Xiaohui Chen
85586e0e03 runtest: introduce --user parameter
Currently runtest script installs and then runs test apks with default
"adb install" and "adb shell am instrument" behavior.  They are actually
different,  "adb install" uses USER_ALL, "am instrument" uses
USER_CURRENT.  This cl introduces a way to specify exactly which user a
test should run with in a multiple user environment.  This also provides
a work around for b/22976637 for now.

Bug: 19913735
Bug: 22976637
Change-Id: I65e2b2c79768734a8bc9261f8c4693c9f89016b1
2015-08-24 22:11:59 -07:00
Santos Cordon
4e0ad8f810 Add flag to grant permissions when running tests.
This change automatically adds -g to all adb install commands
for runtest. It also allows users to:
1) Specify '-k' as a command line arg to avoid granting permissions.
2) Declare a test suite as 'requiring permissions' within test_defs

Also fixes a potential bug where continuous="false" would translate
to True in the python code.

Bug: 21327566
Change-Id: I62d14e8106174861397b3fd8caa3e567e3538713
2015-05-21 15:46:59 -07:00
Marco Nelissen
1afdaba4e4 Increase install time timeout
The media CTS test apk is quite large, causing installation to often
take (much) longer than the 20 second timeout that runtest uses.
Increasing it to 60 seconds fixes the issue.

Change-Id: I43cc1e094a29f8b1bd18e8f27ff53e183664f2bb
2014-12-03 11:27:55 -08:00
Igor Murashkin
a0afc8cfb2 runtest: Update to work with emulator and to build dependencies
* Combine dalvik.vm.dexopt-flags with existing to disable verification
* Always do a runtime reset (stop;start) instead of rebooting device
* Build dependencies (mma) if regular build fails (mm)

Change-Id: I5e9fcebeea052c3314d1f4146b074637c329c0a0
2014-01-24 16:03:06 -08:00
Brett Chabot
616e8f960d Make runtest handle inner instrumentation class names.
Bug 7311518

Change-Id: I7c02991445a9fdd2341f54cfd49169fc4e492536
2012-10-26 16:47:09 -07:00
Brett Chabot
81c475e4ac Fix log syntax.
And add better error message when instrumentation test is not
present.

Change-Id: I381421e59a3b667a5c3090ccd49e38fe99d680c5
2012-09-13 09:47:25 -07:00
Brett Chabot
7454171f17 Coverage and unbundling changes for runtest.
Stop using 'adb sync' in runtest. It was unreliable even when working
with full platform builds, and doesn't work at all for unbundled apps.
Instead, use output from build command to find produced artifacts and
use 'adb install' where possible.
However, note that this approach won't sync previously built artifacts
to device.

Also adjust to build system support for code coverage. Its no longer
required to build libcore to get code coverage.

Change-Id: I9c5d37897c9570d2d29db3ec82f5c53e60a8f485
2012-08-31 18:55:15 -07:00
Brett Chabot
bb5918ed81 Add gtest target support for runtest --path.
This is a rough initial version. It makes several assumptions:
 - assumes each test source file is built into module with name equal
to basename of source file
 - assumes tests get installed into /data/nativetest

However, given those assumptions, both:
$ runtest --path <path to directory containing gtest source> and
$ runtest --path <path to single source file>
should work.

Coming soon: gtest host support

Bugs 4563370, 4584339

Change-Id: Ia42aeed7f9ee6402b0ceb7b5ccaaa66ac636fe49
2011-07-10 13:26:41 -07:00
Brett Chabot
cdfaae1a34 Make runtest reboot and root more robust.
Add a couple sleep statements to allow time for device to go offline.

Change-Id: I3a5fffc948f6c7b67bcdec4526990a6becd2d02f
2011-06-07 10:16:02 -07:00
Brett Chabot
b45644eac0 Replace use of ro.monkey with ro.test_harness.
Bug 3329873

Change-Id: Ia681803c3d0b0afeceb178b8314c9d7227d99355
2011-01-09 14:11:50 -08:00
Jean-Baptiste Queru
4ceead6ba0 am e73f0dfc: Merge "Added adb_interface.WaitForProcess and WaitForProcessEnd."
Merge commit 'e73f0dfc64a55dcdcac92a2cab93de677042fb07' into gingerbread-plus-aosp

* commit 'e73f0dfc64a55dcdcac92a2cab93de677042fb07':
  Added adb_interface.WaitForProcess and WaitForProcessEnd.
2010-10-08 13:52:24 -07:00
Ot ten Thije
9290dd9c7d Added adb_interface.WaitForProcess and WaitForProcessEnd.
Relies mostly on common code factored out of WaitForDevicePm and
WaitForDeviceInstrumentation.
2010-08-20 11:18:58 +01:00
Brett Chabot
ccae47d0c0 Workaround for package-private framework tests in runtest.
Checks if the test to run is a framework test based on path, and if so
disables the davlik verifier by writing to /data/local.prop and
rebooting device.

Change-Id: Ibf94fb921662b5ddf6136dd12360d5de83a3a284
2010-06-14 15:24:42 -07:00
Guang Zhu
863870c168 code coverage improvement (DO NOT MERGE)
* automatically detect if emma is on device
* build emma into libcore if necessary
* stop runtime before adb sync and restart afterwards

Change-Id: Id5087fdd6c0345f2b9b76658a5083b9260af061e
2010-05-18 10:54:47 -07:00
Brett Chabot
e0bf8162f0 testrunner: Allow spaces in instrumentation arguments and remove check for test
app presence.
2009-06-29 13:55:30 -07:00
Brett Chabot
764d3fa70d Add support for running host java tests to runtest.
With this change, also refactored runtest as follows: Modified the
test suite schema and python implementation to have an inheritance
structure.  Each test type has its own python module, which will
also handle the logic of running the test.
2009-06-26 14:31:52 -07:00
Brett Chabot
97d5c50730 Make runtest wait for instrumentation install before running test.
This attempts to address bug 1872940 where runtest will attempt to
run the test before all the new packages pushed via adb sync are
actually installed. This won't completely fix the bug in all cases,
but hopefully will help most situations.
2009-06-04 18:22:57 -07:00
Brett Chabot
ae68f1a865 Add support for parsing code coverage file path to runtest and related cleanup.
This change is to adapt runtest to the InstrumentationTestRunner change which
dumps coverage data to the app's local data folder, instead of a fixed file on
the sdcard.

Also fixed adb_interace.StartInstrumentationForPackage, added better handling
when generating coverage for tests with unknown coverage targets, and reduced
the duplicate definitions of the "coverage_targets.xml" definition file.
2009-05-29 13:35:13 -07:00
Brett Chabot
8a101cb057 runtest.py bug fixes.
Improved error handling, and added support for "size" and "package" arguments.
Removed deprecated runtest shell script.
2009-05-05 13:06:00 -07:00
Brett Chabot
72731f3420 AI 143688: am: CL 143562 Usability fixes for runtest.py
Original author: brettchabot
  Merged from: //branches/cupcake/...

Automated import of CL 143688
2009-03-31 11:14:05 -07:00
The Android Open Source Project
2b83cbdb14 auto import from //depot/cupcake/@136654 2009-03-05 17:04:45 -08:00