XPCShell unit tests are run by specifying them in a manifest file. You can add conditions to tests in order to control when tests get run. The conditions accept a simple boolean expression syntax, described here.
In order of decreasing precedence:
- == !=
Booleans: the literal strings
Integers: A series of contiguous digits. Only decimal integers are supported.
Strings: any series of characters enclosed in double quotes " or single quotes '. No escape sequences are supported.
Variables are supported as a series of letters, digits or underscores beginning with a letter or an underscore. There are a fixed set of variables provided by the test harness via mozinfo:
os- The operating system on which the test is being run
- One of: 'win', 'mac', 'linux', 'android'
toolkit- The graphics toolkit used by this build
- One of: 'windows', 'cocoa', 'gtk2', 'android'
processor- The CPU which the code is compiled for
- One of: 'x86', 'x86_64', 'arm'
bits- The pointer size of the CPU architecture, in bits
- One of 32, 64, possibly unknown
debug- Set to
trueif this build is a debug build,
crashreporter- Set to
trueif this build has crash reporting code enabled,