The Android Open Source Project | f805710 | 2009-03-15 16:47:16 -0700 | [diff] [blame] | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
| 2 | |
| 3 | <html> |
| 4 | <head> |
| 5 | <title>Dalvik VM Test Suite</title> |
| 6 | <link rel=stylesheet href="vm-tests.css"> |
| 7 | </head> |
| 8 | |
| 9 | <body> |
| 10 | <h1>Dalvik VM Test Suite</h1> |
| 11 | <p>Version 1.0</p> |
| 12 | <p>Copyright © 2008 The Android Open Source Project |
| 13 | |
| 14 | <h2>Overview</h2> |
| 15 | |
| 16 | <p> |
| 17 | This directory contains a test suite for the Dalvik VM. It tests the |
| 18 | capabilities of the Dalvik VM in a black-box manner, based on the Dalvik |
| 19 | bytecode and <code>.dex</code> file format specifications. The suite does |
| 20 | both functional and verifier tests. Regarding the latter, the Dalvik VM is |
| 21 | supposed to perform bytecode verification equivalent to that done in other |
| 22 | virtual machines. Please see |
| 23 | |
| 24 | <pre> |
| 25 | docs/dalvik/dalvik-bytecode.html |
| 26 | docs/dalvik/dalvik-constraints.html |
| 27 | docs/dalvik/dex-format.html |
| 28 | docs/dalvik/verifier.html |
| 29 | </pre> |
| 30 | |
| 31 | for further details. |
| 32 | </p> |
| 33 | |
| 34 | <h2>How to build</h2> |
| 35 | |
| 36 | <p> |
| 37 | The test suite is normally included in a full build of the Android |
| 38 | project. If it needs to be built individually, a simple |
| 39 | |
| 40 | <pre> |
| 41 | make vm-tests |
| 42 | </pre> |
| 43 | |
| 44 | or an |
| 45 | |
| 46 | <pre> |
| 47 | mm |
| 48 | </pre> |
| 49 | |
| 50 | in this directory will do. |
| 51 | </p> |
| 52 | |
| 53 | <h2>How to run</h2> |
| 54 | |
| 55 | <p> |
| 56 | The suite can be invoked by executing |
| 57 | |
| 58 | <pre> |
| 59 | vm-tests |
| 60 | </pre> |
| 61 | |
| 62 | from any location, assuming the suite has been built. This will run |
| 63 | all tests. If you want to limit the suite to the test cases |
| 64 | corresponding to a single instruction, you can specifiy the mnemonic |
| 65 | as a parameter. For example |
| 66 | |
| 67 | <pre> |
| 68 | vm-tests add-int/lit16 |
| 69 | </pre> |
| 70 | |
| 71 | executes the tests for the <code>add-int/lit16</code> instruction. |
| 72 | Please see the Dalvik VM specification for all the mnemonics. Two |
| 73 | additional parameters are possible that don't represent instructions. |
| 74 | These run integrity tests for the DEX file format and general |
| 75 | verifier tests, respectively: |
| 76 | |
| 77 | <pre> |
| 78 | vm-tests format |
| 79 | vm-tests verifier |
| 80 | </pre> |
| 81 | |
| 82 | The suite is normally run for the fast version of the interpreter. To run |
| 83 | it for the portable interpreter, pass <code>--portable</code> as the first |
| 84 | parameter. Passing <code>--help</code> results in a brief overview of the |
| 85 | options. |
| 86 | </p> |
| 87 | |
| 88 | <p> |
| 89 | The suite is compatible with both emulator and simulator |
| 90 | builds. For an emulator build, please make sure you have |
| 91 | either an emulator running or a device attached via USB before |
| 92 | invoking the test suite. |
| 93 | </p> |
| 94 | |
| 95 | <p> |
| 96 | The full suite might easily take 30 minutes or more for execution, |
| 97 | depending on the environment. It will generate an HTML |
| 98 | report with details on all test cases. While running, console output |
| 99 | is produced to give a quick impression of the progress and results. |
| 100 | For both types of output, each individual test result falls into one of |
| 101 | the following categories: |
| 102 | </p> |
| 103 | |
| 104 | <table> |
| 105 | <tr> |
| 106 | <th>Type in report</th><th>Type on console</th><th>Description</th> |
| 107 | </tr> |
| 108 | <tr> |
| 109 | <td>Success</td> |
| 110 | <td>.</td> |
| 111 | <td> |
| 112 | The test case passed successfully. |
| 113 | </td> |
| 114 | </tr> |
| 115 | <tr> |
| 116 | <td>Functional failure</td> |
| 117 | <td>F</td> |
| 118 | <td> |
| 119 | A functional (normal or boundary) or an exception test case |
| 120 | failed. |
| 121 | </td> |
| 122 | </tr> |
| 123 | <tr> |
| 124 | <td>Verifier failure</td> |
| 125 | <td>V</td> |
| 126 | <td> |
| 127 | A verifier test case failed. Either the verifier accepted |
| 128 | some invalid piece of code or it rejected a valid one. |
| 129 | </td> |
| 130 | </tr> |
| 131 | <tr> |
| 132 | <td>Console error</td> |
| 133 | <td>C</td> |
| 134 | <td> |
| 135 | The process running the VM returned error messages on the |
| 136 | standard output or error stream, but it is not clear what the |
| 137 | nature of the problem is. The test case is considered a failure, |
| 138 | though. This problem should only occur when running the suite on |
| 139 | a simulator build. |
| 140 | </td> |
| 141 | </tr> |
| 142 | </table> |
| 143 | </body> |
| 144 | </html> |