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
This takes the --test-class and --test-method options and builds a
--gtest_filter value to use when invoking native tests.
How it works:
ARGS to runtest ARG to GTEST
--test-class= --test-method= <none>
--test-class=Foo --test-method= --gtest_filter=Foo.*
--test-class= --test-method=Bar --gtest_filter=*.Bar
--test-class=Foo --test-method=Bar --gtest_filter=Foo.Bar
Advanced:
-m *Iptables* runs all test methods containing 'Iptables' in any class.
-c *ControllerTest runs all tests in any class ending with 'ControllerTest'.
Note that the '.' and '*' characters above are not shell globs. The '*'
are wildcards, and the '.' are literals.
Test: runtest -x system/netd/server/netd_unit_test.cpp -m '*Iptables*'
Test: runtest -x system/netd/server/netd_unit_test.cpp -c BandwidthControllerTest
Test: runtest -x system/netd/server/netd_unit_test.cpp -c BandwidthControllerTest -m '*Iptables*'
Change-Id: I967296da1bdcbc404f5ab91d24f9714eec7b475b
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
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
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
- No need to include cts/CtsBuild.mk, because that is included by the
core build system.
- Include the tradefed-prebuilt.jar on the classpath when running
host side tests.
- Update some of test_defs that have changed. Remove suites that
have been deleted.
Change-Id: Ie2845db7f209ad4ccb881d2ad47b9415c9f518a4
A recent change to runtest resulted in absolute paths incorrectly
being used for a tests build path. This broke the special logic
for frameworks/base tests, since it assumed relative build paths.
Change build paths back to relative paths.
Bug 5105885
Change-Id: I83a26be25294d501cca73eb1b88a7364131b2caf
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
Merge commit 'e98ed06e17e28a11609caf133a08b3ced21a049a'
* commit 'e98ed06e17e28a11609caf133a08b3ced21a049a':
Make runtest --path smarter when choosing path to build.
Merge commit 'd9380caf410ddf4b17a6e5035a89851bc58408f7' into gingerbread-plus-aosp
* commit 'd9380caf410ddf4b17a6e5035a89851bc58408f7':
Make runtest --path smarter when choosing path to build.
The command 'runtest --path <path to parent folder>'
is intended to find and build all tests contained within that parent folder.
However, the runtest logic was flawed in that it assumed building a parent
folder's Android.mk file would build all sub-directories.
This commit changes runtest to explictly look for the rule to build
sub-dir makefiles when creating the set of dirs to build.
Change-Id: Ia7f2172c1be79be8589be5f435fc4fb32569c994
Merge commit '8ddb2873df96c7181c9358f5c9286e273648bf89' into gingerbread-plus-aosp
* commit '8ddb2873df96c7181c9358f5c9286e273648bf89':
Change hosttestlib to use ddm-prebuilt.
* automatically detect if emma is on device
* build emma into libcore if necessary
* stop runtime before adb sync and restart afterwards
Change-Id: Id5087fdd6c0345f2b9b76658a5083b9260af061e
* automatically detect if emma is on device
* build emma into libcore if necessary
* stop runtime before adb sync and restart afterwards
Change-Id: I6f1beacdd266310c481351165a054dca8f8657b2
While reproducing b/2558977 I found that "runtest --path" did not work
for me because my ANDROID_BUILD_TOP contained a symlink. This is a
local fix to make FindTests use os.path.realpath instead of only half
using os.path.abspath when trying to make canonical paths to compare.
Change-Id: Ief353f52cb80b1798edc3c1233d1e082d9cebc26
Some test need to be run in a place where they can write on the disk.
I know we should stop using /sdcard but until I see the new document
explaining how the launcher can access the playground, we are going
to keep it that way.
This supports specifying a file system path to test(s) to run. The path can be
a java test class file, a java package directory, or a parent directory
containing many tests.
This change allows users to run tests independently from test_defs.xml.
BUG 2133198
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.