10 Commits

Author SHA1 Message Date
TreeHugger Robot
2c728430a7 Merge "fix warning: Potential leak of memory pointed to by 'target'" 2017-02-11 04:20:43 +00:00
Romain Guy
d973affed2 Compile bit on darwin, use -j when invoking make
Test: ran the host tool and checked the output
Change-Id: Idd561139348779982b8c01977fcc18fdfbd0134d
2017-01-11 18:34:57 -08:00
Yunlian Jiang
2cfa849e92 fix warning: Potential leak of memory pointed to by 'target'
Bug: None
Test: The warning is gone.
Change-Id: I013fad1d53b37ae3d89846c70f0b10a67a9d04bb
2016-12-13 23:22:57 +00:00
Joe Onorato
6592c3cc8f Add an option to bit to not restart.
Test: build & restart
Change-Id: Ia925053f04046d7fb91a47cfd5fd17a5d4fecf10
2016-11-29 17:36:36 -08:00
Joe Onorato
8e16c1d458 Merge "Another mac fix" 2016-10-21 22:32:34 +00:00
Joe Onorato
31617e3b8f Another mac fix
Test: make (on linux)
Change-Id: I3f0561f3a1fc08dad5d3dd8ba860da56b51d273c
2016-10-21 15:29:51 -07:00
Christopher Ferris
5066f9513b Merge "Fix mac build." 2016-10-21 22:23:02 +00:00
Joe Onorato
8a5bb6370c Fix mac build of bit
Test: make bit
Change-Id: I8005e77babfbe2d48806f9315800e699d1917bb4
2016-10-21 14:32:01 -07:00
Christopher Ferris
c1ef4b25a7 Fix mac build.
Do not build the bit tool on darwin.

Test: Make sure this still builds on linux.

Change-Id: Ie958649893016771f1fa3df6f10d443d0117c171
2016-10-21 12:56:35 -07:00
Joe Onorato
0578cbc6c5 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
2016-10-20 18:20:40 -07:00