2 new revisions:
Revision: e24ad5fba872
Branch: default
Author: Tatu Kairi <[email protected]>
Date: Thu May 30 01:54:46 2013
Log: Settings: Only log file is disabled if output is disabled...
http://code.google.com/p/robotframework/source/detail?r=e24ad5fba872
Revision: 744b17a35549
Branch: default
Author: Tatu Kairi <[email protected]>
Date: Thu May 30 01:54:57 2013
Log: Automated merge with https://code.google.com/p/robotframework/
http://code.google.com/p/robotframework/source/detail?r=744b17a35549
==============================================================================
Revision: e24ad5fba872
Branch: default
Author: Tatu Kairi <[email protected]>
Date: Thu May 30 01:54:46 2013
Log: Settings: Only log file is disabled if output is disabled
Update issue 1444
Status: review
Implemented with tests.
http://code.google.com/p/robotframework/source/detail?r=e24ad5fba872
Modified:
/atest/robot/cli/runner/output_files.txt
/src/robot/conf/settings.py
=======================================
--- /atest/robot/cli/runner/output_files.txt Mon Jun 25 07:16:13 2012
+++ /atest/robot/cli/runner/output_files.txt Thu May 30 01:54:46 2013
@@ -7,26 +7,29 @@
*** Test Cases ***
Output Only
- Run Tests Without Processing Output --outputdir ${CLI OUTDIR}
--output myoutput.xml --report none --log none ${TESTFILE}
+ Run Tests Without Processing Output --outputdir ${CLI OUTDIR}
--output myoutput.xml --report none --log none ${TESTFILE}
Output Directory Should Contain myoutput.xml
Output And Report
- Run Tests Without Processing Output --outputdir ${CLI OUTDIR}
--output myoutput.xml --report myreport.html --log none ${TESTFILE}
+ Run Tests Without Processing Output --outputdir ${CLI OUTDIR}
--output myoutput.xml --report myreport.html --log none ${TESTFILE}
Output Directory Should Contain myoutput.xml myreport.html
Output And Log
- Run Tests Without Processing Output --outputdir ${CLI OUTDIR}
--output myoutput.xml --report none --log mylog.html ${TESTFILE}
+ Run Tests Without Processing Output --outputdir ${CLI OUTDIR}
--output myoutput.xml --report none --log mylog.html ${TESTFILE}
Output Directory Should Contain mylog.html myoutput.xml
-Output Disabled with NONE
- Remove File NONE
- Run Tests Without Processing Output --outputdir ${CLI OUTDIR} -o NONE
-r None -l none ${TESTFILE}
- Output Directory Should Be Empty
- File Should Not Exist NONE
+Disabling output XML only disables log with a warning
+ Run Tests Without Processing Output --outputdir ${CLI OUTDIR} -o nOnE
-r report.html -l mylog.html ${TESTFILE}
+ Output Directory Should Contain report.html
+ Check Stderr Matches Regexp \\[ ERROR \\] Log file is not created
if output.xml is disabled.
+
+All output files disabled
+ Run Tests Without Processing Output --outputdir ${CLI OUTDIR} -o nOnE
-r NONE -l none ${TESTFILE}
+ Directory Should Be Empty ${CLI OUTDIR}
-Debugfile Can Be Created When Output Is NONE
- Run Tests Without Processing Output --outputdir ${CLI OUTDIR} -o NONE
-r report.html -b debug.txt ${TESTFILE}
- Output Directory Should Contain debug.txt
+Debug, Xunit And Report File Can Be Created When Output Is NONE
+ Run Tests Without Processing Output --outputdir ${CLI OUTDIR} -o NONE
-r myreport.html -b mydebug.txt -x myxunit.xml ${TESTFILE}
+ Output Directory Should Contain mydebug.txt myreport.html
myxunit.xml
All Outputs
Run Tests Without Processing Output --outputdir=${CLI OUTDIR}
--output=myoutput.xml --report=myreport.html --log=mylog.html ${TESTFILE}
@@ -75,3 +78,4 @@
Check Stdout Contains Output:
Check Stdout Does Not Contain Log:
Check Stdout Contains Report:
+
=======================================
--- /src/robot/conf/settings.py Wed May 29 02:23:46 2013
+++ /src/robot/conf/settings.py Thu May 30 01:54:46 2013
@@ -151,17 +151,21 @@
return self._get_output_file(name)
return self._opts[name]
- def _get_output_file(self, type_):
+ def _get_output_file(self, option):
"""Returns path of the requested output file and creates needed
dirs.
- `type_` can be 'Output', 'Log', 'Report', 'DebugFile'
or 'XUnitFile'.
+ `option` can be 'Output', 'Log', 'Report', 'DebugFile'
or 'XUnitFile'.
"""
- name = self._opts[type_]
- if self._outputfile_disabled(type_, name):
+ value = self._opts[option]
+ if value == 'NONE':
return 'NONE'
- name = self._process_output_name(name, type_)
- path = utils.abspath(os.path.join(self['OutputDir'], name))
- self._create_output_dir(os.path.dirname(path), type_)
+ if option == 'Log' and self._output_disabled():
+ self['Log'] = 'NONE'
+ LOGGER.error('Log file is not created if output.xml is
disabled.')
+ return 'NONE'
+ value = self._process_output_name(value, option)
+ path = utils.abspath(os.path.join(self['OutputDir'], value))
+ self._create_output_dir(os.path.dirname(path), option)
return path
def _process_output_name(self, name, type_):
@@ -320,10 +324,8 @@
settings._opts['ProcessEmptySuite'] = self['RunEmptySuite']
return settings
- def _outputfile_disabled(self, type_, name):
- if name == 'NONE':
- return True
- return self._opts['Output'] == 'NONE' and type_ != 'DebugFile'
+ def _output_disabled(self):
+ return self.output is None
def _escape(self, value):
return utils.escape(value)
@@ -375,8 +377,8 @@
'EndTime' : ('endtime', None),
'RunFailed' : ('runfailed', 'NONE')}
- def _outputfile_disabled(self, type_, name):
- return name == 'NONE'
+ def _output_disabled(self):
+ return False
def _escape(self, value):
return value
==============================================================================
Revision: 744b17a35549
Branch: default
Author: Tatu Kairi <[email protected]>
Date: Thu May 30 01:54:57 2013
Log: Automated merge with https://code.google.com/p/robotframework/
http://code.google.com/p/robotframework/source/detail?r=744b17a35549
Modified:
/src/robot/conf/settings.py
=======================================
--- /src/robot/conf/settings.py Wed May 29 05:05:22 2013
+++ /src/robot/conf/settings.py Thu May 30 01:54:57 2013
@@ -152,17 +152,21 @@
return self._get_output_file(name)
return self._opts[name]
- def _get_output_file(self, type_):
+ def _get_output_file(self, option):
"""Returns path of the requested output file and creates needed
dirs.
- `type_` can be 'Output', 'Log', 'Report', 'DebugFile'
or 'XUnitFile'.
+ `option` can be 'Output', 'Log', 'Report', 'DebugFile'
or 'XUnitFile'.
"""
- name = self._opts[type_]
- if self._outputfile_disabled(type_, name):
+ value = self._opts[option]
+ if value == 'NONE':
return 'NONE'
- name = self._process_output_name(name, type_)
- path = utils.abspath(os.path.join(self['OutputDir'], name))
- self._create_output_dir(os.path.dirname(path), type_)
+ if option == 'Log' and self._output_disabled():
+ self['Log'] = 'NONE'
+ LOGGER.error('Log file is not created if output.xml is
disabled.')
+ return 'NONE'
+ value = self._process_output_name(value, option)
+ path = utils.abspath(os.path.join(self['OutputDir'], value))
+ self._create_output_dir(os.path.dirname(path), option)
return path
def _process_output_name(self, name, type_):
@@ -321,10 +325,8 @@
settings._opts['ProcessEmptySuite'] = self['RunEmptySuite']
return settings
- def _outputfile_disabled(self, type_, name):
- if name == 'NONE':
- return True
- return self._opts['Output'] == 'NONE' and type_ != 'DebugFile'
+ def _output_disabled(self):
+ return self.output is None
def _escape(self, value):
return utils.escape(value)
@@ -381,8 +383,8 @@
'EndTime' : ('endtime', None),
'RunFailed' : ('runfailed', 'NONE')}
- def _outputfile_disabled(self, type_, name):
- return name == 'NONE'
+ def _output_disabled(self):
+ return False
def _escape(self, value):
return value
--
---
You received this message because you are subscribed to the Google Groups "robotframework-commit" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.