On Mon, Apr 3, 2017 at 2:18 PM, David Howells <dhowells@xxxxxxxxxx> wrote: > Amir Goldstein <amir73il@xxxxxxxxx> wrote: > >> I know Eryu told you that you can change the default of status to success, >> ... what's the benefit of doing that. > > Simple: All the tests should be carried out, even if one or more fail. The > script should not simply abort at that point, but should rather give the > cumulative error at the end. > > This means the default should be success and this altered to failure on the > failure of any subtest (ie. we're OR'ing them). > > There should needs to be a way to report any subtest that was skipped because > the kernel or the fs doesn't support it. > >> A simple way to deal with this is to do >> >> function check_stat () { >> $here/src/stat_test $* || exit >> } > > No. This is the wrong thing to do (see above). Better would be to either set > status=1 here (but we're inside a function, so I'm not sure that'll work) or > to replace the exit above with "|| echo stat_test failed" and let the output > comparator handle it. > Fair enough. Both options will work. Bash variables are global by default. I am a bit concerned about setting status=0 to begin with because of 'exit' inside common helpers. How about handling the errors with "|| echo stat_test failed" and sticking to standard wrt status?