OSDN Git Service
Remove TestRunner.success field / Make postCompileTest return void
SUMMARY:
- Change TestRunner subclasses to instead implement a Runner interface
- Cleanup runtime classpath generation
- Misc improvements
DETAILS:
Change TestRunner subclasses to instead implement a Runner interface
*Runner classes now implement the new Runner interface instead of
extending TestRunner. prepareTest/test now take a "Class
testClass" instead of accessing a "String testClass" from the
superclass. This also means that all their "static void main"
methods are removed and replaced with a single main method in
TestRunner. TestActivity can now instantiate a TestRunner and call
its "boolean run()" method to execute tests and retrieve their
SUCCESS/FAILURE status via the return value, allowing the removeal
of TestRunner.success. Mode now needs to explicitly include
TestRunner.java in the list of code to compile because it no
longer is implicitly found by compiling its former subclasses.
java/dalvik/runner/TestRunner.java
java/dalvik/runner/Runner.java
java/dalvik/runner/CaliperRunner.java
java/dalvik/runner/JUnitRunner.java
java/dalvik/runner/JtregRunner.java
java/dalvik/runner/MainRunner.java
java/dalvik/runner/Mode.java
CodeFinder.getRunnerClass now returns a Runner, not a TestRunner
java/dalvik/runner/CodeFinder.java
java/dalvik/runner/JUnitFinder.java
java/dalvik/runner/CaliperFinder.java
java/dalvik/runner/JtregFinder.java
java/dalvik/runner/MainFinder.java
Similarly, TestRun.runnerClass is now a Runner, not a TestRunner
java/dalvik/runner/TestRun.java
Move logic to run a test based on TestProperties.RUNNER_CLASS from
TestActivity to TestRunner since its now used in all cases, not
just the Activity case. TestActivity.ActivityRunner remains the
one subclass of TestRunner, accessing the TestRunner.run(...)
logic via super.run(...), allowing it to maintain its special
result file writing logic.
java/dalvik/runner/TestActivity.java
java/dalvik/runner/TestRunner.java
Moved writing of TestProperties.RUNNER_CLASS from ActivityMode now
that it is used for all Modes.
java/dalvik/runner/ActivityMode.java
java/dalvik/runner/Mode.java
Since CaliperRunner now has a "Class testClass", it uses the more
strongly typed Runner.main(Class<? extends Benchmark>, ...) API.
java/dalvik/runner/CaliperRunner.java
Fixing javadoc TestRunner->Runner
java/dalvik/runner/TestProperties.java
Adding new Runner class to the build.
Android.mk
Cleanup runtime classpath generation
Changed Mode.postCompileTest to return void instead of Classpath
to match Most.postCompileTestRunner. Removed passing test
classpath from compile to run via TestRun.testClasspath. Instead,
Vm.getRuntimeSupportClasspath now is used to compute full
classpath, instead of using the old TestRun.getTestClasspath in
Mode. Mode.compileTest now uses a boolean to indicate compilation
success, instead of null/non-null Classpath. TestRun.testClasspath
is now replaced with TestRun.testCompiled which is used to track
compilation success. In retrospect, it seems like using the
absense of a Classpath as an indication of compilation
success/failure seems like somewhat of a hack.
java/dalvik/runner/Mode.java
java/dalvik/runner/ActivityMode.java
java/dalvik/runner/DeviceDalvikVm.java
java/dalvik/runner/JavaVm.java
java/dalvik/runner/TestRun.java
New deviceDexFile to make sure dex file name generation stays
consistent between build time and compile time.
java/dalvik/runner/DeviceDalvikVm.java
Changed MainRunner implementation to more closely match JtregRunner
java/dalvik/runner/MainRunner.java
Misc improvements
Changed TestActivity to use a shutdown hook to catch when a test
calls System.exit so we can be sure to write a result file and not
simply wait for the timeout to catch our failure to return.
java/dalvik/runner/TestActivity.java
Changed Mkdir.mkdirs to use new Command().execute to get automatic
logging of command execution with --verbose
java/dalvik/runner/Mkdir.java
Improved javadoc
java/dalvik/runner/Mode.java
Fixed apparently misplaced @SuppressWarnings("unchecked")
java/dalvik/runner/OptionParser.java
Enabling warnings as errors and turning on unchecked warnings.
Android.mk
Made sure test script works with fresh device and improved logging
test-dalvik-runner.sh
24 files changed: