Native Metric Tests

As mentioned earlier, native metric tests are typically used for exercising HAL or interacting directly with lower level system services, and to leverage continuous testing service, native metric tests should be built with google-benchmark framework.

Here are some general instructions:

  1. See sample native test module setup at: bionic/benchmarks/bionic-benchmarks

  2. Test module makefile should use BUILD_NATIVE_BENCHMARK build rule so that google-benchmark dependencies are included automatically

  3. Build the test module with make:

    make -j40 bionic-benchmarks
    
  4. Automatic installation and run with the TradeFederation test harness:

    make tradefed-all -j
    tradefed.sh run template/local_min --template:map test=bionic-benchmarks
    
  5. Manually Install and Run:

    1. Push the generated test binary onto device:

      adb push ${OUT}/data/benchmarktest/bionic-benchmarks/bionic-benchmarks32 \
        /data/benchmarktest/bionic-benchmarks/bionic-benchmarks32
      
    2. Execute the test by invoking test binary on device:

      adb shell /data/benchmarktest/bionic-benchmarks/bionic-benchmarks32