Details
-
Bug
-
Resolution: Incomplete
-
Not Evaluated
-
None
-
5.1.1
-
None
Description
Summary
Add the option to load the testability library based on whether an environment variable is set, in addition to the current "-testability" flag.
Rationale
The Autopilot project currently uses the -testability flag when launching Qt apps to load the autopilot testability driver. This mostly works, but has a few problems:
- It relies on the application author passing char** argv to the QApplication constructor. This happens less often than you might think.
- We want to load the testability driver recursively. For example, if autopilot launches 'app_a' with -testability, and this application launches another Qt app, we want that to load with testability as well. Currently this requires that the 'app_a' author codes this behavior in.
- Some Ubuntu Touch applications are going to be launched by upstart jobs. This makes it harder to set, or remove the -testability command line option.
Proposed Solution
I propose we check an environment variable QT_LOAD_TESTABILITY. If it exists and is set to something other than an empty string, we should load the testability library.
Attached is a three line patch that, when applied to src/widgets/kernel/qapplication.cpp adds this functionality.
Attachments
For Gerrit Dashboard: QTBUG-32974 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
63026,6 | Add environment variable support for testability library use. | dev | qt/qtbase | Status: MERGED | +2 | 0 |