Skip to content

Commit ef382b6

Browse files
authored
cppcheck.cpp: fixed missing verbose logging of clang command when using build dir (danmar#6940)
1 parent 46b669f commit ef382b6

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lib/cppcheck.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,8 @@ unsigned int CppCheck::checkClang(const FileWithDetails &file)
464464
if (!mSettings.buildDir.empty()) {
465465
std::ofstream fout(clangcmd);
466466
fout << exe << " " << args2 << " " << redirect2 << std::endl;
467-
} else if (mSettings.verbose && !mSettings.quiet) {
467+
}
468+
if (mSettings.verbose && !mSettings.quiet) {
468469
mErrorLogger.reportOut(exe + " " + args2);
469470
}
470471

test/cli/clang-import_test.py

+7
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,13 @@ def test_cmd_std_c(tmp_path): # #13129
196196
__test_cmd(tmp_path, 'test.cpp',['--std=c89', '--std=c++14'], '-x c++ -std=c++14')
197197

198198

199+
# TODO: remove when we inject the build-dir into all tests
200+
def test_cmd_std_c_builddir(tmp_path): # #13129
201+
build_dir = tmp_path / 'b1'
202+
os.makedirs(build_dir)
203+
__test_cmd(tmp_path, 'test.cpp',['--std=c89', '--std=c++14', '--cppcheck-build-dir={}'.format(build_dir)], '-x c++ -std=c++14')
204+
205+
199206
def test_cmd_std_cpp(tmp_path): # #13129
200207
__test_cmd(tmp_path, 'test.c',['--std=c89', '--std=c++14'], '-x c -std=c89')
201208

0 commit comments

Comments
 (0)