2025 年 3 月 27 日より、AOSP のビルドとコントリビューションには aosp-main
ではなく android-latest-release
を使用することをおすすめします。詳細については、AOSP の変更をご覧ください。
指標テスト
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
一般的に、指標テストは、Hardware Abstraction Layer(HAL)の実行や、低レベルのシステム サービスとの直接のやり取りに使用されます。継続的なテストサービスを活用するには、指標テストを google-benchmark フレームワークで構築する必要があります。
例
指標テスト モジュールの設定例については、bionic/benchmarks/bionic-benchmarks をご覧ください。
ステップの概要
- テスト モジュール構成ファイルでは、
BUILD_NATIVE_BENCHMARK
ビルドルールを使用して、google-benchmark の依存関係が自動的に含まれるようにします。
テスト モジュールを make でビルドします。
make -j40 bionic-benchmarks
Trade Federation テストハーネスを使用して自動インストールと実行を行います。
make tradefed-all -j
tradefed.sh run template/local_min --template:map test=bionic-benchmarks
次のように手動でインストールして実行します。
生成されたテストバイナリをデバイスにプッシュします。
adb push ${OUT}/data/benchmarktest/bionic-benchmarks/bionic-benchmarks32 \
/data/benchmarktest/bionic-benchmarks/bionic-benchmarks32
デバイスでテストバイナリを起動してテストを実行します。
adb shell /data/benchmarktest/bionic-benchmarks/bionic-benchmarks32
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-03-26 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-03-26 UTC。"],[],[],null,["# Metric tests are typically used for exercising hardware abstraction\nlayers (HALs) or interacting directly with lower-level system services. To\nleverage continuous testing service, metric tests should be built with\nthe [google-benchmark](https://github.com/google/benchmark)\nframework.\n\nExample\n-------\n\nSee a sample metric test module setup at:\n[bionic/benchmarks/bionic-benchmarks](https://android.googlesource.com/platform/bionic/+/android16-release/benchmarks/bionic_benchmarks.cpp)\n\nSummary of steps\n----------------\n\n1. Test module configuration file should use the `BUILD_NATIVE_BENCHMARK` build rule so that google-benchmark dependencies are included automatically.\n2. Build the test module with make:\n\n make -j40 bionic-benchmarks\n\n3. Automatic installation and run with the Trade Federation test harness:\n\n make tradefed-all -j\n tradefed.sh run template/local_min --template:map test=bionic-benchmarks\n\n4. Manually install and run like so:\n\n 1. Push the generated test binary onto device:\n\n adb push ${OUT}/data/benchmarktest/bionic-benchmarks/bionic-benchmarks32 \\\n /data/benchmarktest/bionic-benchmarks/bionic-benchmarks32\n\n 2. Execute the test by invoking test binary on device:\n\n adb shell /data/benchmarktest/bionic-benchmarks/bionic-benchmarks32"]]