diff --git a/ci/test/03_test_script.sh b/ci/test/03_test_script.sh index f9064d177a..b8503f5673 100755 --- a/ci/test/03_test_script.sh +++ b/ci/test/03_test_script.sh @@ -170,6 +170,7 @@ if [ "${RUN_TIDY}" = "true" ]; then echo "^^^ ⚠️ Failure generated from clang-tidy" false fi + # Filter out: # * qt qrc and moc generated files jq 'map(select(.file | test("src/qt/qrc_.*\\.cpp$|/moc_.*\\.cpp$") | not))' "${BASE_BUILD_DIR}/compile_commands.json" > tmp.json @@ -180,6 +181,13 @@ if [ "${RUN_TIDY}" = "true" ]; then -- -Xiwyu --cxx17ns -Xiwyu --mapping_file="${BASE_ROOT_DIR}/contrib/devtools/iwyu/bitcoin.core.imp" \ -Xiwyu --max_line_length=160 \ 2>&1 | tee /tmp/iwyu_ci.out + + # TODO: Expand the following list to all targets. + TARGETS_WITH_FORCED_IWYU="bitcoin_clientversion bitcoin_crypto" + cd "${BASE_BUILD_DIR}" + bash -c "cmake -S ${BASE_ROOT_DIR} -DCMAKE_CXX_INCLUDE_WHAT_YOU_USE=\"include-what-you-use;-Xiwyu;--cxx17ns;-Xiwyu;--mapping_file=${BASE_ROOT_DIR}/contrib/devtools/iwyu/bitcoin.core.imp;-Xiwyu;--error\"" + bash -c "cmake --build . ${MAKEJOBS} --clean-first --target ${TARGETS_WITH_FORCED_IWYU}" + cd "${BASE_ROOT_DIR}/src" python3 "/include-what-you-use/fix_includes.py" --nosafe_headers < /tmp/iwyu_ci.out git --no-pager diff