5 new revisions:

Revision: 6351d4cbc084
Branch:   default
Author:   Robot Framework Developers ([email protected])
Date:     Tue May 28 06:00:22 2013
Log:      new run: handle higher level suite setup errors correctly
http://code.google.com/p/robotframework/source/detail?r=6351d4cbc084

Revision: 374d97ed1206
Branch:   default
Author:   Robot Framework Developers ([email protected])
Date:     Tue May 28 06:55:39 2013
Log: fixed non-matching --include/--exclude tests after integreating new ru...
http://code.google.com/p/robotframework/source/detail?r=374d97ed1206

Revision: fc3a66f839d9
Branch:   default
Author:   Robot Framework Developers ([email protected])
Date:     Tue May 28 07:01:01 2013
Log: log settings outside settings and remove log argument that was passed ...
http://code.google.com/p/robotframework/source/detail?r=fc3a66f839d9

Revision: 60686f46cca4
Branch:   default
Author:   Robot Framework Developers ([email protected])
Date:     Tue May 28 07:13:24 2013
Log: fixed handling empty test cases and empty test case names. also proper...
http://code.google.com/p/robotframework/source/detail?r=60686f46cca4

Revision: a3cad89cad33
Branch:   default
Author:   Robot Framework Developers ([email protected])
Date:     Tue May 28 07:13:30 2013
Log:      Automated merge with https://robotframework.googlecode.com/hg/
http://code.google.com/p/robotframework/source/detail?r=a3cad89cad33

==============================================================================
Revision: 6351d4cbc084
Branch:   default
Author:   Robot Framework Developers ([email protected])
Date:     Tue May 28 06:00:22 2013
Log:      new run: handle higher level suite setup errors correctly
http://code.google.com/p/robotframework/source/detail?r=6351d4cbc084

Modified:
 /atest/robot/core/suite_setup_and_teardown.txt
 /src/robot/new_running/failures.py
 /src/robot/new_running/runner.py

=======================================
--- /atest/robot/core/suite_setup_and_teardown.txt      Mon May 27 14:27:12 2013
+++ /atest/robot/core/suite_setup_and_teardown.txt      Tue May 28 06:00:22 2013
@@ -132,8 +132,12 @@
     Check Suite Status    ${SUITE}    FAIL
... Suite setup failed:\nExpected failure in higher level setup\n\n${2 FAIL MSG}
     ...    Test 1    Test 2
- Check Suite Status ${SUITE.suites[0]} FAIL ${1 FAIL MSG} Test 1 - Check Suite Status ${SUITE.suites[1]} FAIL ${1 FAIL MSG} Test 2
+    Check Suite Status    ${SUITE.suites[0]}    FAIL
+ ... Parent suite setup failed:\nExpected failure in higher level setup\n\n${1 FAIL MSG}
+    ...    Test 1
+    Check Suite Status    ${SUITE.suites[1]}    FAIL
+ ... Parent suite setup failed:\nExpected failure in higher level setup\n\n${1 FAIL MSG}
+    ...    Test 2

 Long Error Messages
     Run Tests    ${EMPTY}    core/long_suite_setup_and_teardown_errors.txt
=======================================
--- /src/robot/new_running/failures.py  Fri May 24 09:04:44 2013
+++ /src/robot/new_running/failures.py  Tue May 28 06:00:22 2013
@@ -57,9 +57,6 @@
         return 'FAIL' if self.failures else 'PASS'


-# TODO: Messages below are not identical to old run messages!!
-# Remember to also update messages in SuiteTeardownFailureHandler
-
 class TestMessage(object):
     setup_failed = 'Setup failed:\n%s'
     teardown_failed = 'Teardown failed:\n%s'
@@ -97,3 +94,8 @@
     setup_failed = 'Parent suite setup failed:\n%s'
     teardown_failed = 'Parent suite teardown failed:\n%s'
     also_teardown_failed = '%s\n\nAlso parent suite teardown failed:\n%s'
+
+    def __init__(self, status):
+        while status.parent_status and status.parent_status.failures:
+            status = status.parent_status
+        SuiteMessage.__init__(self, status)
=======================================
--- /src/robot/new_running/runner.py    Tue May 28 04:50:04 2013
+++ /src/robot/new_running/runner.py    Tue May 28 06:00:22 2013
@@ -90,7 +90,7 @@
     def visit_test(self, test):
         if test.name in self._executed_tests:
self._output.warn("Multiple test cases with name '%s' executed in " - "test suite '%s'."% (test.name, self._suite.longname)) + "test suite '%s'." % (test.name, self._suite.longname))
         self._executed_tests[test.name] = True
         result = self._suite.tests.create(name=test.name,
doc=self._resolve_setting(test.doc),
@@ -102,8 +102,7 @@
         keywords = Keywords(test.keywords.normal, test.continue_on_failure)
         self._context.start_test(result)
         status = ExecutionStatus(self._suite_status, test=True)
-        if not status.failures:
-            self._run_setup(test.keywords.setup, status)
+        self._run_setup(test.keywords.setup, status)
         try:
             if not status.failures:
                 keywords.run(self._context)
@@ -126,14 +125,16 @@
         timeout.start()
         return timeout

-    def _run_setup(self, setup, failures):
-        failure = self._run_setup_or_teardown(setup, 'setup')
-        failures.setup_executed(failure)
+    def _run_setup(self, setup, status):
+        if not status.failures:
+            failure = self._run_setup_or_teardown(setup, 'setup')
+            status.setup_executed(failure)

-    def _run_teardown(self, teardown, failures):
-        failure = self._run_setup_or_teardown(teardown, 'teardown')
-        failures.teardown_executed(failure)
-        return failure
+    def _run_teardown(self, teardown, status):
+        if status.teardown_allowed:
+            failure = self._run_setup_or_teardown(teardown, 'teardown')
+            status.teardown_executed(failure)
+            return failure

     def _run_setup_or_teardown(self, data, type):
         if not data:

==============================================================================
Revision: 374d97ed1206
Branch:   default
Author:   Robot Framework Developers ([email protected])
Date:     Tue May 28 06:55:39 2013
Log: fixed non-matching --include/--exclude tests after integreating new run
http://code.google.com/p/robotframework/source/detail?r=374d97ed1206

Modified:
 /atest/robot/tags/include_and_exclude.txt

=======================================
--- /atest/robot/tags/include_and_exclude.txt   Wed Jan  9 08:47:50 2013
+++ /atest/robot/tags/include_and_exclude.txt   Tue May 28 06:55:39 2013
@@ -74,22 +74,22 @@

 Non Matching Include
     [Template]    Run And Check Error
-    --include nonex    includes 'nonex'
-    --include nonex -i nonex2    includes 'nonex' and 'nonex2'
+    --include nonex    tag 'nonex'
+    --include nonex -i nonex2    tags 'nonex' or 'nonex2'

 Non Matching Exclude
     --exclude nonexisting -e nonex2 -e nonex3    @{ALL}

 Non Matching Include And Exclude
     [Template]    Run And Check Error
-    -i nonex -e nonex2    includes 'nonex' and excludes 'nonex2'
- --include nonex -i incl? -e STAR1 -e STAR2 -e STAR3 includes 'nonex' and 'incl?' and excludes '*1', '*2' and '*3'
+    -i nonex -e nonex2    tag 'nonex' and without tag 'nonex2'
+ --include nonex -i incl? -e STAR1 -e STAR2 -e STAR3 tags 'nonex' or 'incl?' and without tags '*1', '*2' or '*3'

 Non Matching When Running Multiple Suites
[Setup] Set Test Variable @{DATA SOURCES} misc/pass_and_fail.txt misc/normal.txt
     [Template]    Run And Check Error
-    --include nonex    includes 'nonex'    Pass And Fail & Normal
-    --include nonex --name MyName   includes 'nonex'    MyName
+    --include nonex    tag 'nonex'    Pass And Fail & Normal
+    --include nonex --name MyName   tag 'nonex'    MyName

 *** Keywords ***
 Run And Check Include And Exclude
@@ -102,6 +102,6 @@
[Arguments] ${params} ${filter_msg} ${suite name}=Include And Exclude Run Tests Without Processing Output ${params} ${ESCAPES} @{DATA SOURCES}
     Stderr Should Be Equal To    SEPARATOR=
- ... [ ERROR ] Suite '${suite name}' with ${filter_msg} contains no test cases. + ... [ ERROR ] Suite '${suite name}' contains no tests with ${filter_msg}.
     ...    ${USAGE TIP}\n
     File Should Not Exist    ${OUTFILE}

==============================================================================
Revision: fc3a66f839d9
Branch:   default
Author:   Robot Framework Developers ([email protected])
Date:     Tue May 28 07:01:01 2013
Log: log settings outside settings and remove log argument that was passed around but not used
http://code.google.com/p/robotframework/source/detail?r=fc3a66f839d9

Modified:
 /src/robot/conf/settings.py
 /src/robot/run.py

=======================================
--- /src/robot/conf/settings.py Tue May 28 04:50:04 2013
+++ /src/robot/conf/settings.py Tue May 28 07:01:01 2013
@@ -57,22 +57,21 @@
                  'XUnitSkipNonCritical' : ('xunitskipnoncritical', False)}
     _output_opts = ['Output', 'Log', 'Report', 'DebugFile', 'XUnitFile']

-    # TODO: Is log used? Accept options as **kws instead/in addition?
-    def __init__(self, options=None, log=True):
+    # TODO: Accept options as **kwargs instead/in addition?
+    def __init__(self, options=None):
         self._opts = {}
         self._cli_opts = self._cli_opts.copy()
         self._cli_opts.update(self._extra_cli_opts)
-        self._process_cli_opts(options or {}, log)
-        if log: LOGGER.info('Settings:\n%s' % unicode(self))
+        self._process_cli_opts(options or {})

-    def _process_cli_opts(self, opts, log):
+    def _process_cli_opts(self, opts):
         for name, (cli_name, default) in self._cli_opts.items():
             value = opts.get(cli_name, default)
             if value in [None, []]:
                 value = default
             elif default == [] and isinstance(value, basestring):
                 value = [value]
-            self[name] = self._process_value(name, value, log)
+            self[name] = self._process_value(name, value)
         self['TestNames'] += self['RunFailed']

     def __setitem__(self, name, value):
@@ -80,7 +79,7 @@
             raise KeyError("Non-existing settings '%s'" % name)
         self._opts[name] = value

-    def _process_value(self, name, value, log):
+    def _process_value(self, name, value):
         if name == 'RunFailed':
             return gather_failed_tests(value)
         if name == 'LogLevel':
@@ -294,7 +293,7 @@
                        'DebugFile'     : ('debugfile', 'NONE')}

     def get_rebot_settings(self):
-        settings = RebotSettings(log=False)
+        settings = RebotSettings()
         settings._opts.update(self._opts)
         for name in ['Variables', 'VariableFiles', 'Listeners']:
             del(settings._opts[name])
=======================================
--- /src/robot/run.py   Tue May 28 05:54:10 2013
+++ /src/robot/run.py   Tue May 28 07:01:01 2013
@@ -378,10 +378,11 @@
         from robot.new_running import TestSuiteBuilder
         settings = RobotSettings(options)
         LOGGER.register_console_logger(width=settings['MonitorWidth'],
-                               colors=settings['MonitorColors'],
-                               markers=settings['MonitorMarkers'],
-                               stdout=settings['StdOut'],
-                               stderr=settings['StdErr'])
+                                       colors=settings['MonitorColors'],
+                                       markers=settings['MonitorMarkers'],
+                                       stdout=settings['StdOut'],
+                                       stderr=settings['StdErr'])
+        LOGGER.info(unicode(settings))
         suite = TestSuiteBuilder().build(*datasources)
         suite.configure(**settings.suite_config)
         result = suite.run(settings)

==============================================================================
Revision: 60686f46cca4
Branch:   default
Author:   Robot Framework Developers ([email protected])
Date:     Tue May 28 07:13:24 2013
Log: fixed handling empty test cases and empty test case names. also proper sentence in error when keyword is empty.
http://code.google.com/p/robotframework/source/detail?r=60686f46cca4

Modified:
 /atest/robot/core/empty_tc_and_uk.txt
 /atest/testdata/core/empty_testcase_and_uk.txt
 /src/robot/new_running/runner.py
 /src/robot/running/userkeyword.py

=======================================
--- /atest/robot/core/empty_tc_and_uk.txt       Wed May 26 02:48:23 2010
+++ /atest/robot/core/empty_tc_and_uk.txt       Tue May 28 07:13:24 2013
@@ -5,6 +5,12 @@
 Resource        atest_resource.txt

 *** Test Cases ***
+Test Case Without Name
+    Check Test Case  ${EMPTY}
+
+User Keyword Without Name
+    Check Test Case  ${TESTNAME}
+
 Empty Test Case
     Check Test Case  ${TESTNAME}

@@ -14,10 +20,10 @@
 Empty User Keyword
     Check Test Case  ${TESTNAME}

-User Keyword With [Return]
+User Keyword With Only Non-Empty [Return] Works
     Check Test Case  ${TESTNAME}

-User Keyword With Empty [Return]
+User Keyword With Empty [Return] Does Not Work
     Check Test Case  ${TESTNAME}

 Empty User Keyword With Other Settings Than [Return]
@@ -28,10 +34,3 @@

 Non-Empty UK Using Empty UK
     Check Test Case  ${TESTNAME}
-
-Test Case Without Name Specified
-    Check Test Case  \
-
-User Keyword Without Name Specified
-    Check Test Case  Using User Keyword That Has No Name
-
=======================================
--- /atest/testdata/core/empty_testcase_and_uk.txt      Wed May 26 02:48:23 2010
+++ /atest/testdata/core/empty_testcase_and_uk.txt      Tue May 28 07:13:24 2013
@@ -1,48 +1,47 @@
 *** Settings ***
 Documentation  NO RIDE because it removes empty [Return]

-
 *** Test Cases ***
-    Log  This test case has no name
-    [Documentation]  FAIL  Test case name is required.
+    [Documentation]  FAIL  Test case name cannot be empty.
+    No Operation
+
+User Keyword Without Name
+    [Documentation]  FAIL  Keyword name cannot be empty.
+    \  argh
+    Fail  Should not be executed

 Empty Test Case
-    [Documentation]  FAIL Test case contains no keywords
+    [Documentation]  FAIL Test case contains no keywords.

 Empty Test Case With Setup And Teardown
-    [Documentation]  FAIL Test case contains no keywords
-    [Setup]  Noop
-    [Teardown]  Noop
+    [Documentation]  FAIL Test case contains no keywords.
+    [Setup]  No Operation
+    [Teardown]  No Operation

 Empty User Keyword
-    [Documentation]  FAIL User keyword 'Empty UK' contains no keywords
+    [Documentation]  FAIL User keyword 'Empty UK' contains no keywords.
     Empty UK

-User Keyword With [Return]
+User Keyword With Only Non-Empty [Return] Works
     UK With Return

-User Keyword With Empty [Return]
- [Documentation] FAIL User keyword 'UK With Empty Return' contains no keywords
+User Keyword With Empty [Return] Does Not Work
+ [Documentation] FAIL User keyword 'UK With Empty Return' contains no keywords.
     UK With Empty Return

 Empty User Keyword With Other Settings Than [Return]
- [Documentation] FAIL User keyword 'Empty UK With Settings' contains no keywords + [Documentation] FAIL User keyword 'Empty UK With Settings' contains no keywords.
     Empty UK With Settings  argument

 Non-Empty And Empty User Keyword
-    [Documentation]  FAIL User keyword 'Empty UK' contains no keywords
+    [Documentation]  FAIL User keyword 'Empty UK' contains no keywords.
     UK
     Empty Uk
     Fail  We should not be here

 Non-Empty UK Using Empty UK
-    [Documentation]  FAIL User keyword 'Empty UK' contains no keywords
+    [Documentation]  FAIL User keyword 'Empty UK' contains no keywords.
     Non Empty UK Using Empty UK
-
-Using User Keyword That Has No Name
-    [Documentation]  FAIL  Keyword name cannot be empty.
-    \  argh
-    ${x}

 *** Keywords ***
     [Documentation]  This keyword has no name
=======================================
--- /src/robot/new_running/runner.py    Tue May 28 06:00:22 2013
+++ /src/robot/new_running/runner.py    Tue May 28 07:13:24 2013
@@ -102,6 +102,10 @@
         keywords = Keywords(test.keywords.normal, test.continue_on_failure)
         self._context.start_test(result)
         status = ExecutionStatus(self._suite_status, test=True)
+        if not test.name:
+            status.test_failed('Test case name cannot be empty.')
+        if not keywords:
+            status.test_failed('Test case contains no keywords.')
         self._run_setup(test.keywords.setup, status)
         try:
             if not status.failures:
=======================================
--- /src/robot/running/userkeyword.py   Tue May 28 04:50:04 2013
+++ /src/robot/running/userkeyword.py   Tue May 28 07:13:24 2013
@@ -233,7 +233,7 @@
             raise DataError('User keyword initialization failed:\n%s'
                             % '\n'.join(self._errors))
         if not (self.keywords or self.return_value):
-            raise DataError("User keyword '%s' contains no keywords"
+            raise DataError("User keyword '%s' contains no keywords."
                             % self.name)

     def _get_return_value(self, variables, return_):

==============================================================================
Revision: a3cad89cad33
Branch:   default
Author:   Robot Framework Developers ([email protected])
Date:     Tue May 28 07:13:30 2013
Log:      Automated merge with https://robotframework.googlecode.com/hg/
http://code.google.com/p/robotframework/source/detail?r=a3cad89cad33

Modified:
 /src/robot/conf/settings.py
 /src/robot/run.py

=======================================
--- /src/robot/conf/settings.py Tue May 28 06:28:33 2013
+++ /src/robot/conf/settings.py Tue May 28 07:13:30 2013
@@ -57,22 +57,21 @@
                  'XUnitSkipNonCritical' : ('xunitskipnoncritical', False)}
     _output_opts = ['Output', 'Log', 'Report', 'DebugFile', 'XUnitFile']

-    # TODO: Is log used? Accept options as **kws instead/in addition?
-    def __init__(self, options=None, log=True):
+    # TODO: Accept options as **kwargs instead/in addition?
+    def __init__(self, options=None):
         self._opts = {}
         self._cli_opts = self._cli_opts.copy()
         self._cli_opts.update(self._extra_cli_opts)
-        self._process_cli_opts(options or {}, log)
-        if log: LOGGER.info('Settings:\n%s' % unicode(self))
+        self._process_cli_opts(options or {})

-    def _process_cli_opts(self, opts, log):
+    def _process_cli_opts(self, opts):
         for name, (cli_name, default) in self._cli_opts.items():
             value = opts.get(cli_name, default)
             if value in [None, []]:
                 value = default
             elif default == [] and isinstance(value, basestring):
                 value = [value]
-            self[name] = self._process_value(name, value, log)
+            self[name] = self._process_value(name, value)
         self['TestNames'] += self['RunFailed']

     def __setitem__(self, name, value):
@@ -80,7 +79,7 @@
             raise KeyError("Non-existing settings '%s'" % name)
         self._opts[name] = value

-    def _process_value(self, name, value, log):
+    def _process_value(self, name, value):
         if name == 'RunFailed':
             return gather_failed_tests(value)
         if name == 'LogLevel':
@@ -297,7 +296,7 @@
                        'DebugFile'          : ('debugfile', 'NONE')}

     def get_rebot_settings(self):
-        settings = RebotSettings(log=False)
+        settings = RebotSettings()
         settings._opts.update(self._opts)
         for name in ['Variables', 'VariableFiles', 'Listeners']:
             del(settings._opts[name])
=======================================
--- /src/robot/run.py   Tue May 28 06:28:38 2013
+++ /src/robot/run.py   Tue May 28 07:13:30 2013
@@ -383,10 +383,11 @@
         from robot.new_running import TestSuiteBuilder
         settings = RobotSettings(options)
         LOGGER.register_console_logger(width=settings['MonitorWidth'],
-                               colors=settings['MonitorColors'],
-                               markers=settings['MonitorMarkers'],
-                               stdout=settings['StdOut'],
-                               stderr=settings['StdErr'])
+                                       colors=settings['MonitorColors'],
+                                       markers=settings['MonitorMarkers'],
+                                       stdout=settings['StdOut'],
+                                       stderr=settings['StdErr'])
+        LOGGER.info(unicode(settings))
         suite = TestSuiteBuilder().build(*datasources)
         suite.configure(**settings.suite_config)
         result = suite.run(settings)

--

--- 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.


Reply via email to