summaryrefslogtreecommitdiff
path: root/tools/bit/main.cpp
AgeCommit message (Collapse)Author
2019-10-23[bit] tests live in testcases directory now, not /dataJoe Onorato
Change-Id: I805ec5b6e239bc4044b7f058443639f806b577bd
2019-05-01Make am instrument capture logcat during test run, and return it to the host.Joe Onorato
Also makes bit print that logcat, if available, instead of just the stack trace. This means that when you run a test you don't also have to run logcat in some other window, and then scroll around forever looking for the one test in question. Test: bit -t GtsIncidentManagerTestCases:com.google.android.incident.gts.IncidentManagerTests\#testFail Test: bit -t GtsIncidentManagerTestCases:com.google.android.incident.gts.IncidentManagerTests\#testDoesntExist Bug: 129875642 Change-Id: I8940ff379c919482f4a545cb90d25bdbaa2b4f15
2019-03-25Fix bit crashJoe Onorato
Change-Id: Ie9314b3d52b9262ac6f964ab833bb36eefb4278f
2019-03-23Add bit --refresh which updates module-info.jsonJoe Onorato
Change-Id: Iacd760442fa45d1e23ce249d51c45f2313d6467c
2019-02-28Make bit able to run gtest native tests.Joe Onorato
The output parsing isn't ideal, so these are a bit more spammy than I'd like, but at least they build, install and run without the manual glop. Test: bit incidentd_test Change-Id: I3c34a4ebbf661f612b4b0f8b4e05cade8669b5a6
2019-01-26[bit] Use aapt2 instead of aapt, and don't also adb install apps on the ↵Joe Onorato
system partition Test: bit services Change-Id: I7d44ffbb2745b1a6265bbc77f24f885e5f1d3981
2019-01-26[bit] Cache the build variables so we don't have to run make to figure them ↵Joe Onorato
out unless the environment has changed. Test: bit GooglePermissionControllerTest:* Change-Id: Ie79226026477df22115ed1146875b82c2255bdef
2017-10-18Merge "Use soong_ui directly, instead of make" am: e994b4b584 am: 0531e5c647Dan Willemsen
am: 98fc198f1f Change-Id: Id17adee4b02cc499261f88c3faed15d889f5b6c3
2017-10-17Use soong_ui directly, instead of makeDan Willemsen
This will use ckati instead of make for dumping variables, for consistent makefile parsing. It may also sandbox executions, etc. Also skip the legacy make wrapper to build, and use soong_ui instead. The command line arguments are equivalent, but -j is no longer necessary, we'll default to a sane value. Test: bit -b framework Change-Id: Idc2c9d1abe84b6b783b8702925de5493d47a4509
2017-10-16Merge "Use -Werror in frameworks/base" am: 16fbd3a1d8 am: 0bfb717a37Chih-hung Hsieh
am: 9f004b1752 Change-Id: I6517ee1689b0247caf830a6c3528bfa9bcf91f75
2017-10-13Use -Werror in frameworks/baseChih-Hung Hsieh
* Fix unused variable and return value warnings. Bug: 66996870 Test: build with WITH_TIDY=1 Change-Id: I890e65a20848d00559ba5a4f9691be1347b456af
2017-08-02Bit: Don't ignore errors and crashesMakoto Onuki
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
2017-07-07Merge "Bit: support running all tests in a java package."TreeHugger Robot
2017-07-06Bit: support running all tests in a java package.Makoto Onuki
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
2017-07-06Have bit grant permissions to installed APKs.Jeff Sharkey
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
2016-12-13fix warning: Potential leak of memory pointed to by 'target'Yunlian Jiang
Bug: None Test: The warning is gone. Change-Id: I013fad1d53b37ae3d89846c70f0b10a67a9d04bb
2016-11-29Add an option to bit to not restart.Joe Onorato
Test: build & restart Change-Id: Ia925053f04046d7fb91a47cfd5fd17a5d4fecf10
2016-10-21Fix mac build of bitJoe Onorato
Test: make bit Change-Id: I8005e77babfbe2d48806f9315800e699d1917bb4
2016-10-20Add a new build, install, test development (bit) toolJoe Onorato
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