• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1
2Summary
3=======
4This directory contains tests for Slang that use the 'llvm-lit' testing tool.
5Each testcase is a separate .rs file, and comments inside the testcase are
6used to verify certain strings are present in the output bitcode files.
7
8Prerequisites
9=============
10To run the tests, you must have the android build environment variables
11set (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
16If you are unable to run the tests, try using the "--debug" option to llvm-lit.
17
18When debugging failures, the "-v" option will print to stdout the details of
19the failure. Note that tests marked as "Expected Fail" (XFAIL) will not print
20failure information, even with -v.
21
22Customizing
23===========
24The tools lit and FileCheck are fairly flexible, and could be used to validate
25more than just emitted bitcode. For example, with some changes to the testcases
26and the helper shell-script rs-filecheck-wrapper.sh, it should be possible to
27write tests that verify the emitted Java code.
28
29Running
30=======
31To execute all the tests from this directory, use the Android llvm-lit tool
32from libbcc:
33$ ../../libbcc/tests/debuginfo/llvm-lit .
34
35The 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
39Adding new tests
40================
41To add new tests, just add .rs files to a test directory with similar
42RUN/CHECK directives in comments as the existing tests.
43