mkopec1 | c460b37 | 2012-01-09 11:21:50 -0500 | [diff] [blame] | 1 | |
| 2 | Summary |
| 3 | ======= |
| 4 | This directory contains tests for Slang that use the 'llvm-lit' testing tool. |
| 5 | Each testcase is a separate .rs file, and comments inside the testcase are |
| 6 | used to verify certain strings are present in the output bitcode files. |
| 7 | |
| 8 | Prerequisites |
| 9 | ============= |
| 10 | To run the tests, you must have the android build environment variables |
| 11 | set (i.e. source build/envsetup.sh; lunch). You must also have on your path: |
| 12 | - Android version of llvm-lit (currently in libbcc/tests/debuginfo) |
| 13 | - FileCheck (utility from llvm) |
| 14 | - llvm-rs-cc (slang frontend compiler) |
| 15 | |
| 16 | If you are unable to run the tests, try using the "--debug" option to llvm-lit. |
| 17 | |
| 18 | When debugging failures, the "-v" option will print to stdout the details of |
| 19 | the failure. Note that tests marked as "Expected Fail" (XFAIL) will not print |
| 20 | failure information, even with -v. |
| 21 | |
| 22 | Customizing |
| 23 | =========== |
| 24 | The tools lit and FileCheck are fairly flexible, and could be used to validate |
| 25 | more than just emitted bitcode. For example, with some changes to the testcases |
| 26 | and the helper shell-script rs-filecheck-wrapper.sh, it should be possible to |
| 27 | write tests that verify the emitted Java code. |
| 28 | |
| 29 | Running |
| 30 | ======= |
| 31 | To execute all the tests from this directory, use the Android llvm-lit tool |
| 32 | from libbcc: |
| 33 | $ ../../libbcc/tests/debuginfo/llvm-lit . |
| 34 | |
| 35 | The tool can be run from any directory. |
| 36 | -j controls the number of parallel test executions |
| 37 | -v enables additional verbosity (useful when examining unexpected failures) |
| 38 | |
| 39 | Adding new tests |
| 40 | ================ |
| 41 | To add new tests, just add .rs files to a test directory with similar |
| 42 | RUN/CHECK directives in comments as the existing tests. |