forked from qt-creator/qt-creator
ValgrindSettings: Introduce leakCheckOnFinishOptionString()
Change-Id: I0ddfc583b84536cdcdb49971bd7755ebaf36962c Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -185,20 +185,7 @@ void MemcheckToolRunner::addToolArguments(CommandLine &cmd) const
|
||||
if (m_settings.showReachable())
|
||||
cmd << "--show-reachable=yes";
|
||||
|
||||
QString leakCheckValue;
|
||||
switch (m_settings.leakCheckOnFinish()) {
|
||||
case ValgrindSettings::LeakCheckOnFinishNo:
|
||||
leakCheckValue = "no";
|
||||
break;
|
||||
case ValgrindSettings::LeakCheckOnFinishYes:
|
||||
leakCheckValue = "full";
|
||||
break;
|
||||
case ValgrindSettings::LeakCheckOnFinishSummaryOnly:
|
||||
default:
|
||||
leakCheckValue = "summary";
|
||||
break;
|
||||
}
|
||||
cmd << "--leak-check=" + leakCheckValue;
|
||||
cmd << "--leak-check=" + m_settings.leakCheckOnFinishOptionString();
|
||||
|
||||
for (const FilePath &file : m_settings.suppressions())
|
||||
cmd << QString("--suppressions=%1").arg(file.path());
|
||||
|
@@ -397,6 +397,17 @@ ValgrindSettings::ValgrindSettings(bool global)
|
||||
readSettings();
|
||||
}
|
||||
|
||||
QString ValgrindSettings::leakCheckOnFinishOptionString() const
|
||||
{
|
||||
switch (leakCheckOnFinish()) {
|
||||
case ValgrindSettings::LeakCheckOnFinishNo: return "no";
|
||||
case ValgrindSettings::LeakCheckOnFinishYes: return "full";
|
||||
case ValgrindSettings::LeakCheckOnFinishSummaryOnly:
|
||||
default: return "summary";
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
ValgrindSettings &globalSettings()
|
||||
{
|
||||
static ValgrindSettings theSettings{true};
|
||||
|
@@ -70,6 +70,7 @@ public:
|
||||
Utils::StringAspect memcheckArguments{this};
|
||||
Utils::IntegerAspect numCallers{this};
|
||||
Utils::SelectionAspect leakCheckOnFinish{this};
|
||||
QString leakCheckOnFinishOptionString() const;
|
||||
Utils::BoolAspect showReachable{this};
|
||||
Utils::BoolAspect trackOrigins{this};
|
||||
Utils::BoolAspect filterExternalIssues{this};
|
||||
|
Reference in New Issue
Block a user