Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests: Warn about skipped tests in result summary

Update the functions that print the test totals at the end of a selftest
to include a warning message when skipped tests are detected. The
message advises users that skipped tests may indicate missing
configuration options and suggests enabling them to improve coverage.

Link: https://lore.kernel.org/r/20241126093710.13314-1-laura.nao@collabora.com
Signed-off-by: Laura Nao <laura.nao@collabora.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

authored by

Laura Nao and committed by
Shuah Khan
74864403 e8731ecd

+12
+5
tools/testing/selftests/kselftest.h
··· 149 149 150 150 static inline void ksft_print_cnts(void) 151 151 { 152 + if (ksft_cnt.ksft_xskip > 0) 153 + printf( 154 + "# %u skipped test(s) detected. Consider enabling relevant config options to improve coverage.\n", 155 + ksft_cnt.ksft_xskip 156 + ); 152 157 if (ksft_plan != ksft_test_num()) 153 158 printf("# Planned tests != run tests (%u != %u)\n", 154 159 ksft_plan, ksft_test_num());
+3
tools/testing/selftests/kselftest/ksft.py
··· 27 27 28 28 29 29 def print_cnts(): 30 + if ksft_cnt['skip'] > 0: 31 + print(f"# {ksft_cnt['skip']} skipped test(s) detected. Consider enabling relevant config options to improve coverage.") 32 + 30 33 print( 31 34 f"# Totals: pass:{ksft_cnt['pass']} fail:{ksft_cnt['fail']} xfail:0 xpass:0 skip:{ksft_cnt['skip']} error:0" 32 35 )
+4
tools/testing/selftests/kselftest/ktap_helpers.sh
··· 107 107 } 108 108 109 109 ktap_print_totals() { 110 + if [ "$KTAP_CNT_SKIP" -gt 0 ]; then 111 + echo "# $KTAP_CNT_SKIP skipped test(s) detected. " \ 112 + "Consider enabling relevant config options to improve coverage." 113 + fi 110 114 echo "# Totals: pass:$KTAP_CNT_PASS fail:$KTAP_CNT_FAIL xfail:0 xpass:0 skip:$KTAP_CNT_SKIP error:0" 111 115 }