از 27 مارس 2025، توصیه می کنیم از android-latest-release
به جای aosp-main
برای ساختن و کمک به AOSP استفاده کنید. برای اطلاعات بیشتر، به تغییرات AOSP مراجعه کنید.
تست های متریک
با مجموعهها، منظم بمانید ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
تستهای متریک معمولاً برای اعمال لایههای انتزاعی سختافزاری (HAL) یا تعامل مستقیم با سرویسهای سطح پایینتر سیستم استفاده میشوند. برای استفاده از سرویس آزمایش مداوم، تستهای متریک باید با چارچوب google-benchmark ساخته شوند.
مثال
نمونه راه اندازی ماژول تست متریک را در: bionic/benchmarks/bionic-benchmarks ببینید
خلاصه مراحل
- فایل پیکربندی ماژول آزمایشی باید از قانون ساخت
BUILD_NATIVE_BENCHMARK
استفاده کند تا وابستگیهای google-benchmark به طور خودکار گنجانده شوند. ساخت ماژول تست با make:
make -j40 bionic-benchmarks
نصب خودکار و اجرا با مهار تست فدراسیون تجارت:
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
محتوا و نمونه کدها در این صفحه مشمول پروانههای توصیفشده در پروانه محتوا هستند. جاوا و OpenJDK علامتهای تجاری یا علامتهای تجاری ثبتشده Oracle و/یا وابستههای آن هستند.
تاریخ آخرین بهروزرسانی 2025-07-29 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","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-07-29 بهوقت ساعت هماهنگ جهانی."],[],[],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"]]