Vogar is a generic code/test/benchmark runner tool for Android. It is primarily used to run libcore and art tests and benchmarks, however this tool can also run arbitrary Java files either on host or target device.
Vogar supports multiple testing frameworks and configurations:
Allows running JUnit tests, TestNG tests, jtreg tests, Caliper benchmarks or executable Java classes. It supports running fine-grained tests that can be specified with hash symbol, e.g. “com.android.Test#test”.
Allows running tests and benchmarks using five available runtime modes: activity
, app_process
, device
, host
or jvm
.
First build it:
aosp/master-art
tree:export SOONG_ALLOW_MISSING_DEPENDENCIES=true ${ANDROID_BUILD_TOP}/art/tools/buildbot-build.sh --target
aosp/master
tree:m vogar
Vogar supports running tests and/or benchmarks (called “actions” below in the document) in five different modes (specified with --mode
option). An “action” is a .java
file, directory or class names:
Activity (--mode=activity
)
Vogar runs given action in the context of an android.app.Activity
on a device.
App (--mode=app_process
)
Vogar runs given action in an app_process runtime on a device or emulator. Used in conjunction with the --benchmark
option for running Caliper benchmarks. This is required to benchmark any code relying on the android framework.
Vogar --mode app_process --benchmark frameworks/base/core/tests/benchmarks/src/android/os/ParcelBenchmark.java
Device (--mode=device
)
Vogar runs given action in an ART runtime on a device or emulator.
Host (--mode=host
)
Vogar runs in an ART runtime on the local machine built with any lunch combo. Similar to “Device” mode but running local ART.
JVM (--mode=jvm
)
Vogar runs given action in a Java VM on the local machine.
Most frequently you will use either --mode=device
or --mode=host
mode.
Vogar has unit test coverage around basic functionality. Most of the coverage is for JUnit and TestNG integration.
First, build tests with:
m vogar-tests
Run all tests using phony make target with:
m run-vogar-tests
Or run manually (if you want to specify a subset of all unit tests, for example):
java -cp ${ANDROID_BUILD_TOP}/out/host/linux-x86/framework/vogar-tests.jar \ org.junit.runner.JUnitCore vogar.AllTests
High level model of each Vogar run is:
Task
objects that encapsulate various steps required. These Task
objects can depend on each other, and get executed only if all dependencies are already executed.The basic building block of Vogar execution is the Task
class. There are several sub classes of Task
, for example:
MkdirTask
RmTask
PrepareTarget
The Target
class encapsulates the runtime environment, for example a remote device or the local host. There are four available environments:
AdbTarget
is used when --mode=device
is set.
It makes sure device is connected, required directories are mount properly, and all required files are synced to the device.
AdbChrootTarget
is used when --mode=device --chroot=/data/chroot/
are set.
Same as AdbTarget
but relatively to a specified chroot directory (instead of the whole system under the root directory on the device).
LocalTarget
is used when --mode=host
or --mode=jvm
are set.
Same as AdbTarget
but runs on the host machine.
SshTarget
is used when --ssh <host:port>
is set.
Same as LocalTarget
but on a remote machine at the given address.
After parsing command line options, Vogar builds a list of tasks which are put in a TaskQueue
. They are executed using all available cores except when “Activity” mode is enabled -- in that case it is always one thread.
左眼皮上有痣代表什么hcv9jop2ns3r.cn | 什么时候种白菜liaochangning.com | 悠是什么意思hcv9jop4ns7r.cn | 王大治与董洁什么关系hcv7jop6ns5r.cn | suan是什么意思hcv9jop1ns4r.cn |
1964年是什么年hcv7jop6ns1r.cn | 辅警是什么编制hcv9jop7ns4r.cn | 柠檬酸钠是什么hcv8jop4ns9r.cn | 有什么可以快速止痒的方法hcv8jop1ns4r.cn | 男生属鸡和什么属相配hcv8jop2ns5r.cn |
急功近利什么意思hcv9jop5ns5r.cn | 飞机杯什么感觉hcv8jop1ns8r.cn | 字母圈是什么意思hcv8jop1ns6r.cn | 草字头一个辛读什么hcv8jop3ns2r.cn | 娃娃亲是什么hcv9jop1ns4r.cn |
阴道瘙痒用什么药hcv7jop6ns8r.cn | 可什么意思hcv8jop8ns0r.cn | ed病毒是什么youbangsi.com | 为什么会长智齿hcv8jop1ns0r.cn | 警察和公安有什么区别tiangongnft.com |