author | HG Automerge |
Thu, 24 Nov 2016 21:56:23 +0000 | |
branch | jv |
changeset 673 | 7c5c1bc3be7b |
parent 664 | e31b2e7b658d |
child 724 | 4dae63fce9f9 |
permissions | -rw-r--r-- |
105 | 1 |
"{ Package: 'stx:goodies/sunit' }" |
2 |
||
664
e31b2e7b658d
FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
222
diff
changeset
|
3 |
"{ NameSpace: Smalltalk }" |
e31b2e7b658d
FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
222
diff
changeset
|
4 |
|
105 | 5 |
TestFailure subclass:#ResumableTestFailure |
6 |
instanceVariableNames:'' |
|
7 |
classVariableNames:'' |
|
8 |
poolDictionaries:'' |
|
9 |
category:'SUnit-Preload' |
|
10 |
! |
|
11 |
||
222 | 12 |
!ResumableTestFailure class methodsFor:'documentation'! |
13 |
||
14 |
documentation |
|
15 |
" |
|
16 |
Sometimes it is useful to see when debugging (and/or to log when running) the results from several assertions in a test. Example: |
|
17 |
||
18 |
#(‘same’ ‘*’ ‘*.txt’ ‘a*c’) with: #(‘same’ ‘any’ ‘some.txt’ ‘abc’) do: |
|
19 |
[:eachMeta :eachString | |
|
20 |
self assert: (eachMeta match: eachString) |
|
21 |
description: (‘<1s> does not match <2s>’ expandMacrosWith: eachMeta with: eachString) |
|
22 |
resumable: true]. |
|
23 |
||
24 |
Raising a ResumableTestFailure means that all the assertions will be run (if the test case is logging, this will print out a message to the log for each one that fails). When debugging, the user can hit ''proceed'' to continue the test and see which other expressions do not match.' |
|
25 |
||
26 |
||
27 |
" |
|
28 |
! ! |
|
105 | 29 |
|
30 |
!ResumableTestFailure methodsFor:'Camp Smalltalk'! |
|
31 |
||
222 | 32 |
handleFailureWith:something |
105 | 33 |
"resumable test failure. Continue with the test suite" |
34 |
||
35 |
^ self resumeWith:something |
|
36 |
! |
|
37 |
||
38 |
mayProceed |
|
39 |
||
40 |
^ true |
|
41 |
! |
|
42 |
||
222 | 43 |
sunitExitWith: aValue |
44 |
||
45 |
^self resume: aValue |
|
105 | 46 |
! ! |
47 |
||
48 |
!ResumableTestFailure class methodsFor:'documentation'! |
|
49 |
||
50 |
version |
|
222 | 51 |
^ '$Header: /cvs/stx/stx/goodies/sunit/ResumableTestFailure.st,v 1.2 2011-06-29 19:15:49 cg Exp $' |
52 |
! |
|
53 |
||
664
e31b2e7b658d
FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
222
diff
changeset
|
54 |
version_HG |
e31b2e7b658d
FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
222
diff
changeset
|
55 |
|
e31b2e7b658d
FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
222
diff
changeset
|
56 |
^ '$Changeset: <not expanded> $' |
e31b2e7b658d
FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
222
diff
changeset
|
57 |
! |
e31b2e7b658d
FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
222
diff
changeset
|
58 |
|
222 | 59 |
version_SVN |
60 |
^ '§Id: ResumableTestFailure.st 204 2010-09-11 15:21:51Z vranyj1 §' |
|
105 | 61 |
! ! |
664
e31b2e7b658d
FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
222
diff
changeset
|
62 |