From f858447fe43f16038cf45565d0ac761a703fd645 Mon Sep 17 00:00:00 2001 From: Sevinj Aghayeva Date: Thu, 9 Jun 2022 12:29:24 -0400 Subject: mbuto: Add -L suboption to kselftests for listing available collections Signed-off-by: Sevinj Aghayeva [sbrivio: pass output to 'fmt -t' for readability] Signed-off-by: Stefano Brivio --- mbuto | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/mbuto b/mbuto index a5733e6..720b77a 100755 --- a/mbuto +++ b/mbuto @@ -209,6 +209,14 @@ profile_kselftests() { __testpath="./tools/testing/selftests/" __makefile="${__testpath}Makefile" __colls= + + if [ -n "${SUBOPT_list+x}" ]; then + __colls=$("${AWK}" '/^TARGETS \+= / {print $3}' ${__makefile} | "${TR}" '\n' ' ') + printf "Available collections:\n " + echo "${__colls}" | "${FMT}" -t + exit 0 + fi + for __c in ${SUBOPT_collection}; do if ! ${GREP} -q "^TARGETS += ${__c}$" ${__makefile}; then notice "WARNING: collection ${__c} doesn't exist" @@ -316,7 +324,7 @@ profile_kselftests() { ### Helpers #################################################################### # List of tools used here, assigned to uppercase variable names -TOOLS="awk basename bc cat cd chmod cp cpio depmod diff dirname du file find +TOOLS="awk basename bc cat cd chmod cp cpio depmod diff dirname du file find fmt grep egrep gzip ldconfig ldd ln ls make mkdir mknod mktemp modprobe mv printf readlink realpath rm rmdir sed seq sleep sort strip sync tr umount uname wget which" @@ -458,6 +466,7 @@ list_join() { SUBOPTS=' kselftests C collection 2 Select a collection of kernel tests kselftests T test 2 Select a test from a collection + kselftests L list 1 List available collections ' subopts_profile= -- cgit v1.2.3