X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/8b70d2495e2da9b7cbc603609d66695d53b990af..0ac9c93e13ee93792d671d9dd653c151fa24df38:/teshsuite/xbt/log_usage/log_usage.tesh diff --git a/teshsuite/xbt/log_usage/log_usage.tesh b/teshsuite/xbt/log_usage/log_usage.tesh index 22f4b30d18..2a2303381a 100644 --- a/teshsuite/xbt/log_usage/log_usage.tesh +++ b/teshsuite/xbt/log_usage/log_usage.tesh @@ -1,21 +1,93 @@ -#! ./tesh +#!/usr/bin/env tesh -$ $SG_TEST_EXENV ${bindir:=.}/log_usage -> [0.000000] [test/INFO] Test with the settings '' -> [0.000000] /home/bedaride/Boulot/simgrid/teshsuite/xbt/log_usage/log_usage.c:28: [test/WARNING] val=2 -> [0.000000] /home/bedaride/Boulot/simgrid/teshsuite/xbt/log_usage/log_usage.c:30: [test/CRITICAL] false alarm! -> [0.000000] [test/INFO] Test with the settings ' ' -> [0.000000] /home/bedaride/Boulot/simgrid/teshsuite/xbt/log_usage/log_usage.c:28: [test/WARNING] val=2 -> [0.000000] /home/bedaride/Boulot/simgrid/teshsuite/xbt/log_usage/log_usage.c:30: [test/CRITICAL] false alarm! -> [0.000000] [test/INFO] Test with the settings ' test.thres:info root.thres:info ' -> [0.000000] /home/bedaride/Boulot/simgrid/teshsuite/xbt/log_usage/log_usage.c:28: [test/WARNING] val=2 -> [0.000000] /home/bedaride/Boulot/simgrid/teshsuite/xbt/log_usage/log_usage.c:30: [test/CRITICAL] false alarm! -> [0.000000] [test/INFO] Test with the settings ' test.thres:debug ' -> [0.000000] /home/bedaride/Boulot/simgrid/teshsuite/xbt/log_usage/log_usage.c:27: [test/DEBUG] val=1 -> [0.000000] /home/bedaride/Boulot/simgrid/teshsuite/xbt/log_usage/log_usage.c:28: [test/WARNING] val=2 -> [0.000000] /home/bedaride/Boulot/simgrid/teshsuite/xbt/log_usage/log_usage.c:30: [test/CRITICAL] false alarm! -> [0.000000] [test/INFO] Test with the settings ' test.thres:verbose root.thres:error ' -> [0.000000] /home/bedaride/Boulot/simgrid/teshsuite/xbt/log_usage/log_usage.c:28: [test/WARNING] val=2 -> [0.000000] /home/bedaride/Boulot/simgrid/teshsuite/xbt/log_usage/log_usage.c:30: [test/CRITICAL] false alarm! -> [0.000000] [test/INFO] Test with the settings ' test.thres:critical ' -> [0.000000] /home/bedaride/Boulot/simgrid/teshsuite/xbt/log_usage/log_usage.c:30: [test/CRITICAL] false alarm! +p Check different log thresholds +$ $SG_TEST_EXENV ${bindir:=.}/log_usage "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n" +> [ 0.000000] [0:maestro@] Test with the settings '' +> [ 0.000000] [0:maestro@] val=2 +> [ 0.000000] [0:maestro@] false alarm! +> [ 0.000000] [0:maestro@] Test with the settings ' ' +> [ 0.000000] [0:maestro@] val=2 +> [ 0.000000] [0:maestro@] false alarm! +> [ 0.000000] [0:maestro@] Test with the settings ' test.thres:info root.thres:info ' +> [ 0.000000] [0:maestro@] val=2 +> [ 0.000000] [0:maestro@] false alarm! +> [ 0.000000] [0:maestro@] Test with the settings ' test.thres:debug ' +> [ 0.000000] [0:maestro@] val=1 +> [ 0.000000] [0:maestro@] val=2 +> [ 0.000000] [0:maestro@] false alarm! +> [ 0.000000] [0:maestro@] Test with the settings ' test.thres:verbose root.thres:error ' +> [ 0.000000] [0:maestro@] val=2 +> [ 0.000000] [0:maestro@] false alarm! +> [ 0.000000] [0:maestro@] Test with the settings ' test.thres:critical ' +> [ 0.000000] [0:maestro@] false alarm! + +p Check the "file" log appender +$ $SG_TEST_EXENV ${bindir:=.}/log_usage "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n" --log=root.app:file:${bindir:=.}/log_usage.log +$ cat ${bindir:=.}/log_usage.log +> [ 0.000000] [0:maestro@] Test with the settings '' +> [ 0.000000] [0:maestro@] val=2 +> [ 0.000000] [0:maestro@] false alarm! +> [ 0.000000] [0:maestro@] Test with the settings ' ' +> [ 0.000000] [0:maestro@] val=2 +> [ 0.000000] [0:maestro@] false alarm! +> [ 0.000000] [0:maestro@] Test with the settings ' test.thres:info root.thres:info ' +> [ 0.000000] [0:maestro@] val=2 +> [ 0.000000] [0:maestro@] false alarm! +> [ 0.000000] [0:maestro@] Test with the settings ' test.thres:debug ' +> [ 0.000000] [0:maestro@] val=1 +> [ 0.000000] [0:maestro@] val=2 +> [ 0.000000] [0:maestro@] false alarm! +> [ 0.000000] [0:maestro@] Test with the settings ' test.thres:verbose root.thres:error ' +> [ 0.000000] [0:maestro@] val=2 +> [ 0.000000] [0:maestro@] false alarm! +> [ 0.000000] [0:maestro@] Test with the settings ' test.thres:critical ' +> [ 0.000000] [0:maestro@] false alarm! + +p Check the "rollfile" log appender +$ $SG_TEST_EXENV ${bindir:=.}/log_usage "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n" --log=root.app:rollfile:500:${bindir:=.}/log_usage.log +$ cat ${bindir:=.}/log_usage.log +> [ 0.000000] [0:maestro@] val=2 +> [ 0.000000] [0:maestro@] false alarm! +> [ 0.000000] [0:maestro@] Test with the settings ' test.thres:verbose root.thres:error ' +> [ 0.000000] [0:maestro@] val=2 +> [ 0.000000] [0:maestro@] false alarm! +> [ 0.000000] [0:maestro@] Test with the settings ' test.thres:critical ' +> [ 0.000000] [0:maestro@] false alarm! +> +> [End of log] +> ] val=2 +> [ 0.000000] [0:maestro@] false alarm! +> [ 0.000000] [0:maestro@] Test with the settings ' test.thres:debug ' +> [ 0.000000] [0:maestro@] val=1 +> +> + +p Check the "splitfile" log appender +$ $SG_TEST_EXENV ${bindir:=.}/log_usage "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n" --log=root.app:splitfile:500:${bindir:=.}/log_usage_%.log +$ cat ${bindir:=.}/log_usage_0.log +> [ 0.000000] [0:maestro@] Test with the settings '' +> [ 0.000000] [0:maestro@] val=2 +> [ 0.000000] [0:maestro@] false alarm! +> [ 0.000000] [0:maestro@] Test with the settings ' ' +> [ 0.000000] [0:maestro@] val=2 +> [ 0.000000] [0:maestro@] false alarm! +> [ 0.000000] [0:maestro@] Test with the settings ' test.thres:info root.thres:info ' +> [ 0.000000] [0:maestro@] val=2 +> [ 0.000000] [0:maestro@] false alarm! +> [ 0.000000] [0:maestro@] Test with the settings ' test.thres:debug ' +> [ 0.000000] [0:maestro@] val=1 + +$ cat ${bindir:=.}/log_usage_1.log +> [ 0.000000] [0:maestro@] val=2 +> [ 0.000000] [0:maestro@] false alarm! +> [ 0.000000] [0:maestro@] Test with the settings ' test.thres:verbose root.thres:error ' +> [ 0.000000] [0:maestro@] val=2 +> [ 0.000000] [0:maestro@] false alarm! +> [ 0.000000] [0:maestro@] Test with the settings ' test.thres:critical ' +> [ 0.000000] [0:maestro@] false alarm! + +$ rm -f ${bindir:=.}/log_usage.log ${bindir:=.}/log_usage_0.log ${bindir:=.}/log_usage_1.log + +# Would be nice for code coverage, but the early exit leads to lots of memory leaks +#! output ignore +#$ $SG_TEST_EXENV ${bindir:=.}/log_usage --help-logs --help-log-categories