CodeCoverage: Remove releaseCoverageTool() function.
QLibraryPrivate::release() can be called multiple times and it is not appropriate to unregister and save the executed data for a library there. The library may still be used when it is released and it seems safer to save its data only once and probably when the application ends. Not calling __coveragescanner_unregister_library does not affect the coverage data. Calling __coveragescanner_register_library at load time without calling __coveragescanner_unregister_library means the plugin will stay loaded until the application ends. Removing the call to releaseCoverageTool() is so acceptable since the data will be saved when the application exits. Task-number: QTQAINFRA-416. Change-Id: I3135d2e203ecacfeff4a5b8ffdcd4d62fbc1db33 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
This commit is contained in:
parent
1d63b9beb9
commit
a8495549d0
@ -430,25 +430,6 @@ static void installCoverageTool(QLibraryPrivate *libPrivate)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void releaseCoverageTool(QLibraryPrivate *libPrivate)
|
|
||||||
{
|
|
||||||
#ifdef __COVERAGESCANNER__
|
|
||||||
/*
|
|
||||||
__COVERAGESCANNER__ is defined when Qt has been instrumented for code
|
|
||||||
coverage by TestCocoon.
|
|
||||||
Here is the code to save the execution data.
|
|
||||||
See comments about initialization in QLibraryPrivate::load().
|
|
||||||
*/
|
|
||||||
if (libPrivate->pHnd) {
|
|
||||||
__coveragescanner_save();
|
|
||||||
__coveragescanner_clear();
|
|
||||||
__coveragescanner_unregister_library(libPrivate->fileName.toLocal8Bit());
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
Q_UNUSED(libPrivate);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef QMap<QString, QLibraryPrivate*> LibraryMap;
|
typedef QMap<QString, QLibraryPrivate*> LibraryMap;
|
||||||
|
|
||||||
struct LibraryData {
|
struct LibraryData {
|
||||||
@ -545,8 +526,6 @@ bool QLibraryPrivate::unload()
|
|||||||
|
|
||||||
void QLibraryPrivate::release()
|
void QLibraryPrivate::release()
|
||||||
{
|
{
|
||||||
releaseCoverageTool(this);
|
|
||||||
|
|
||||||
QMutexLocker locker(qt_library_mutex());
|
QMutexLocker locker(qt_library_mutex());
|
||||||
if (!libraryRefCount.deref())
|
if (!libraryRefCount.deref())
|
||||||
delete this;
|
delete this;
|
||||||
|
Loading…
Reference in New Issue
Block a user