A partire dal 27 marzo 2025, ti consigliamo di utilizzare android-latest-release
anziché aosp-main
per compilare e contribuire ad AOSP. Per ulteriori informazioni, vedi Modifiche ad AOSP.
Test delle metriche
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
I test delle metriche vengono in genere utilizzati per testare i livelli di astrazione hardware (HAL) o per interagire direttamente con i servizi di sistema di livello inferiore. Per usufruire del servizio di test continuo, i test delle metriche devono essere creati con il framework google-benchmark.
Esempio
Per una configurazione di esempio del modulo di test delle metriche, consulta:
bionic/benchmarks/bionic-benchmarks
Riepilogo della procedura
- Il file di configurazione del modulo di test deve utilizzare la regola di compilazione
BUILD_NATIVE_BENCHMARK
in modo che le dipendenze di google-benchmark vengano incluse automaticamente.
Compila il modulo di test con make:
make -j40 bionic-benchmarks
Installazione ed esecuzione automatiche con il test harness Trade Federation:
make tradefed-all -j
tradefed.sh run template/local_min --template:map test=bionic-benchmarks
Installa ed esegui manualmente nel seguente modo:
Invia il file binario di test generato sul dispositivo:
adb push ${OUT}/data/benchmarktest/bionic-benchmarks/bionic-benchmarks32 \
/data/benchmarktest/bionic-benchmarks/bionic-benchmarks32
Esegui il test richiamando il file binario di test sul dispositivo:
adb shell /data/benchmarktest/bionic-benchmarks/bionic-benchmarks32
I campioni di contenuti e codice in questa pagina sono soggetti alle licenze descritte nella Licenza per i contenuti. Java e OpenJDK sono marchi o marchi registrati di Oracle e/o delle sue società consociate.
Ultimo aggiornamento 2025-07-27 UTC.
[null,null,["Ultimo aggiornamento 2025-07-27 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"]]