The idea behind this option is to ease bisecting using tools like 'llvmlab bisect'. With --only-test we can already narrow down the tests we want to run to one test, however we still produce a report.json and exit success no matter if the test passed or failed.
With --single-result, we only perform one test (it sets --only-test) but the exit status of LNT is determined by a predicate which allows it to be used directly with llvmlab exec / llvmlab bisect.
The predicate is set with --single-result-predicate, and is a python expression. It is evaluated in a context that contains 'status', a boolean representing the pass or fail status of the test, and all of the metrics exposed by LIT. Where metrics have different names in LIT and LNT parlance (for example 'exec' in LNT and 'exec_time' in LIT) both names are exposed. This has a sideeffect of working around a feature of Python - 'exec' is a keyword so cannot be used as a variable!
The default predicate is simply "status". This causes the exit status of LNT to correspond to the pass/fail status of the test - useful for conformance testing. Predicates such as "status and exec_time > 6.0" allow for simple performance bisections.
We've been using this feature internally for a week or so now and have found our bisections have become a lot easier. An example bisect command would be:
$ llvmlab bisect -b ARM-aarch32 --min-rev=261265 --max-rev=261369 \ lnt runtest test-suite \ --cc '%(path)s/bin/clang' \ --sandbox SANDBOX \ --test-suite /work/llvm-test-suite \ --use-lit lit \ --run-under 'taskset -c 5' \ --cflags '-O3 -mthumb -mcpu=cortex-a57' \ --single-result MultiSource/Benchmarks/TSVC/Expansion-flt/Expansion-flt.test \ --single-result-predicate 'exec_time > 8.0'
The help text doesn't indicate that this argument expects a fully-qualified test name.
Also, it seems like this argument changes test execution - so is it best placed in the "Test Execution" group, or here in the "Output Options" group?
All in all, the help text is a bit long. Maybe it would be better to shorten the help text here and write some more elaborate documentation with an example for this in one of the rst files under docs, so that how to use this becomes part of the LNT documentation?
Should the documentation for the bisecter (which I guess lives in zorg) be updated to have an example making use of these options?