1# Native Metric Tests 2 3As mentioned earlier, native metric tests are typically used for exercising HAL 4or interacting directly with lower level system services, and to leverage 5continuous testing service, native metric tests should be built with 6[google-benchmark](https://github.com/google/benchmark) framework. 7 8Here are some general instructions: 9 101. See sample native test module setup at: `bionic/benchmarks/bionic-benchmarks` 111. Test module makefile should use `BUILD_NATIVE_BENCHMARK` build rule so that 12google-benchmark dependencies are included automatically 131. Build the test module with make: 14 15 ```shell 16 make -j40 bionic-benchmarks 17 ``` 181. 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 231. 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