cmake --build . --target expand_all_instantiations || (echo "make expand_all_instantiations failed!"; false) || exit 3
-# finally run it:
+# generate allheaders.h
+(cd include; find . -name '*.h'; cd $SRC/include/; find . -name '*.h') | grep -v allheaders.h | grep -v undefine_macros.h | sed 's|^./|#include <|' | sed 's|$|>|' >include/deal.II/allheaders.h
+
+# finally run it clang-tidy on deal.II
+#
# pipe away stderr (just contains nonsensical "x warnings generated")
# pipe output to output.txt
-run-clang-tidy.py -p . -quiet -header-filter="$SRC/include/*" 2>error.txt >output.txt
+run-clang-tidy.py -p . -quiet -header-filter "$SRC/include/*" -extra-arg='-DCLANG_TIDY' 2>error.txt >output.txt
+
+# grep interesting errors and make sure we remove duplicates:
+grep -E '(warning|error): ' output.txt output2.txt | sort | uniq >clang-tidy.log
-if grep -E -q '(warning|error): ' output.txt; then
- grep -E '(warning|error): ' output.txt
+# if we have errors, report them and set exit status to failure
+if [ -s clang-tidy.log ]; then
+ cat clang-tidy.log
exit 4
fi
{
(void)global_symbol_42;
}
+
+/**
+ * If we are running the contrib/utilities/run_clang_tidy.sh script, we
+ * generate a header file allheaders.h that includes all deal.II
+ * headers. Include the file here so that all headers are being checked.
+ */
+#ifdef CLANG_TIDY
+# include <deal.II/allheaders.h>
+#endif