lib/tst_test: Report 0 if test has both TPASS and TCONF
RFC PATCH 1/1 lib/tst_test: Report 0 if test has both TPASS and TCONF
It's probably a bit more logical to report a succes if only part of the test was skipped and the rest was sucessful. That way we can distinguish tests that were compiled-out completely or where the kernel does not support the particular syscall at all. The difference is about 15 testcases that report TPASS instead of TCONF after this change.
--- lib/tst_res.c | 11 ++++++++++- lib/tst_test.c | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-)
lib/tst_res.c +10 -1
@@ -91,6 +91,7 @@ static void tst_condense(int tnum, int ttype, const char *tmesg);static void tst_print (const char *tcid,int tnum,int ttype,const char *tmesg);static int T_exitval =0 ;/* exit value used by tst_exit() */ +static int passed_cnt;static int T_mode =VERBOSE ;/* flag indicating print mode: VERBOSE, */ /* NOPASS, DISCARD */
@@ -166,6 +167,9 @@ static void tst_res__(const char *file, const int lineno, int ttype,*/ T_exitval |= ttype_result; +if (ttype_result ==TPASS ) + passed_cnt++; +check_env ();/*
@@ -390,7 +394,12 @@ void tst_exit(void)tst_flush (); -exit (T_exitval & ~TINFO ); + T_exitval &= ~TINFO ; + +if (T_exitval ==TCONF && passed_cnt) + T_exitval &= ~TCONF ; + +exit (T_exitval); }pid_t tst_fork (void )
lib/tst_test.c +1 -1
@@ -561,7 +561,7 @@ static void do_exit(int ret)if (results->failed) ret |=TFAIL ; -if (results->skipped) +if (results->skipped && !results->passed) ret |=TCONF ;if (results->warnings)
Signature · 1 line
2.13.0
RFC PATCH 1/1 lib/tst_test: Report 0 if test has both TPASS and TCONF
----- Original Message -----
Quoted 5 lines
It's probably a bit more logical to report a succes if only part of the test was skipped and the rest was sucessful. That way we can distinguish tests that were compiled-out completely or where the kernel does not support the particular syscall at all. The difference is about 15 testcases that report TPASS instead of TCONF after this change.
Looks good to me. I've noticed more TCONFs too with your all_filesystems patch, where some filesystems didn't support all features.
Regards,
Jan
RFC PATCH 1/1 lib/tst_test: Report 0 if test has both TPASS and TCONF
Hi!
Quoted 8 lines
Quoted 5 lines
It's probably a bit more logical to report a succes if only part of the test was skipped and the rest was sucessful. That way we can distinguish tests that were compiled-out completely or where the kernel does not support the particular syscall at all. The difference is about 15 testcases that report TPASS instead of TCONF after this change.
Looks good to me. I've noticed more TCONFs too with your
all_filesystemspatch, where some filesystems didn't support all features.
Pushed with your ack.
Signature · 2 lines
Cyril Hrubis [email protected]