2 new revisions:
Revision: af768e4f1418
Branch: default
Author: Pekka Klärck
Date: Mon Jan 7 12:10:29 2013
Log: consistent tool explanations
http://code.google.com/p/robotframework/source/detail?r=af768e4f1418
Revision: 39489a66a8f9
Branch: default
Author: Pekka Klärck
Date: Mon Jan 7 12:34:02 2013
Log: Libdoc: Remove partially created output on failure....
http://code.google.com/p/robotframework/source/detail?r=39489a66a8f9
==============================================================================
Revision: af768e4f1418
Branch: default
Author: Pekka Klärck
Date: Mon Jan 7 12:10:29 2013
Log: consistent tool explanations
http://code.google.com/p/robotframework/source/detail?r=af768e4f1418
Modified:
/atest/robot/cli/rebot/help_and_version.txt
/atest/robot/cli/runner/help_and_version.txt
/src/robot/rebot.py
/src/robot/run.py
/src/robot/tidy.py
=======================================
--- /atest/robot/cli/rebot/help_and_version.txt Thu Jun 7 05:47:11 2012
+++ /atest/robot/cli/rebot/help_and_version.txt Mon Jan 7 12:10:29 2013
@@ -10,7 +10,7 @@
${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 Start With ${help} Rebot -- Robot Framework report and log
generator\n\nVersion: \
Should End With ${help} \n$ jython path/robot/rebot.py -N Project_X
-l none -r x.html output.xml\n
Should Not Contain ${help} ERROR
=======================================
--- /atest/robot/cli/runner/help_and_version.txt Tue Jan 1 15:05:02 2013
+++ /atest/robot/cli/runner/help_and_version.txt Mon Jan 7 12:10:29 2013
@@ -2,18 +2,16 @@
Default Tags regression pybot jybot
Resource cli_resource.txt
-
*** Test Cases ***
-
Help
Set Runners
${rc} ${help} = Run And Return Rc And Output ${ROBOT} --help
Should Be Equal ${rc} ${251}
Log ${help.replace(' ','_')}
Should Not Contain ${help} \t
- Should Start With ${help} Robot Framework -- A keyword-driven test
automation framework\n\nVersion: \
- Should End With ${help} \n\n# Setting syslog file before running
tests.\n $ export ROBOT_SYSLOG_FILE=/tmp/syslog.txt\n $ pybot tests.tsv\n
+ Should Start With ${help} Robot Framework -- A generic test
automation framework\n\nVersion: \
+ Should End With ${help} \n\n# Setting syslog file before running
tests.\n$ export ROBOT_SYSLOG_FILE=/tmp/syslog.txt\n$ pybot tests.tsv\n
Should Not Contain ${help} [ ERROR ]
Should Not Contain ${help} [ WARN \ ]
@{lines} = Evaluate [ '%d\\t%s' % (len(line), line) for line in
${help.splitlines()} ]
=======================================
--- /src/robot/rebot.py Tue Jan 1 15:03:51 2013
+++ /src/robot/rebot.py Mon Jan 7 12:10:29 2013
@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-USAGE = """Rebot -- Robot Framework Report and Log Generator
+USAGE = """Rebot -- Robot Framework report and log generator
Version: <VERSION>
=======================================
--- /src/robot/run.py Tue Jan 1 15:03:51 2013
+++ /src/robot/run.py Mon Jan 7 12:10:29 2013
@@ -14,14 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-USAGE = """Robot Framework -- A keyword-driven test automation framework
+USAGE = """Robot Framework -- A generic test automation framework
Version: <VERSION>
Usage: pybot|jybot|ipybot [options] data_sources
or: python|jython|ipy -m robot.run [options] data_sources
or: python|jython|ipy path/to/robot/run.py [options] data_sources
- or: java -jar robotframework.jar [options] data_sources
+ or: java -jar robotframework.jar run [options] data_sources
Robot Framework is a Python-based keyword-driven test automation framework
for
acceptance level testing and acceptance test-driven development (ATDD). It
has
=======================================
--- /src/robot/tidy.py Sun Dec 30 12:29:04 2012
+++ /src/robot/tidy.py Mon Jan 7 12:10:29 2013
@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-USAGE = """robot.tidy -- Robot Framework test data clean-up tool.
+USAGE = """robot.tidy -- Robot Framework test data clean-up tool
Version: <VERSION>
==============================================================================
Revision: 39489a66a8f9
Branch: default
Author: Pekka Klärck
Date: Mon Jan 7 12:34:02 2013
Log: Libdoc: Remove partially created output on failure.
Update issue 1323
Status: Done
Owner: pekka.klarck
Fixed. Tests for invalid usage also enhanced to check that no output file
is created.
No there shouldn't be any out.html files left from Robot's own acceptance
tests.
http://code.google.com/p/robotframework/source/detail?r=39489a66a8f9
Modified:
/atest/robot/libdoc/invalid_usage.txt
/src/robot/libdocpkg/htmlwriter.py
/src/robot/libdocpkg/output.py
=======================================
--- /atest/robot/libdoc/invalid_usage.txt Thu Oct 11 04:09:25 2012
+++ /atest/robot/libdoc/invalid_usage.txt Mon Jan 7 12:34:02 2013
@@ -1,8 +1,9 @@
*** Settings ***
Force Tags regression pybot jybot
Resource libdoc_resource.txt
+Test Setup Remove File ${OUT HTML}
Test Template Run libdoc and verify error
-
+Test Teardown Should Not Exist ${OUT HTML}
*** Variable ***
${USAGE TIP} \nTry --help for usage information.\n
@@ -22,35 +23,37 @@
--invalid option --invalid not recognized
Invalid format
- -f XXX BuiltIn out.html Format must be 'HTML' or 'XML', got 'XXX'.
+ -f XXX BuiltIn ${OUT HTML} Format must be 'HTML' or 'XML',
got 'XXX'.
BuiltIn out.ext Format must be 'HTML' or 'XML', got 'EXT'.
Invalid doc format
- --docformat inv BuiltIn out.html Doc format must
be 'ROBOT', 'TEXT', 'HTML' or 'REST', got 'INV'.
+ --docformat inv BuiltIn ${OUT HTML} Doc format must
be 'ROBOT', 'TEXT', 'HTML' or 'REST', got 'INV'.
Invalid doc format in library
- ${TESTDATADIR}/DocFormatInvalid.py out.html Invalid documentation
format 'INVALID'.
+ ${TESTDATADIR}/DocFormatInvalid.py ${OUT HTML} Invalid documentation
format 'INVALID'.
Non-existing library
- NonExistingLib out.html Importing test library 'NonExistingLib'
failed: *
+ NonExistingLib ${OUT HTML} Importing test library 'NonExistingLib'
failed: *
Non-existing spec
- nonex.xml out.html Spec file 'nonex.xml' does not exist.
+ nonex.xml ${OUT HTML} Spec file 'nonex.xml' does not exist.
Invalid spec
- [Setup] Create File ${OUTXML} <wrong/>
- ${OUTXML} out.html Invalid spec file '${OUTXML}'.
- [Teardown] Remove File ${OUTXML}
+ [Setup] Create File ${OUT XML} <wrong/>
+ ${OUT XML} ${OUT HTML} Invalid spec file '${OUT XML}'.
+ [Teardown] Remove File ${OUT XML}
Non-XML spec
- [Setup] Create File ${OUTXML} very wrong
- ${OUTXML} out.html Building library '${OUTXML}' failed: *
- [Teardown] Remove File ${OUTXML}
+ [Setup] Create File ${OUT XML} very wrong
+ ${OUTXML} ${OUT HTML} Building library '${OUT XML}' failed: *
+ [Teardown] Remove File ${OUT XML}
Invalid resource
- ${CURDIR}/invalid_usage.txt out.html
+ ${CURDIR}/invalid_usage.txt ${OUT HTML}
... [ ERROR ] *: Non-existing setting 'Force Tags'.
+ ... [ ERROR ] *: Non-existing setting 'Test Setup'.
... [ ERROR ] *: Non-existing setting 'Test Template'.
+ ... [ ERROR ] *: Non-existing setting 'Test Teardown'.
... Resource file '*' contains a test case table which is not
allowed.
=======================================
--- /src/robot/libdocpkg/htmlwriter.py Fri Dec 28 03:58:38 2012
+++ /src/robot/libdocpkg/htmlwriter.py Mon Jan 7 12:34:02 2013
@@ -31,7 +31,8 @@
def __init__(self, output, libdoc):
self._output = output
- self._libdoc = libdoc
+ formatter = DocFormatter(libdoc.keywords, libdoc.doc,
libdoc.doc_format)
+ self._libdoc = JsonConverter(formatter).convert(libdoc)
def write(self, line):
self._output.write('<script type="text/javascript">' + os.linesep)
@@ -39,10 +40,7 @@
self._output.write('</script>' + os.linesep)
def write_data(self):
- formatter = DocFormatter(self._libdoc.keywords, self._libdoc.doc,
- self._libdoc.doc_format)
- libdoc = JsonConverter(formatter).convert(self._libdoc)
- JsonWriter(self._output).write_json('libdoc = ', libdoc)
+ JsonWriter(self._output).write_json('libdoc = ', self._libdoc)
class JsonConverter(object):
@@ -81,7 +79,7 @@
def __init__(self, keywords, introduction, doc_format='ROBOT'):
self._doc_to_html = DocToHtml(doc_format)
self._targets = self._get_targets(keywords, introduction,
- doc_format == 'ROBOT')
+ robot_format=doc_format=='ROBOT')
def _get_targets(self, keywords, introduction, robot_format):
targets = utils.NormalizedDict({
@@ -123,7 +121,6 @@
def __init__(self, format):
self._formatter = self._get_formatter(format)
-
def _get_formatter(self, format):
try:
return {'ROBOT': utils.html_format,
=======================================
--- /src/robot/libdocpkg/output.py Thu Feb 16 05:23:27 2012
+++ /src/robot/libdocpkg/output.py Mon Jan 7 12:34:02 2013
@@ -13,6 +13,7 @@
# limitations under the License.
import codecs
+import os
class LibdocOutput(object):
@@ -31,3 +32,5 @@
def __exit__(self, *exc_info):
if self._output_file:
self._output_file.close()
+ if exc_info:
+ os.remove(self._output_path)