xref: /aosp_15_r20/frameworks/base/wifi/tests/README.md (revision d57664e9bc4670b3ecf6748a746a57c557b6bc9e)
1*d57664e9SAndroid Build Coastguard Worker# Wifi Non-Updatable Framework Unit Tests
2*d57664e9SAndroid Build Coastguard WorkerThis package contains unit tests for the non-updatable part (i.e. outside the Wifi module) of the
3*d57664e9SAndroid Build Coastguard WorkerAndroid Wifi framework APIs based on the
4*d57664e9SAndroid Build Coastguard Worker[Android Testing Support Library](http://developer.android.com/tools/testing-support-library/index.html).
5*d57664e9SAndroid Build Coastguard WorkerThe test cases are built using the [JUnit](http://junit.org/) and [Mockito](http://mockito.org/)
6*d57664e9SAndroid Build Coastguard Workerlibraries.
7*d57664e9SAndroid Build Coastguard Worker
8*d57664e9SAndroid Build Coastguard Worker## Running Tests
9*d57664e9SAndroid Build Coastguard WorkerThe easiest way to run tests is simply run
10*d57664e9SAndroid Build Coastguard Worker
11*d57664e9SAndroid Build Coastguard Worker```
12*d57664e9SAndroid Build Coastguard Workeratest android.net.wifi
13*d57664e9SAndroid Build Coastguard Worker```
14*d57664e9SAndroid Build Coastguard Worker
15*d57664e9SAndroid Build Coastguard WorkerTo pick up changes in framework/base, you will need to:
16*d57664e9SAndroid Build Coastguard Worker1. rebuild the framework library 'make -j32'
17*d57664e9SAndroid Build Coastguard Worker2. sync over the updated library to the device 'adb sync'
18*d57664e9SAndroid Build Coastguard Worker3. restart framework on the device 'adb shell stop' then 'adb shell start'
19*d57664e9SAndroid Build Coastguard Worker
20*d57664e9SAndroid Build Coastguard WorkerTo enable syncing data to the device for first time after clean reflash:
21*d57664e9SAndroid Build Coastguard Worker1. adb disable-verity
22*d57664e9SAndroid Build Coastguard Worker2. adb reboot
23*d57664e9SAndroid Build Coastguard Worker3. adb remount
24*d57664e9SAndroid Build Coastguard Worker
25*d57664e9SAndroid Build Coastguard Worker## Adding Tests
26*d57664e9SAndroid Build Coastguard WorkerTests can be added by adding classes to the src directory. JUnit4 style test cases can
27*d57664e9SAndroid Build Coastguard Workerbe written by simply annotating test methods with `org.junit.Test`.
28*d57664e9SAndroid Build Coastguard Worker
29*d57664e9SAndroid Build Coastguard Worker## Debugging Tests
30*d57664e9SAndroid Build Coastguard WorkerIf you are trying to debug why tests are not doing what you expected, you can add android log
31*d57664e9SAndroid Build Coastguard Workerstatements and use logcat to view them. The beginning and end of every tests is automatically logged
32*d57664e9SAndroid Build Coastguard Workerwith the tag `TestRunner`.
33