Skip to content

Commit

Permalink
cppcheck.cpp: fixed missing verbose logging of clang command when usi…
Browse files Browse the repository at this point in the history
…ng build dir (#6940)
  • Loading branch information
firewave authored Oct 26, 2024
1 parent 46b669f commit ef382b6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/cppcheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,8 @@ unsigned int CppCheck::checkClang(const FileWithDetails &file)
if (!mSettings.buildDir.empty()) {
std::ofstream fout(clangcmd);
fout << exe << " " << args2 << " " << redirect2 << std::endl;
} else if (mSettings.verbose && !mSettings.quiet) {
}
if (mSettings.verbose && !mSettings.quiet) {
mErrorLogger.reportOut(exe + " " + args2);
}

Expand Down
7 changes: 7 additions & 0 deletions test/cli/clang-import_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,13 @@ def test_cmd_std_c(tmp_path): # #13129
__test_cmd(tmp_path, 'test.cpp',['--std=c89', '--std=c++14'], '-x c++ -std=c++14')


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


def test_cmd_std_cpp(tmp_path): # #13129
__test_cmd(tmp_path, 'test.c',['--std=c89', '--std=c++14'], '-x c -std=c89')

Expand Down

0 comments on commit ef382b6

Please sign in to comment.