Re: [PATCH 1/2] test-lib: show missing prereq summary

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 15 2021, Fabian Stelzer wrote:

> When running the full test suite many tests can be skipped because of
> missing prerequisites. It not easy right now to get an overview of which
> ones are missing.
> When switching to a new machine or environment some libraries and tools
> might be missing or maybe a dependency broke completely. In this case
> the tests would indicate nothing since all dependant tests are simply
> skipped. This could hide broken behaviour or missing features in the
> build. Therefore this patch summarizes the missing prereqs at the end of
> the test run making it easier to spot such cases.
>
>  - Add failed prereqs to the test results.
>  - Aggregate and then show them with the totals.
>
> Signed-off-by: Fabian Stelzer <fs@xxxxxxxxxxxx>
> ---
>  t/aggregate-results.sh | 17 +++++++++++++++++
>  t/test-lib.sh          | 11 +++++++++++
>  2 files changed, 28 insertions(+)
>
> diff --git a/t/aggregate-results.sh b/t/aggregate-results.sh
> index 7913e206ed..87c16fcee1 100755
> --- a/t/aggregate-results.sh
> +++ b/t/aggregate-results.sh
> @@ -6,6 +6,7 @@ success=0
>  failed=0
>  broken=0
>  total=0
> +missing_prereq=
>  
>  while read file
>  do
> @@ -30,10 +31,26 @@ do
>  			broken=$(($broken + $value)) ;;
>  		total)
>  			total=$(($total + $value)) ;;
> +		missing_prereq)
> +			missing_prereq="$missing_prereq,$value" ;;
>  		esac
>  	done <"$file"
>  done
>  
> +if test -n "$missing_prereq"
> +then
> +	unique_missing_prereq=$(
> +		echo $missing_prereq |
> +		tr -s "," "\n" |
> +		grep -v '^$' |
> +		sort -u |
> +		paste -s -d ',')

What is paste? Some out-of-tree debugging utility?

I think you might find a better way to do this shown in my
"ab/generate-command-list" topic, currently in seen. It removed most of
the same sort of tr|grep|sort etc. chain in generate-cmdlist.sh.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux