Revision: 3868
Author: pekka.klarck
Date: Mon Aug 23 06:07:33 2010
Log: Added tests for --loglevel with rebot and added cli options to rebot
(they aren't used anywhere yet). Issue 608.
http://code.google.com/p/robotframework/source/detail?r=3868
Added:
/trunk/atest/robot/cli/rebot/log_level.txt
Modified:
/trunk/src/robot/rebot.py
=======================================
--- /dev/null
+++ /trunk/atest/robot/cli/rebot/log_level.txt Mon Aug 23 06:07:33 2010
@@ -0,0 +1,32 @@
+*** Settings ***
+Force Tags regression pybot jybot
+Resource rebot_resource.txt
+
+
+*** Test Cases ***
+
+By default all messages are included
+ Rebot and process output
+ ${tc} = Set Variable ${SUITE.tests[0]}
+ Check Log Message ${tc.kws[0].msgs[0]} Arguments: [ u'Test 1' ]
TRACE
+ Check Log Message ${tc.kws[0].msgs[1]} Test 1 INFO
+ Check Log Message ${tc.kws[0].msgs[2]} Return: None TRACE
+ Check Log Message ${tc.kws[1].msgs[0]} Arguments: [ u'Logging with
debug level' | u'DEBUG' ] TRACE
+ Check Log Message ${tc.kws[1].msgs[1]} Logging with debug level
DEBUG
+ Check Log Message ${tc.kws[1].msgs[2]} Return: None TRACE
+
+Levels below given level are ignored
+ Rebot and process output --loglevel debug
+ ${tc} = Set Variable ${SUITE.tests[0]}
+ Check Log Message ${tc.kws[0].msgs[0]} Test 1 INFO
+ Check Log Message ${tc.kws[1].msgs[0]} Logging with debug level
DEBUG
+ Rebot and process output -L INFO
+ ${tc} = Set Variable ${SUITE.tests[0]}
+ Check Log Message ${tc.kws[0].msgs[0]} Test 1 INFO
+ Should Be Empty ${tc.kws[1].msgs}
+
+All messages are ignored when NONE level is used
+ Rebot and process output --loglevel NONE
+ ${tc} = Set Variable ${SUITE.tests[0]}
+ Should Be Empty ${tc.kws[0].msgs}
+ Should Be Empty ${tc.kws[1].msgs}
=======================================
--- /trunk/src/robot/rebot.py Wed Jun 9 10:18:43 2010
+++ /trunk/src/robot/rebot.py Mon Aug 23 06:07:33 2010
@@ -115,6 +115,8 @@
'passed:failed'. Both color names and codes work.
Examples: --reportbackground green:yellow:red
--reportbackground #00E:#E00
+ -L --loglevel level Threshold for selecting messages. Available
levels:
+ TRACE (default), DEBUG, INFO, WARN, NONE (no
msgs)
--suitestatlevel level How many levels to show in 'Statistics by
Suite'
table in outputs. By default all suite levels are
shown. If zero (0) is given the whole table is