| #! /bin/bash |
| |
| unique_contributors_num=$(git --no-pager shortlog -n -s -- include/kunit lib/kunit tools/testing/kunit/ | wc -l) |
| patches_not_from_team_num=$(git log --pretty=oneline --perl-regexp \ |
| --author='^((?!Brendan Higgins|David Gow|Heidi Fahim|Felix Guo|Avinash Kondareddy).*)$' \ |
| -- include/kunit lib/kunit tools/testing/kunit/ | wc -l) |
| |
| not_tests='lib/kunit/debugfs.c |
| lib/kunit/string-stream.c |
| lib/kunit/try-catch.c |
| lib/kunit/assert.c |
| lib/kunit/debugfs.h |
| lib/kunit/test.c |
| init/main.c |
| mm/kasan/report.c |
| Documentation/dev-tools/kunit/start.rst |
| get_metrics.sh |
| ' |
| |
| all_tests=$(for file_name in $(grep -Hrnl -e '#include <kunit/test.h>') |
| do |
| if [[ ! $not_tests =~ (^|[[:space:]])"$file_name"($|[[:space:]]) ]] ; then |
| printf "$file_name\n" |
| fi |
| done) |
| |
| tests_total_num=$(echo "$all_tests" | wc -l) |
| test_authors=$(git --no-pager shortlog -n -s -- $all_tests) |
| test_author_num=$(echo "$test_authors" | wc -l) |
| test_case_num=$(find ./ -type f ! -wholename '*/Documentation/*' ! -name 'test.h' -name 'get_metrics.sh' -print0 | |
| xargs -0 grep 'KUNIT_CASE' | wc -l) |
| |
| #printf "All tests:\t$all_tests\n" |
| #printf "Test authors:\t$test_authors\n" |
| printf "Unique contributors:\t$unique_contributors_num\n" |
| printf "Number of patches:\t$patches_not_from_team_num\n" |
| printf "Number of total tests:\t$tests_total_num\n" |
| printf "Number of test authors:\t$test_author_num\n" |