CodeCoverage: Handle QTest based subtests.
authorCaroline Chao <caroline.chao@nokia.com>
Thu, 2 Feb 2012 09:12:21 +0000 (10:12 +0100)
committerQt by Nokia <qt-info@nokia.com>
Sun, 12 Feb 2012 22:25:19 +0000 (23:25 +0100)
commita6d3983ef6b7affef1d2aa48ed8bf8000a6e4267
tree1122d85d2bfed7e2665b500b0e41871bfdeb79d2
parent3aacbc1e2bea0855f5a405be0e1577320af784f7
CodeCoverage: Handle QTest based subtests.

Set QT_TESTCOCOON_ACTIVE environment variable when the coverage is installed
for a test and unset it when the coverage data is saved. Tests that run when
QT_TESTCOCOON_ACTIVE is set are subtests and will not be considered as
stand-alone tests for the coverage.

When a test is run as a subtest its coverage data will not be saved for
itself but for the main test it is merged with. Also its status will not be
reported since only the status of the main test is expected in the test report,
e.g. the test tests/auto/testlib/selftests.

Change-Id: Icfdf99300aae18040e1a3441a8af21f68df4c0db
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
src/testlib/qtestcase.cpp
src/testlib/qtestlog.cpp
src/testlib/qtestlog_p.h
tests/auto/testlib/selftests/tst_selftests.cpp