Revision: 3866
Author: pekka.klarck
Date: Mon Aug 23 05:24:51 2010
Log: moved rebot cli tests to correct place
http://code.google.com/p/robotframework/source/detail?r=3866

Added:
 /trunk/atest/robot/cli/rebot
 /trunk/atest/robot/cli/rebot/commandline.txt
Deleted:
 /trunk/atest/robot/rebot/commandline.txt

=======================================
--- /dev/null
+++ /trunk/atest/robot/cli/rebot/commandline.txt        Mon Aug 23 05:24:51 2010
@@ -0,0 +1,251 @@
+*** Settings ***
+Documentation Testing Rebot's command line functionality. Functionality tested elsewere:\n - filtering by tags/names\n - combining outputs\n - creating correct html (incl. --xxxtitle options)
+Suite Setup     My Setup
+Suite Teardown  Remove Temps
+Test Setup      Empty Directory  ${MYOUTDIR}
+Force Tags      regression  pybot  jybot
+Resource        atest_resource.txt
+
+*** Variables ***
+${TESTFILE}  misc${/}normal.html
+${PASS_FAIL_FILE}  misc${/}pass_and_fail.html
+${MYOUTDIR}  ${TEMPDIR}${/}robot-test-145435
+${MYINPUT}  ${TEMPDIR}${/}robot-test-145435.xml
+${M_211_211} 2 critical tests, 1 passed, 1 failed\n 2 tests total, 1 passed, 1 failed +${M_110_211} 1 critical test, 1 passed, 0 failed\n 2 tests total, 1 passed, 1 failed +${M_101_211} 1 critical test, 0 passed, 1 failed\n 2 tests total, 1 passed, 1 failed +${M_000_211} 0 critical tests, 0 passed, 0 failed\n 2 tests total, 1 passed, 1 failed
+${USAGE_TIP}  \n\nTry --help for usage information.
+
+*** Test Cases ***
+Output Only
+ Run Rebot Without Processing Output --outputdir ${MYOUTDIR} --output myoutput.xml --log none --report none ${MYINPUT}
+    Directory Should Contain  ${MYOUTDIR}  myoutput.xml
+
+Report Only
+ Run Rebot Without Processing Output --outputdir ${MYOUTDIR} --output none --report myreport.html --log NONE --summary none ${MYINPUT}
+    Directory Should Contain  ${MYOUTDIR}  myreport.html
+
+Log Only
+ Run Rebot Without Processing Output --outputdir ${MYOUTDIR} --output None --report NONE --log mylog.html -S none ${MYINPUT}
+    Directory Should Contain  ${MYOUTDIR}  mylog.html
+
+Summary Only
+ Run Rebot Without Processing Output --outputdir ${MYOUTDIR} -o none --summary mysummary.html -l none -r NONE ${MYINPUT}
+    Directory Should Contain  ${MYOUTDIR}  mysummary.html
+
+All Outputs
+ Run Rebot Without Processing Output --outputdir ${MYOUTDIR} --output myoutput.xml --report myreport.html --log mylog.html -S mysummary.html ${MYINPUT} + Directory Should Contain ${MYOUTDIR} mylog.html myoutput.xml myreport.html mysummary.html
+
+All Outputs With Default Names
+    Verify REBOT Set
+    Run  ${REBOT} --outputdir ${MYOUTDIR} ${MYINPUT}
+    Directory Should Contain  ${MYOUTDIR}  log.html  report.html
+
+All Outputs Without Extensions
+ Run Rebot Without Processing Output --outputdir ${MYOUTDIR} -o myoutput -r myreport -l mylog --summary mysummary ${MYINPUT} + Directory Should Contain ${MYOUTDIR} mylog.html myoutput.xml myreport.html mysummary.html
+
+Outputs Into Different Dirs
+ Run Rebot Without Processing Output --outputdir ::invalid:: -o ${MYOUTDIR}${/}o${/}o.xml -r ${MYOUTDIR}${/}r${/}r.html -l ${MYOUTDIR}${/}l${/}l.html --summary ${MYOUTDIR}${/}s.htm ${MYINPUT}
+    Directory Should Contain  ${MYOUTDIR}${/}o  o.xml
+    Directory Should Contain  ${MYOUTDIR}${/}r  r.html
+    Directory Should Contain  ${MYOUTDIR}${/}l  l.html
+    Directory Should Contain  ${MYOUTDIR}  l  o  r  s.htm
+
+Timestamped Outputs
+    Verify REBOT Set
+    Run  ${REBOT} --outputdir ${MYOUTDIR} --TimeStampOutputs ${MYINPUT}
+    @{files} =  List Directory  ${MYOUTDIR}
+    Should Be True  len(@{files}) == 2
+    :FOR  ${file}  IN  @{files}
+ \ Fail Unless Regexp Matches ${file} (log| report)-20\\d{6}-\\d{6}\\.html
+
+Timestamped Outputs With Names
+ Run Rebot Without Processing Output --outputdir ${MYOUTDIR} --TimeStampOutputs -l l -r r.html -o o -S s ${MYINPUT}
+    @{files} =  List Directory  ${MYOUTDIR}
+    Should Be True  len(@{files}) == 4
+    :FOR  ${file}  IN  @{files}
+ \ Fail Unless Regexp Matches ${file} (l|o|r| s)-20\\d{6}-\\d{6}\\.(html|xml)
+
+Default Name, Doc & Metadata
+ [Documentation] Using default values (read from xml) for name, doc and metadata. Tests are run together to have less Rebot runs with same input i.e. to have faster execution.
+    Run Rebot  ${EMPTY}  ${MYINPUT}
+    Check Names  ${SUITE}  Normal
+    Check Names  ${SUITE.tests[0]}  First One  Normal.
+    Check Names  ${SUITE.tests[1]}  Second One  Normal.
+    Should Be Equal  ${SUITE.doc}  Normal test cases
+    Should Be Equal  ${SUITE.metadata['Something']}  My Value
+
+Overriding Name, Doc & Metadata And Escaping
+ [Documentation] Overriding name, doc and metadata. Also testing escaping values. Tests are run together to have less Rebot runs with same input i.e. to have faster execution. + Run Rebot -N this_is_overridden_next --name my_COOL_NameEXEX --doc Even_cooooler_docEXQU --metadata something:New --metadata two_parts:three_parts_here -M esc:STQUDOAMHAEXEX --escape star:ST -E quest:QU -E dollar:DO -E amp:AM -E hash:HA -E exclam:EX ${MYINPUT}
+    Check Names  ${SUITE}  my COOL Name!!
+    Check Names  ${SUITE.tests[0]}  First One  my COOL Name!!.
+    Check Names  ${SUITE.tests[1]}  Second One  my COOL Name!!.
+    Should Be Equal  ${SUITE.doc}  Even cooooler doc!?
+    Should Be Equal  ${SUITE.metadata['Something']}  New
+    Should Be Equal  ${SUITE.metadata['two parts']}  three parts here
+    Should Be Equal  ${SUITE.metadata['esc']}  *?$&#!!
+
+Invalid Options
+    Run Rebot Without Processing Output  --invalid option  ${MYINPUT}
+ Check Stderr Contains option --invalid not recognized\n \n Try --help for usage information.
+    Run Rebot Without Processing Output  --name valid -X  ${MYINPUT}
+ Check Stderr Contains option -X not recognized\n \n Try --help for usage information.
+
+It Should Be Possible To Use Wildcards In Datasources
+    Set Test Variable  $OUTPUTNAME  mysuite
+    Copy File  ${MYINPUT}  ${OUTDIR}${/}runningwild-1.xml
+    Copy File  ${MYINPUT}  ${OUTDIR}${/}runningwild-2.xml
+    Run Rebot  ${EMPTY}  ${OUTDIR}${/}*wild-?.xml
+    Should Be True  ${SUITE.suites} == ['Normal'] * 2
+
+No Input
+    Verify REBOT Set
+    ${output} =  Run  ${REBOT} 2>&1
+ Should End With ${output} Expected at least 1 argument, got 0.${USAGE_TIP}
+
+Non-Existing Input
+    Run Rebot Without Processing Output  ${EMPTY}  non-existing.xml
+ Check Stderr Matches Regexp .*Output file '.*[/\\\\]non-existing\\.xml' does not exist.\n\n Try --help for usage information.
+
+Non-XML Input
+    Create File  ${MYOUTDIR}${/}invalid.txt  Hello, world
+ Run Rebot Without Processing Output ${EMPTY} ${MYOUTDIR}${/}invalid.txt + Check Stderr Matches Regexp (\\[Fatal Error\\] .*: Content is not allowed in prolog.\\n)?\\[ ERROR \\] Opening XML file '.*[/\\\\]invalid.txt' failed: .* + Check Syslog Matches Regexp .*| INFO | Traceback (most recent call last):\\n File ".*readers.py", line .*, in process_output.*
+
+Non-Compatible Input
+    [Documentation]  Test handlig xml files not compatible with Robot
+    Create File  ${MYOUTDIR}${/}invalid.xml  <not><our>type</our></not>
+ Run Rebot Without Processing Output ${EMPTY} ${MYOUTDIR}${/}invalid.xml + Check Stderr Matches Regexp \\[ ERROR \\] File '.*[/\\\\]invalid.xml' is not Robot Framework output file.${USAGE_TIP}
+
+Invalid Output Dirs
+ [Documentation] Test error handling when some of the output dirs (where to write output, report, etc.) is invalid (i.e. can't be created). To make sure creating dirs fails their names are non-standard (that's not enough in Linux) parent is made read only.
+    Create Directory  ${MYOUTDIR}${/}x
+    Set Read Only  ${MYOUTDIR}${/}x
+ Run Rebot Without Processing Output --outputdir ${MYOUTDIR}${/}x${/}:i --output default ${MYINPUT} + Check Stderr Matches Regexp \\[ ERROR \\] Can't create output file's parent directory '.*[/\\\\]x[/\\\\]:i\\\\?': (OS|IO| Windows)Error: .*${USAGE_TIP} + Run Rebot Without Processing Output --outputdir ${MYOUTDIR}${/}x${/}hello:world --output none --report default ${MYINPUT} + Check Stderr Matches Regexp \\[ ERROR \\] Can't create report file's parent directory '.*[/\\\\]x[/\\\\]hello:world': (OS|IO| Windows)Error: .*${USAGE_TIP}
+    [Teardown]  Set Read Write  ${MYOUTDIR}${/}x
+
+Invalid Output Files
+ [Documentation] Test error handling when some of the output files (output, report, etc.) is invalid (i.e. can't be opened)
+    Create Directory  ${MYOUTDIR}${/}directory.ext
+ Run Rebot Without Processing Output --outputdir ${MYOUTDIR} --output directory.ext ${MYINPUT} + Check Stderr Matches Regexp \\[ ERROR \\] Opening output file '.*[/\\\\]directory.ext' for writing failed: (IOError| FileNotFoundException): .*${USAGE_TIP} + Run Rebot Without Processing Output --outputdir ${MYOUTDIR} --summary directory.ext --report r.html ${MYINPUT} + Check Stderr Matches Regexp \\[ ERROR \\] Opening summary file '.*[/\\\\]directory.ext' for writing failed: (IOError| FileNotFoundException): .*
+
+Help
+    Verify REBOT Set
+    ${rc}  ${help} =  Run And Return Rc And Output  ${REBOT} --help 2>&1
+    Should Be Equal  ${rc}  ${251}
+    Log  ${help.replace(' ','_').replace('\\t','_'*8)}
+ Should Start With ${help} Rebot -- Robot Framework Report and Log Generator\n \n Version: \ + Should End With ${help} \n\n# Running 'robot/rebot.py' directly and creating combined outputs.\n $ python /path/robot/rebot.py -N Project_X -l x.html -r x.html outputs/*.xml\n
+    Should Not Contain  ${help}  ERROR
+ @{lines} = Evaluate [ '%d\\t%s' % (len(line), line) for line in ${help.splitlines()} ]
+    Log Many  @{lines}
+ @{long} = Evaluate [ line for line in ${help.splitlines()} if len(line) - line.count('\\\\') >= 80 ]
+    Log Many  @{long}
+    Should Be True  len(@{long}) == 0  Too long (>= 80) help line(s)
+    ${help2} =  Run  ${REBOT} -h 2>&1
+    Should Be Equal  ${help}  ${help2}
+
+Version
+    Verify REBOT Set
+ ${rc} ${output} = Run And Return Rc And Output ${REBOT} --version 2>&1
+    Should Be Equal  ${rc}  ${251}
+    Log  ${output}
+ Should Match Regexp ${output} ^Rebot (2\\.\\d+(\\.\\d+)?( (alpha| beta|rc)\\d*)?|trunk 2\\d{7}) \\([PJ]ython 2\\.[\\d.]+ on .+\\)$
+    Should Be True  len("${output}") < 80  Too long version line
+
+Argument File
+    Verify REBOT Set
+ Create File ${MYOUTDIR}${/}a.txt --name From_Arg_File\n -c c1\n # comment line\n --log none\n -r none\n --output ${MYOUTDIR}${/}output.xml\n ${MYINPUT} + ${output} = Run ${REBOT} --critical c2 --argumentfile ${MYOUTDIR}${/}a.txt 2>&1
+    Should Not Contain  ${output}  ERROR
+    Process Output  ${MYOUTDIR}${/}output.xml
+    Should Be Equal  ${SUITE.name}  From Arg File
+    Should Be True  ${SUITE.critical.tags} == []
+
+Setting Syslog File
+    Set Environment Variable  ROBOT_SYSLOG_FILE  ${MYOUTDIR}${/}syslog.txt
+    Rebot Something
+    File Should Not Be Empty  ${MYOUTDIR}${/}syslog.txt
+    Remove File  ${MYOUTDIR}${/}syslog.txt
+    Delete Environment Variable  ROBOT_SYSLOG_FILE
+    Rebot Something
+    File Should Not Exist  ${MYOUTDIR}${/}syslog.txt
+    Set Environment Variable  ROBOT_SYSLOG_FILE  none
+    Rebot Something
+    File Should Not Exist  ${MYOUTDIR}${/}syslog.txt
+
+Setting Syslog Level
+    Set Environment Variable  ROBOT_SYSLOG_FILE  ${MYOUTDIR}${/}syslog.txt
+    Set Environment Variable  ROBOT_SYSLOG_LEVEL  INFO
+    Rebot Something
+    ${size1} =  Get File Size  ${MYOUTDIR}${/}syslog.txt
+    Set Environment Variable  ROBOT_SYSLOG_LEVEL  DEBUG
+    Rebot Something
+    ${size2} =  Get File Size  ${MYOUTDIR}${/}syslog.txt
+    Should Be True  0 < ${size1} <= ${size2}
+    Set Environment Variable  ROBOT_SYSLOG_LEVEL  warn
+    Rebot Something
+    File Should Be Empty  ${MYOUTDIR}${/}syslog.txt
+    [Teardown]  Set Environment Variable  ROBOT_SYSLOG_LEVEL  INFO
+
+Correct RC When Invalid Data
+    ${rc} =  Run And Return Rc  ${REBOT} 2>&1
+    Should Be Equal  ${rc}  ${252}
+
+Invalid Argument Values
+ Run Rebot --splitoutputs not_int --suitestatlevel not_int --tagstatlink less_than_3x_: ${MYINPUT} + Verify Correct Errors in Stderr Option '--suitestatlevel' expected integer value but got 'not_int'. Default value used instead.\n + Verify Correct Errors in Stderr Option '--splitoutputs' expected integer value but got 'not_int'. Default value used instead.\n + Verify Correct Errors in Stderr Invalid format for option '--tagstatlink'. Expected 'tag:link:title' but got 'less_than_3x_:'.\n
+    Should Be Equal  ${SUITE.status}  PASS
+
+*** Keywords ***
+My Setup
+    Run Tests Without Processing Output  ${EMPTY}  ${TESTFILE}
+    Move File  ${OUTFILE}  ${MYINPUT}
+    Create Directory  ${MYOUTDIR}
+
+Remove Temps
+    Remove Directory  ${MYOUTDIR}  recursively
+    Remove File  ${MYINPUT}
+
+Directory Should Contain
+    [Arguments]  ${dir_path}  @{exp_files}
+    ${act_files} =  List Directory  ${dir_path}
+    Should Be Equal  ${act_files}  ${exp_files}
+
+Test Critical
+ [Arguments] ${opts} ${input} ${status} ${msg} ${crit_tags} ${crit1} ${crit2}
+    Set Suite Variable  $SUITE  ${None}
+    Run Rebot  ${opts}  ${input}
+    Should Be Equal  ${SUITE.status}  ${status}
+    Should Be Equal  ${SUITE.get_full_message()}  ${msg}
+    Should Be True  ${SUITE.critical_tags} == ${crit_tags}
+    Should Be Equal  ${SUITE.tests[0].critical}  ${crit1}
+    Should Be Equal  ${SUITE.tests[1].critical}  ${crit2}
+
+Verify REBOT Set
+ Should Not Be Equal ${REBOT} \ This test can be run only after \${REBOT} is set No Values
+
+Rebot Something
+    Verify REBOT Set
+    Run  ${REBOT} --outputdir ${MYOUTDIR} ${MYINPUT}
+
+Verify Correct Errors In Stderr
+    [Arguments]  @{messages}
+    ${error} =  Set Variable If  os.sep=='/'  ERROR  [ ERROR ]
+    Check Stderr Contains  ${error}
+    Check Stderr Contains  @{messages}
+
=======================================
--- /trunk/atest/robot/rebot/commandline.txt    Wed May 26 04:57:50 2010
+++ /dev/null
@@ -1,251 +0,0 @@
-*** Settings ***
-Documentation Testing Rebot's command line functionality. Functionality tested elsewere:\n - filtering by tags/names\n - combining outputs\n - creating correct html (incl. --xxxtitle options)
-Suite Setup     My Setup
-Suite Teardown  Remove Temps
-Test Setup      Empty Directory  ${MYOUTDIR}
-Force Tags      regression  pybot  jybot
-Resource        atest_resource.txt
-
-*** Variables ***
-${TESTFILE}  misc${/}normal.html
-${PASS_FAIL_FILE}  misc${/}pass_and_fail.html
-${MYOUTDIR}  ${TEMPDIR}${/}robot-test-145435
-${MYINPUT}  ${TEMPDIR}${/}robot-test-145435.xml
-${M_211_211} 2 critical tests, 1 passed, 1 failed\n 2 tests total, 1 passed, 1 failed -${M_110_211} 1 critical test, 1 passed, 0 failed\n 2 tests total, 1 passed, 1 failed -${M_101_211} 1 critical test, 0 passed, 1 failed\n 2 tests total, 1 passed, 1 failed -${M_000_211} 0 critical tests, 0 passed, 0 failed\n 2 tests total, 1 passed, 1 failed
-${USAGE_TIP}  \n\nTry --help for usage information.
-
-*** Test Cases ***
-Output Only
- Run Rebot Without Processing Output --outputdir ${MYOUTDIR} --output myoutput.xml --log none --report none ${MYINPUT}
-    Directory Should Contain  ${MYOUTDIR}  myoutput.xml
-
-Report Only
- Run Rebot Without Processing Output --outputdir ${MYOUTDIR} --output none --report myreport.html --log NONE --summary none ${MYINPUT}
-    Directory Should Contain  ${MYOUTDIR}  myreport.html
-
-Log Only
- Run Rebot Without Processing Output --outputdir ${MYOUTDIR} --output None --report NONE --log mylog.html -S none ${MYINPUT}
-    Directory Should Contain  ${MYOUTDIR}  mylog.html
-
-Summary Only
- Run Rebot Without Processing Output --outputdir ${MYOUTDIR} -o none --summary mysummary.html -l none -r NONE ${MYINPUT}
-    Directory Should Contain  ${MYOUTDIR}  mysummary.html
-
-All Outputs
- Run Rebot Without Processing Output --outputdir ${MYOUTDIR} --output myoutput.xml --report myreport.html --log mylog.html -S mysummary.html ${MYINPUT} - Directory Should Contain ${MYOUTDIR} mylog.html myoutput.xml myreport.html mysummary.html
-
-All Outputs With Default Names
-    Verify REBOT Set
-    Run  ${REBOT} --outputdir ${MYOUTDIR} ${MYINPUT}
-    Directory Should Contain  ${MYOUTDIR}  log.html  report.html
-
-All Outputs Without Extensions
- Run Rebot Without Processing Output --outputdir ${MYOUTDIR} -o myoutput -r myreport -l mylog --summary mysummary ${MYINPUT} - Directory Should Contain ${MYOUTDIR} mylog.html myoutput.xml myreport.html mysummary.html
-
-Outputs Into Different Dirs
- Run Rebot Without Processing Output --outputdir ::invalid:: -o ${MYOUTDIR}${/}o${/}o.xml -r ${MYOUTDIR}${/}r${/}r.html -l ${MYOUTDIR}${/}l${/}l.html --summary ${MYOUTDIR}${/}s.htm ${MYINPUT}
-    Directory Should Contain  ${MYOUTDIR}${/}o  o.xml
-    Directory Should Contain  ${MYOUTDIR}${/}r  r.html
-    Directory Should Contain  ${MYOUTDIR}${/}l  l.html
-    Directory Should Contain  ${MYOUTDIR}  l  o  r  s.htm
-
-Timestamped Outputs
-    Verify REBOT Set
-    Run  ${REBOT} --outputdir ${MYOUTDIR} --TimeStampOutputs ${MYINPUT}
-    @{files} =  List Directory  ${MYOUTDIR}
-    Should Be True  len(@{files}) == 2
-    :FOR  ${file}  IN  @{files}
- \ Fail Unless Regexp Matches ${file} (log| report)-20\\d{6}-\\d{6}\\.html
-
-Timestamped Outputs With Names
- Run Rebot Without Processing Output --outputdir ${MYOUTDIR} --TimeStampOutputs -l l -r r.html -o o -S s ${MYINPUT}
-    @{files} =  List Directory  ${MYOUTDIR}
-    Should Be True  len(@{files}) == 4
-    :FOR  ${file}  IN  @{files}
- \ Fail Unless Regexp Matches ${file} (l|o|r| s)-20\\d{6}-\\d{6}\\.(html|xml)
-
-Default Name, Doc & Metadata
- [Documentation] Using default values (read from xml) for name, doc and metadata. Tests are run together to have less Rebot runs with same input i.e. to have faster execution.
-    Run Rebot  ${EMPTY}  ${MYINPUT}
-    Check Names  ${SUITE}  Normal
-    Check Names  ${SUITE.tests[0]}  First One  Normal.
-    Check Names  ${SUITE.tests[1]}  Second One  Normal.
-    Should Be Equal  ${SUITE.doc}  Normal test cases
-    Should Be Equal  ${SUITE.metadata['Something']}  My Value
-
-Overriding Name, Doc & Metadata And Escaping
- [Documentation] Overriding name, doc and metadata. Also testing escaping values. Tests are run together to have less Rebot runs with same input i.e. to have faster execution. - Run Rebot -N this_is_overridden_next --name my_COOL_NameEXEX --doc Even_cooooler_docEXQU --metadata something:New --metadata two_parts:three_parts_here -M esc:STQUDOAMHAEXEX --escape star:ST -E quest:QU -E dollar:DO -E amp:AM -E hash:HA -E exclam:EX ${MYINPUT}
-    Check Names  ${SUITE}  my COOL Name!!
-    Check Names  ${SUITE.tests[0]}  First One  my COOL Name!!.
-    Check Names  ${SUITE.tests[1]}  Second One  my COOL Name!!.
-    Should Be Equal  ${SUITE.doc}  Even cooooler doc!?
-    Should Be Equal  ${SUITE.metadata['Something']}  New
-    Should Be Equal  ${SUITE.metadata['two parts']}  three parts here
-    Should Be Equal  ${SUITE.metadata['esc']}  *?$&#!!
-
-Invalid Options
-    Run Rebot Without Processing Output  --invalid option  ${MYINPUT}
- Check Stderr Contains option --invalid not recognized\n \n Try --help for usage information.
-    Run Rebot Without Processing Output  --name valid -X  ${MYINPUT}
- Check Stderr Contains option -X not recognized\n \n Try --help for usage information.
-
-It Should Be Possible To Use Wildcards In Datasources
-    Set Test Variable  $OUTPUTNAME  mysuite
-    Copy File  ${MYINPUT}  ${OUTDIR}${/}runningwild-1.xml
-    Copy File  ${MYINPUT}  ${OUTDIR}${/}runningwild-2.xml
-    Run Rebot  ${EMPTY}  ${OUTDIR}${/}*wild-?.xml
-    Should Be True  ${SUITE.suites} == ['Normal'] * 2
-
-No Input
-    Verify REBOT Set
-    ${output} =  Run  ${REBOT} 2>&1
- Should End With ${output} Expected at least 1 argument, got 0.${USAGE_TIP}
-
-Non-Existing Input
-    Run Rebot Without Processing Output  ${EMPTY}  non-existing.xml
- Check Stderr Matches Regexp .*Output file '.*[/\\\\]non-existing\\.xml' does not exist.\n\n Try --help for usage information.
-
-Non-XML Input
-    Create File  ${MYOUTDIR}${/}invalid.txt  Hello, world
- Run Rebot Without Processing Output ${EMPTY} ${MYOUTDIR}${/}invalid.txt - Check Stderr Matches Regexp (\\[Fatal Error\\] .*: Content is not allowed in prolog.\\n)?\\[ ERROR \\] Opening XML file '.*[/\\\\]invalid.txt' failed: .* - Check Syslog Matches Regexp .*| INFO | Traceback (most recent call last):\\n File ".*readers.py", line .*, in process_output.*
-
-Non-Compatible Input
-    [Documentation]  Test handlig xml files not compatible with Robot
-    Create File  ${MYOUTDIR}${/}invalid.xml  <not><our>type</our></not>
- Run Rebot Without Processing Output ${EMPTY} ${MYOUTDIR}${/}invalid.xml - Check Stderr Matches Regexp \\[ ERROR \\] File '.*[/\\\\]invalid.xml' is not Robot Framework output file.${USAGE_TIP}
-
-Invalid Output Dirs
- [Documentation] Test error handling when some of the output dirs (where to write output, report, etc.) is invalid (i.e. can't be created). To make sure creating dirs fails their names are non-standard (that's not enough in Linux) parent is made read only.
-    Create Directory  ${MYOUTDIR}${/}x
-    Set Read Only  ${MYOUTDIR}${/}x
- Run Rebot Without Processing Output --outputdir ${MYOUTDIR}${/}x${/}:i --output default ${MYINPUT} - Check Stderr Matches Regexp \\[ ERROR \\] Can't create output file's parent directory '.*[/\\\\]x[/\\\\]:i\\\\?': (OS|IO| Windows)Error: .*${USAGE_TIP} - Run Rebot Without Processing Output --outputdir ${MYOUTDIR}${/}x${/}hello:world --output none --report default ${MYINPUT} - Check Stderr Matches Regexp \\[ ERROR \\] Can't create report file's parent directory '.*[/\\\\]x[/\\\\]hello:world': (OS|IO| Windows)Error: .*${USAGE_TIP}
-    [Teardown]  Set Read Write  ${MYOUTDIR}${/}x
-
-Invalid Output Files
- [Documentation] Test error handling when some of the output files (output, report, etc.) is invalid (i.e. can't be opened)
-    Create Directory  ${MYOUTDIR}${/}directory.ext
- Run Rebot Without Processing Output --outputdir ${MYOUTDIR} --output directory.ext ${MYINPUT} - Check Stderr Matches Regexp \\[ ERROR \\] Opening output file '.*[/\\\\]directory.ext' for writing failed: (IOError| FileNotFoundException): .*${USAGE_TIP} - Run Rebot Without Processing Output --outputdir ${MYOUTDIR} --summary directory.ext --report r.html ${MYINPUT} - Check Stderr Matches Regexp \\[ ERROR \\] Opening summary file '.*[/\\\\]directory.ext' for writing failed: (IOError| FileNotFoundException): .*
-
-Help
-    Verify REBOT Set
-    ${rc}  ${help} =  Run And Return Rc And Output  ${REBOT} --help 2>&1
-    Should Be Equal  ${rc}  ${251}
-    Log  ${help.replace(' ','_').replace('\\t','_'*8)}
- Should Start With ${help} Rebot -- Robot Framework Report and Log Generator\n \n Version: \ - Should End With ${help} \n\n# Running 'robot/rebot.py' directly and creating combined outputs.\n $ python /path/robot/rebot.py -N Project_X -l x.html -r x.html outputs/*.xml\n
-    Should Not Contain  ${help}  ERROR
- @{lines} = Evaluate [ '%d\\t%s' % (len(line), line) for line in ${help.splitlines()} ]
-    Log Many  @{lines}
- @{long} = Evaluate [ line for line in ${help.splitlines()} if len(line) - line.count('\\\\') >= 80 ]
-    Log Many  @{long}
-    Should Be True  len(@{long}) == 0  Too long (>= 80) help line(s)
-    ${help2} =  Run  ${REBOT} -h 2>&1
-    Should Be Equal  ${help}  ${help2}
-
-Version
-    Verify REBOT Set
- ${rc} ${output} = Run And Return Rc And Output ${REBOT} --version 2>&1
-    Should Be Equal  ${rc}  ${251}
-    Log  ${output}
- Should Match Regexp ${output} ^Rebot (2\\.\\d+(\\.\\d+)?( (alpha| beta|rc)\\d*)?|trunk 2\\d{7}) \\([PJ]ython 2\\.[\\d.]+ on .+\\)$
-    Should Be True  len("${output}") < 80  Too long version line
-
-Argument File
-    Verify REBOT Set
- Create File ${MYOUTDIR}${/}a.txt --name From_Arg_File\n -c c1\n # comment line\n --log none\n -r none\n --output ${MYOUTDIR}${/}output.xml\n ${MYINPUT} - ${output} = Run ${REBOT} --critical c2 --argumentfile ${MYOUTDIR}${/}a.txt 2>&1
-    Should Not Contain  ${output}  ERROR
-    Process Output  ${MYOUTDIR}${/}output.xml
-    Should Be Equal  ${SUITE.name}  From Arg File
-    Should Be True  ${SUITE.critical.tags} == []
-
-Setting Syslog File
-    Set Environment Variable  ROBOT_SYSLOG_FILE  ${MYOUTDIR}${/}syslog.txt
-    Rebot Something
-    File Should Not Be Empty  ${MYOUTDIR}${/}syslog.txt
-    Remove File  ${MYOUTDIR}${/}syslog.txt
-    Delete Environment Variable  ROBOT_SYSLOG_FILE
-    Rebot Something
-    File Should Not Exist  ${MYOUTDIR}${/}syslog.txt
-    Set Environment Variable  ROBOT_SYSLOG_FILE  none
-    Rebot Something
-    File Should Not Exist  ${MYOUTDIR}${/}syslog.txt
-
-Setting Syslog Level
-    Set Environment Variable  ROBOT_SYSLOG_FILE  ${MYOUTDIR}${/}syslog.txt
-    Set Environment Variable  ROBOT_SYSLOG_LEVEL  INFO
-    Rebot Something
-    ${size1} =  Get File Size  ${MYOUTDIR}${/}syslog.txt
-    Set Environment Variable  ROBOT_SYSLOG_LEVEL  DEBUG
-    Rebot Something
-    ${size2} =  Get File Size  ${MYOUTDIR}${/}syslog.txt
-    Should Be True  0 < ${size1} <= ${size2}
-    Set Environment Variable  ROBOT_SYSLOG_LEVEL  warn
-    Rebot Something
-    File Should Be Empty  ${MYOUTDIR}${/}syslog.txt
-    [Teardown]  Set Environment Variable  ROBOT_SYSLOG_LEVEL  INFO
-
-Correct RC When Invalid Data
-    ${rc} =  Run And Return Rc  ${REBOT} 2>&1
-    Should Be Equal  ${rc}  ${252}
-
-Invalid Argument Values
- Run Rebot --splitoutputs not_int --suitestatlevel not_int --tagstatlink less_than_3x_: ${MYINPUT} - Verify Correct Errors in Stderr Option '--suitestatlevel' expected integer value but got 'not_int'. Default value used instead.\n - Verify Correct Errors in Stderr Option '--splitoutputs' expected integer value but got 'not_int'. Default value used instead.\n - Verify Correct Errors in Stderr Invalid format for option '--tagstatlink'. Expected 'tag:link:title' but got 'less_than_3x_:'.\n
-    Should Be Equal  ${SUITE.status}  PASS
-
-*** Keywords ***
-My Setup
-    Run Tests Without Processing Output  ${EMPTY}  ${TESTFILE}
-    Move File  ${OUTFILE}  ${MYINPUT}
-    Create Directory  ${MYOUTDIR}
-
-Remove Temps
-    Remove Directory  ${MYOUTDIR}  recursively
-    Remove File  ${MYINPUT}
-
-Directory Should Contain
-    [Arguments]  ${dir_path}  @{exp_files}
-    ${act_files} =  List Directory  ${dir_path}
-    Should Be Equal  ${act_files}  ${exp_files}
-
-Test Critical
- [Arguments] ${opts} ${input} ${status} ${msg} ${crit_tags} ${crit1} ${crit2}
-    Set Suite Variable  $SUITE  ${None}
-    Run Rebot  ${opts}  ${input}
-    Should Be Equal  ${SUITE.status}  ${status}
-    Should Be Equal  ${SUITE.get_full_message()}  ${msg}
-    Should Be True  ${SUITE.critical_tags} == ${crit_tags}
-    Should Be Equal  ${SUITE.tests[0].critical}  ${crit1}
-    Should Be Equal  ${SUITE.tests[1].critical}  ${crit2}
-
-Verify REBOT Set
- Should Not Be Equal ${REBOT} \ This test can be run only after \${REBOT} is set No Values
-
-Rebot Something
-    Verify REBOT Set
-    Run  ${REBOT} --outputdir ${MYOUTDIR} ${MYINPUT}
-
-Verify Correct Errors In Stderr
-    [Arguments]  @{messages}
-    ${error} =  Set Variable If  os.sep=='/'  ERROR  [ ERROR ]
-    Check Stderr Contains  ${error}
-    Check Stderr Contains  @{messages}
-

Reply via email to