Revision: 3148
Author: jussi.ao.malinen
Date: Tue May  4 05:36:54 2010
Log: tests for checking that test and suite teardown continue on failure (except fatal failure).
http://code.google.com/p/robotframework/source/detail?r=3148

Added:
 /trunk/atest/robot/running/errors_in_test_teardown.txt
 /trunk/atest/robot/running/fatal_error_in_suite_teardown.txt
 /trunk/atest/testdata/running/errors_in_test_teardown.txt
 /trunk/atest/testdata/running/fatal_error_in_suite_teardown.txt

=======================================
--- /dev/null
+++ /trunk/atest/robot/running/errors_in_test_teardown.txt Tue May 4 05:36:54 2010
@@ -0,0 +1,17 @@
+*** Settings ***
+Suite Setup     Run Tests  ${EMPTY}  running/errors_in_test_teardown.txt
+Force Tags      not ready  pybot  jybot
+Resource        atest_resource.txt
+
+*** Test Cases ***
+Test With One Error In Teardown
+    ${tc} =  Check Test Case  ${TESTNAME}
+ Check Log Message ${tc.teardown.kws[1].msgs[0]} This Should Be executed
+
+Test With Many Errors In Teardown
+    ${tc} =  Check Test Case  ${TESTNAME}
+ Check Log Message ${tc.teardown.kws[2].msgs[0]} This Should Also Be Executed
+
+Test With A Fatal Error In Teardown
+    ${tc} =  Check Test Case  ${TESTNAME}
+    Should Be True  len(${tc.teardown.kws}) == 1
=======================================
--- /dev/null
+++ /trunk/atest/robot/running/fatal_error_in_suite_teardown.txt Tue May 4 05:36:54 2010
@@ -0,0 +1,10 @@
+*** Settings ***
+Suite Setup Run Tests ${EMPTY} running/fatal_error_in_suite_teardown.txt
+Force Tags      not ready  pybot  jybot
+Resource        atest_resource.txt
+
+*** Test Cases ***
+Suite Teardown Should Stop At Fatal Error
+    ${ts} =  Get Test Suite  fatal error in suite teardown
+    Should Be True  len(${ts.teardown.kws}) == 1
+
=======================================
--- /dev/null
+++ /trunk/atest/testdata/running/errors_in_test_teardown.txt Tue May 4 05:36:54 2010
@@ -0,0 +1,38 @@
+*** Settings ***
+Library  Exceptions
+Suite Teardown  Suite Teardown With Errors
+
+*** Test Cases ***
+Test With One Error In Teardown
+ [documentation] FAIL Teardown failed:\nMessage\n\nAlso teardown of the parent suite failed.
+    No Operation
+    [teardown]  One Error
+
+Test With Many Errors In Teardown
+ [documentation] FAIL Teardown failed:\nMessage 1\n\nAlso teardown of the parent suite failed.
+    No Operation
+    [teardown]  Many Errors
+
+Test With A Fatal Error In Teardown
+ [documentation] FAIL Teardown failed:\nFatalCatastrophyException\n\nAlso teardown of the parent suite failed.
+    No Operation
+    [teardown]  Fatal Error
+
+*** Keywords ***
+One Error
+    Fail  Message
+    Log  This Should Be executed
+
+Many Errors
+    Fail  Message 1
+    Fail  Message 2
+    Log  This Should Also Be Executed
+
+Fatal Error
+    Exit On Failure
+    Log  This Should Not Be Executed
+
+Suite Teardown With Errors
+    Fail  Suite Message 1
+    Fail  Suite Message 2
+    Log  This As Well Should Be Executed
=======================================
--- /dev/null
+++ /trunk/atest/testdata/running/fatal_error_in_suite_teardown.txt Tue May 4 05:36:54 2010
@@ -0,0 +1,12 @@
+*** Settings ***
+Library  Exceptions
+Suite Teardown  Suite Teardown With Fatal Error
+
+*** Test Cases ***
+Test
+    No Operation
+
+*** Keywords ***
+Suite Teardown With Fatal Error
+    Exit On Failure
+    Log  This Should Not Be executed

Reply via email to