History log of /frameworks/base/tools/bit/main.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
6fb2c9718cde124f10edfbf45893b5a0cd537e11 02-Aug-2017 Makoto Onuki <omakoto@google.com> Bit: Don't ignore errors and crashes

Bit used to only see success results and failures (== assertion failures?),
and didn't see "errors" (other exceptions) and test process crashes.

Fixed it.

Now it also returns an error status code if there was a test failure.

Bug 64292779
Test: manual

Change-Id: Iaba93910d32abfc615ae595746a0e9be1108583a
/frameworks/base/tools/bit/main.cpp
41d8ef907af21f0001c458fb235d40a77e357e0b 08-Jul-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Bit: support running all tests in a java package."
164e7967b1f47586338805e2ebfdee02a5de85db 07-Jul-2017 Makoto Onuki <omakoto@google.com> Bit: support running all tests in a java package.

If a target name ends with a period, treat it as a package name
and run with "-e package" instead of "-e class".

Test: bit CtsProviderTestCases:android.provider.cts.contacts.

Change-Id: I3a9a0cbef76f57c46c41bf168b7e94eebecaf671
/frameworks/base/tools/bit/main.cpp
5f9dc424b35e4d3b03c5e7f261f421825410ea15 06-Jul-2017 Jeff Sharkey <jsharkey@android.com> Have bit grant permissions to installed APKs.

Otherwise unit tests fail spectacularly when they don't get the
runtime permissions that they expect.

Bug: 63391323
Test: bit FrameworksServicesTests:com.android.server.NetworkPolicyManagerServiceTest
Change-Id: I5307e0456865387ac14178268f543e2007b97096
/frameworks/base/tools/bit/main.cpp
2cfa849e9289474d82773335e6f54d751103a53a 07-Dec-2016 Yunlian Jiang <yunlian@google.com> fix warning: Potential leak of memory pointed to by 'target'

Bug: None
Test: The warning is gone.
Change-Id: I013fad1d53b37ae3d89846c70f0b10a67a9d04bb
/frameworks/base/tools/bit/main.cpp
6592c3cc8f37aae2058021b7971c33b94fc7ce5d 13-Nov-2016 Joe Onorato <joeo@google.com> Add an option to bit to not restart.

Test: build & restart
Change-Id: Ia925053f04046d7fb91a47cfd5fd17a5d4fecf10
/frameworks/base/tools/bit/main.cpp
8a5bb6370cd01990d2bb9f74dc4c777d68e95adc 21-Oct-2016 Joe Onorato <joeo@google.com> Fix mac build of bit

Test: make bit
Change-Id: I8005e77babfbe2d48806f9315800e699d1917bb4
/frameworks/base/tools/bit/main.cpp
0578cbc6c527bc09a38a0fcd8b9642c25c8ea023 20-Oct-2016 Joe Onorato <joeo@google.com> Add a new build, install, test development (bit) tool

This is a cleaned up version of a utility that I've had sitting around
for a while.

The bit tool can run an android platform build, then sync or install
the outputs of that, and then run instrumentation tests. It's better
than what we usually do:

make && adb shell stop && adb sync system && adb shell start

Here's the help text:

usage: bit OPTIONS PATTERN

Build, sync and test android code.

The -b -i and -t options allow you to specify which phases
you want to run. If none of those options are given, then
all phases are run. If any of these options are provided
then only the listed phases are run.

OPTIONS
-b Run a build
-i Install the targets
-t Run the tests

PATTERN
One or more targets to build, install and test. The target
names are the names that appear in the LOCAL_MODULE or
LOCAL_PACKAGE_NAME variables in Android.mk or Android.bp files.

Building and installing
-----------------------
The modules specified will be built and then installed. If the
files are on the system partition, they will be synced and the
attached device rebooted. If they are APKs that aren't on the
system partition they are installed with adb install.

For example:
bit framework
Builds framework.jar, syncs the system partition and reboots.

bit SystemUI
Builds SystemUI.apk, syncs the system partition and reboots.

bit CtsProtoTestCases
Builds this CTS apk, adb installs it, but does not run any
tests.

Running Unit Tests
------------------
To run a unit test, list the test class names and optionally the
test method after the module.

For example:
bit CtsProtoTestCases:*
Builds this CTS apk, adb installs it, and runs all the tests
contained in that apk.

bit framework CtsProtoTestCases:*
Builds the framework and the apk, syncs and reboots, then
adb installs CtsProtoTestCases.apk, and runs all tests
contained in that apk.

bit CtsProtoTestCases:.ProtoOutputStreamBoolTest
bit CtsProtoTestCases:android.util.proto.cts.ProtoOutputStreamBoolTest
Builds and installs CtsProtoTestCases.apk, and runs all the
tests in the ProtoOutputStreamBoolTest class.

bit CtsProtoTestCases:.ProtoOutputStreamBoolTest\#testWrite
Builds and installs CtsProtoTestCases.apk, and runs the testWrite
test method on that class.

bit CtsProtoTestCases:.ProtoOutputStreamBoolTest\#testWrite,.ProtoOutputStreamBoolTest\#testRepeated
Builds and installs CtsProtoTestCases.apk, and runs the testWrite
and testRepeated test methods on that class.

Launching an Activity
---------------------
To launch an activity, specify the activity class name after
the module name.

For example:
bit StatusBarTest:NotificationBuilderTest
bit StatusBarTest:.NotificationBuilderTest
bit StatusBarTest:com.android.statusbartest.NotificationBuilderTest
Builds and installs StatusBarTest.apk, launches the
com.android.statusbartest/.NotificationBuilderTest activity.

Change-Id: I9cff7a23852fa1a67369e7807f7ae9f6e45d6131
Test: none
/frameworks/base/tools/bit/main.cpp