Merge pull request #584 from bebehei/test-printlog

Control to print log messages during test
This commit is contained in:
Benedikt Heine 2019-01-05 20:51:27 +01:00 committed by GitHub
commit 595ffc294a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,8 +31,11 @@ int main(int argc, char *argv[]) {
}
base = dirname(prog);
// do not print out warning messages, when executing tests
dunst_log_init(true);
/* By default do not print out warning messages, when executing tests.
* 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();
RUN_SUITE(suite_utils);