This commit is contained in:
orbitcowboy 2020-02-02 16:37:05 +01:00
commit cef06741e5
3 changed files with 19 additions and 21 deletions

View File

@ -251,7 +251,8 @@ const char * CppCheck::extraVersion()
unsigned int CppCheck::check(const std::string &path)
{
if (mSettings.clang) {
mErrorLogger.reportOut(std::string("Checking ") + path + "...");
if (!mSettings.quiet)
mErrorLogger.reportOut(std::string("Checking ") + path + "...");
const std::string clang = Path::isCPP(path) ? "clang++" : "clang";
const std::string temp = mSettings.buildDir + (Path::isCPP(path) ? "/__temp__.cpp" : "/__temp__.c");
@ -364,8 +365,10 @@ unsigned int CppCheck::check(const ImportProject::FileSettings &fs)
temp.mSettings.userUndefs = fs.undefs;
if (fs.platformType != Settings::Unspecified)
temp.mSettings.platform(fs.platformType);
if (mSettings.clang)
if (mSettings.clang) {
temp.mSettings.includePaths.insert(temp.mSettings.includePaths.end(), fs.systemIncludePaths.cbegin(), fs.systemIncludePaths.cend());
temp.check(Path::simplifyPath(fs.filename));
}
std::ifstream fin(fs.filename);
return temp.checkFile(Path::simplifyPath(fs.filename), fs.cfg, fin);
}

View File

@ -255,9 +255,10 @@ void ImportProject::FileSettings::parseCommand(const std::string &command)
defs += ';';
} else if (F=='U')
undefs.insert(fval);
else if (F=='I')
includePaths.push_back(fval);
else if (F=='s' && fval.compare(0,2,"td") == 0) {
else if (F=='I') {
if (std::find(includePaths.begin(), includePaths.end(), fval) == includePaths.end())
includePaths.push_back(fval);
} else if (F=='s' && fval.compare(0,2,"td") == 0) {
++pos;
const std::string stdval = readUntil(command, &pos, " ");
standard = stdval;

View File

@ -22,7 +22,7 @@ import operator
# Version scheme (MAJOR.MINOR.PATCH) should orientate on "Semantic Versioning" https://semver.org/
# Every change in this script should result in increasing the version number accordingly (exceptions may be cosmetic
# changes)
SERVER_VERSION = "1.3.3"
SERVER_VERSION = "1.3.4"
OLD_VERSION = '1.90'
@ -82,8 +82,7 @@ def overviewReport() -> str:
return html
def fmt(a: str, b: str, c: str = None, d: str = None, e: str = None, link: bool = True) -> str:
column_width = [40, 10, 5, 7, 7, 8]
def fmt(a: str, b: str, c: str = None, d: str = None, e: str = None, link: bool = True, column_width = [40, 10, 5, 7, 7, 8]) -> str:
ret = a
while len(ret) < column_width[0]:
ret += ' '
@ -615,12 +614,9 @@ def timeReport(resultPath: str) -> str:
html = '<html><head><title>Time report</title></head><body>\n'
html += '<h1>Time report</h1>\n'
html += '<pre>\n'
column_widths = [25, 10, 10, 10]
column_width = [40, 10, 10, 10, 10]
html += '<b>'
html += 'Package '.ljust(column_widths[0]) + ' ' + \
OLD_VERSION.rjust(column_widths[1]) + ' ' + \
'Head'.rjust(column_widths[2]) + ' ' + \
'Factor'.rjust(column_widths[3])
html += fmt('Package', OLD_VERSION, 'Head', 'Factor', column_width=column_width)
html += '</b>\n'
total_time_base = 0.0
@ -656,10 +652,8 @@ def timeReport(resultPath: str) -> str:
time_factor = time_head / time_base
else:
time_factor = 0.0
html += filename[len(resultPath)+1:].ljust(column_widths[0]) + ' ' + \
split_line[2].rjust(column_widths[1]) + ' ' + \
split_line[1].rjust(column_widths[2]) + ' ' + \
'{:.2f}'.format(time_factor).rjust(column_widths[3]) + '\n'
html += fmt(filename[len(resultPath)+1:], split_line[2], split_line[1],
'{:.2f}'.format(time_factor), column_width=column_width) + '\n'
break
html += '\n'
@ -670,10 +664,10 @@ def timeReport(resultPath: str) -> str:
else:
total_time_factor = 0.0
html += 'Time for all packages (not just the ones listed above):\n'
html += 'Total time: '.ljust(column_widths[0]) + ' ' + \
'{:.1f}'.format(total_time_base).rjust(column_widths[1]) + ' ' + \
'{:.1f}'.format(total_time_head).rjust(column_widths[2]) + ' ' + \
'{:.2f}'.format(total_time_factor).rjust(column_widths[3])
html += fmt('Total time:',
'{:.1f}'.format(total_time_base),
'{:.1f}'.format(total_time_head),
'{:.2f}'.format(total_time_factor), link=False, column_width=column_width)
html += '\n'
html += '</pre>\n'