File tree Expand file tree Collapse file tree 1 file changed +13
-21
lines changed Expand file tree Collapse file tree 1 file changed +13
-21
lines changed Original file line number Diff line number Diff line change @@ -23,25 +23,17 @@ COLVARS_SOURCE_DIR="$TOPDIR/src"
23
23
# Find all source files that are required to build the run_colvars_test
24
24
COLVARS_STUB_SOURCE_DIR=" $TOPDIR /misc_interfaces/stubs"
25
25
COLVARS_TEST_SOURCE_DIR=" $TOPDIR /tests/functional/"
26
- COLVARS_SOURCE_FILES=$( find $COLVARS_STUB_SOURCE_DIR $COLVARS_TEST_SOURCE_DIR $COLVARS_SOURCE_DIR -name " *.cpp" )
27
-
28
- num_test_failed=0
29
- all_output=" "
30
- # Run clang-tidy over all files and save the results
31
- for colvars_src_file in $COLVARS_SOURCE_FILES ; do
32
- clang_tidy_command=" $CLANG_TIDY_BINARY -p=$COLVARS_BUILD_DIR --warnings-as-errors='*' $colvars_src_file "
33
- echo " Running $clang_tidy_command "
34
- output=" $( eval $clang_tidy_command 2>&1 ) " || exit_code=$?
35
- all_output+=" $output "
36
- if [[ $exit_code -gt 0 ]]; then
37
- num_test_failed=` expr $num_test_failed + 1`
38
- fi
39
- done
40
-
41
- if [[ $num_test_failed -gt 0 ]]; then
42
- echo " There are $num_test_failed test(s) failed."
43
- echo " $all_output "
44
- exit 1
45
- else
46
- exit 0
26
+ COLVARS_SOURCE_FILES=($( find $COLVARS_STUB_SOURCE_DIR $COLVARS_TEST_SOURCE_DIR $COLVARS_SOURCE_DIR -name " *.cpp" ) )
27
+
28
+ printf ' %s\n' ${COLVARS_SOURCE_FILES[@]} | \
29
+ xargs -I{} -P $( nproc) \
30
+ bash -c " $CLANG_TIDY_BINARY -p=$COLVARS_BUILD_DIR -header-filter=.* --warnings-as-errors='*' '{}' > '{}'.log"
31
+
32
+ retcode=$?
33
+
34
+ if [ $retcode != 0 ] ; then
35
+ cat " ${COLVARS_SOURCE_FILES[@]/%/ .log} "
36
+ exit $retcode
47
37
fi
38
+
39
+ exit 0
You can’t perform that action at this time.
0 commit comments