1 # Native Metric Tests 2 3 As mentioned earlier, native metric tests are typically used for exercising HAL 4 or interacting directly with lower level system services, and to leverage 5 continuous testing service, native metric tests should be built with 6 [google-benchmark](https://github.com/google/benchmark) framework. 7 8 Here are some general instructions: 9 10 1. See sample native test module setup at: `bionic/benchmarks/bionic-benchmarks` 11 1. Test module makefile should use `BUILD_NATIVE_BENCHMARK` build rule so that 12 google-benchmark dependencies are included automatically 13 1. Build the test module with make: 14 15 ```shell 16 make -j40 bionic-benchmarks 17 ``` 18 1. Automatic installation and run with the TradeFederation test harness: 19 20 ``` 21 make tradefed-all -j 22 tradefed.sh run template/local_min --template:map test=bionic-benchmarks 23 1. Manually Install and Run: 24 1. Push the generated test binary onto device: 25 26 ```shell 27 adb push ${OUT}/data/benchmarktest/bionic-benchmarks/bionic-benchmarks32 \ 28 /data/benchmarktest/bionic-benchmarks/bionic-benchmarks32 29 ``` 30 1. Execute the test by invoking test binary on device: 31 32 ```shell 33 adb shell /data/benchmarktest/bionic-benchmarks/bionic-benchmarks32 34 ``` 35