Control to print log messages during test

The log messages are useless during general and automated testing. But
while developing tests, the warning messages might be an easy debugging
option to check why one's own test currently fails.
This commit is contained in:
Benedikt Heine 2019-01-04 22:24:46 +01:00
parent c1090ad7dc
commit 7092e54840

View File

@ -31,8 +31,11 @@ int main(int argc, char *argv[]) {
} }
base = dirname(prog); base = dirname(prog);
// do not print out warning messages, when executing tests /* By default do not print out warning messages, when executing tests.
dunst_log_init(true); * But allow, if DUNST_TEST_LOG=1 is set in environment. */
const char *log = getenv("DUNST_TEST_LOG");
bool printlog = log && atoi(log) ? true : false;
dunst_log_init(!printlog);
GREATEST_MAIN_BEGIN(); GREATEST_MAIN_BEGIN();
RUN_SUITE(suite_utils); RUN_SUITE(suite_utils);