test suite: FIXED messages are misordered with tests

Tomi Ollila tomi.ollila at iki.fi
Wed May 20 14:16:48 PDT 2020


On Thu, May 21 2020, Tomi Ollila wrote:

>
> the message that prints FIXED, does not execute print_test_description
> but the ones that do BROKEN or FAIL does (did not fully check but yes).
>
> And:
>
>     print_test_description ()
>     {
>         test -z "$test_description_printed" || return 0
>         echo
>         echo $this_test: "Testing ${test_description}"
>         test_description_printed=1
>     }


btw: I would rewrite this function as:

     print_test_description ()
     {
         echo
         echo $this_test: "Testing ${test_description}"

         print_test_description () { :; }         
     }

If I wanted to reduce XTRACE noise (even further), even further:

     _print_test_description ()
     {
         echo
         echo $this_test: "Testing ${test_description}"

         print_test_description=
     }
     print_test_description=_print_test_description

(and then use $print_test_description in "calls")

or even

     alias print_test_description='
       echo
       echo echo $this_test: "Testing ${test_description}"
       alias print_test_description='

(just tested this latest works)

Note on aliases: bash namual states:

 For almost every purpose, aliases are superseded by shell functions.

One notable exception is XTRACE noise reduction. In our case best 
candidate would be prerequisite work -- but SMOP..

Tomi

>     if [ -z "$NOTMUCH_TEST_QUIET" ]
>     then
>         print_test_description
>     fi
>
> Tomi


More information about the notmuch mailing list