diff options
author | Brett Chabot <brettchabot@android.com> | 2010-04-23 16:22:09 -0700 |
---|---|---|
committer | Brett Chabot <brettchabot@android.com> | 2010-04-23 16:29:00 -0700 |
commit | bb469fe3da7e6d17e851a95026a9eea905c52daa (patch) | |
tree | fea7c329f41977fabc3dc75c9122ce680a1aecb9 /test-runner/src/android/test | |
parent | a2c980d30f41e6d5aff948e7b249d7c3360db89d (diff) | |
download | frameworks_base-bb469fe3da7e6d17e851a95026a9eea905c52daa.zip frameworks_base-bb469fe3da7e6d17e851a95026a9eea905c52daa.tar.gz frameworks_base-bb469fe3da7e6d17e851a95026a9eea905c52daa.tar.bz2 |
Add test runner log when test case class is not loaded.
The test runner will only load TestCase classes that have a public
constructor with either no params or a single String parameter.
This is fairly subtle behavior and can be difficult to catch. This change
adds a log message when a TestCase class is not loaded, and adds some
associated unit tests.
Change-Id: I6fc63e4179c949620f5773e0ae134f99905a6fb2
Diffstat (limited to 'test-runner/src/android/test')
-rw-r--r-- | test-runner/src/android/test/suitebuilder/TestGrouping.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test-runner/src/android/test/suitebuilder/TestGrouping.java b/test-runner/src/android/test/suitebuilder/TestGrouping.java index df6da70..a2b94ff 100644 --- a/test-runner/src/android/test/suitebuilder/TestGrouping.java +++ b/test-runner/src/android/test/suitebuilder/TestGrouping.java @@ -46,6 +46,8 @@ import java.util.TreeSet; */ public class TestGrouping { + private static final String LOG_TAG = "TestGrouping"; + SortedSet<Class<? extends TestCase>> testCaseClasses; public static final Comparator<Class<? extends TestCase>> SORT_BY_SIMPLE_NAME @@ -114,7 +116,7 @@ public class TestGrouping { for (String packageName : packageNames) { List<Class<? extends TestCase>> addedClasses = testCaseClassesInPackage(packageName); if (addedClasses.isEmpty()) { - Log.w("TestGrouping", "Invalid Package: '" + packageName + Log.w(LOG_TAG, "Invalid Package: '" + packageName + "' could not be found or has no tests"); } testCaseClasses.addAll(addedClasses); @@ -234,6 +236,10 @@ public class TestGrouping { } } } + Log.i(LOG_TAG, String.format( + "TestCase class %s is missing a public constructor with no parameters " + + "or a single String parameter - skipping", + aClass.getName())); return false; } } |