test: drop logging suspension

Instead of selectively suspending logging by redirecting messages to
/dev/null, increase the default minimum log severity to FATAL. In the
debug mode, all messages are printed.
This commit is contained in:
Miroslav Lichvar
2021-03-09 12:34:41 +01:00
parent d2117ab697
commit 26fc28c056
5 changed files with 5 additions and 29 deletions

View File

@@ -43,6 +43,7 @@ TST_Skip(int line)
int
main(int argc, char **argv)
{
LOG_Severity log_severity;
char *test_name, *s;
int i, seed = 0;
struct timeval tv;
@@ -55,9 +56,11 @@ main(int argc, char **argv)
if (s)
test_name = s + 1;
log_severity = LOGS_FATAL;
for (i = 1; i < argc; i++) {
if (!strcmp(argv[i], "-d")) {
LOG_SetMinSeverity(LOGS_DEBUG);
log_severity = LOGS_DEBUG;
} else if (!strcmp(argv[i], "-s") && i + 1 < argc) {
seed = atoi(argv[++i]);
} else {
@@ -73,6 +76,7 @@ main(int argc, char **argv)
fflush(stdout);
LOG_Initialise();
LOG_SetMinSeverity(log_severity);
test_unit();
@@ -83,16 +87,6 @@ main(int argc, char **argv)
return 0;
}
void TST_SuspendLogging(void)
{
LOG_OpenFileLog("/dev/null");
}
void TST_ResumeLogging(void)
{
LOG_OpenFileLog(NULL);
}
double
TST_GetRandomDouble(double min, double max)
{