@@ -68,6 +68,7 @@ static int iterations = 1;
68
68
static float duration = -1 ;
69
69
static float timeout_mul = -1 ;
70
70
static int reproducible_output ;
71
+ static int quiet_output ;
71
72
72
73
struct context {
73
74
int32_t lib_pid ;
@@ -307,15 +308,21 @@ static void print_result(const char *file, const int lineno, int ttype,
307
308
res = "TBROK" ;
308
309
break ;
309
310
case TCONF :
311
+ if (quiet_output )
312
+ return ;
310
313
res = "TCONF" ;
311
314
break ;
312
315
case TWARN :
313
316
res = "TWARN" ;
314
317
break ;
315
318
case TINFO :
319
+ if (quiet_output )
320
+ return ;
316
321
res = "TINFO" ;
317
322
break ;
318
323
case TDEBUG :
324
+ if (quiet_output )
325
+ return ;
319
326
res = "TDEBUG" ;
320
327
break ;
321
328
default :
@@ -670,6 +677,7 @@ static void print_help(void)
670
677
fprintf (stderr , "LTP_DEV_FS_TYPE Filesystem used for testing (default: %s)\n" , DEFAULT_FS_TYPE );
671
678
fprintf (stderr , "LTP_ENABLE_DEBUG Print debug messages (set 1 or y)\n" );
672
679
fprintf (stderr , "LTP_REPRODUCIBLE_OUTPUT Values 1 or y discard the actual content of the messages printed by the test\n" );
680
+ fprintf (stderr , "LTP_QUIET Values 1 or y will suppress printing TCONF, TWARN, TINFO, and TDEBUG messages\n" );
673
681
fprintf (stderr , "LTP_SINGLE_FS_TYPE Specifies filesystem instead all supported (for .all_filesystems)\n" );
674
682
fprintf (stderr , "LTP_FORCE_SINGLE_FS_TYPE Testing only. The same as LTP_SINGLE_FS_TYPE but ignores test skiplist.\n" );
675
683
fprintf (stderr , "LTP_TIMEOUT_MUL Timeout multiplier (must be a number >=1)\n" );
@@ -1361,6 +1369,7 @@ static void do_setup(int argc, char *argv[])
1361
1369
{
1362
1370
char * tdebug_env = getenv ("LTP_ENABLE_DEBUG" );
1363
1371
char * reproducible_env = getenv ("LTP_REPRODUCIBLE_OUTPUT" );
1372
+ char * quiet_env = getenv ("LTP_QUIET" );
1364
1373
1365
1374
if (!tst_test )
1366
1375
tst_brk (TBROK , "No tests to run" );
@@ -1391,6 +1400,10 @@ static void do_setup(int argc, char *argv[])
1391
1400
(!strcmp (reproducible_env , "1" ) || !strcmp (reproducible_env , "y" )))
1392
1401
reproducible_output = 1 ;
1393
1402
1403
+ if (quiet_env &&
1404
+ (!strcmp (quiet_env , "1" ) || !strcmp (quiet_env , "y" )))
1405
+ quiet_output = 1 ;
1406
+
1394
1407
assert_test_fn ();
1395
1408
1396
1409
TCID = tcid = get_tcid (argv );
0 commit comments