Add test to ensure all future fragments implements logging.

The idea is: if a class is Fragment, it must also implements
Instrumentable.

To make the test possible, I added a structure to load all classes in
current classloader, and filter to only the ones we care about. Then
insepct each class definition using reflection.

Bug: 32952614
Test: make RunSettingsRoboTests
Change-Id: Ifa5e27c41d5ad0e84b6e9e9df81c96e8be2878c5
This commit is contained in:
Fan Zhang
2016-11-28 15:36:56 -08:00
parent 3d9fd0cd73
commit 8b8218c01b
5 changed files with 327 additions and 0 deletions

View File

@@ -17,6 +17,7 @@ package com.android.settings;
import android.app.Dialog;
import android.app.Fragment;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;