[Date Prev][Date Next][Thread Prev][Thread Next][Author Index][Date Index][Thread Index]

recent fixes to testing



In heh-w.cha are a set of fixes to the testing stuff I did to make it more compatible with what
MarkM had in mind with the testing stuff he started.  Now, the rules are:

make 1 testing object per file that names itself (super create:) the same as the file.
e.g. SetTester create -- super create: 'set'

This allows the browser to find a canonical tester for the file.

This tester must have an allTestsOn: method that fetches and calls allTestsOn: for any and all
other testers in the same file.  This will establish a canonical order of execution for multiple
testers within a file so that the reference file will match.

If there is only one tester in the file, it can just execute it's tests.  There is no requirement
for there to be more than one tester per file.  As a matter of style, though,  I think that if
there are several testers in a file, the canonical tester should do nothing except fetch and
execute the other testers.

So, in my example, the class SetTester has an instance create method as follows:
!SetTester methodsFor: #creation!
create
     super create: 'set'.

! !

and an allTestsOn: method:
!SetTester methodsFor: #testing!
{void} allTestsOn: oo {ostream reference}

    | t {Tester} |

    t _ Tester fetchTester: 'hashset'/
    t ~~ NULL ifTrue: [t allTestsOn: oo].
etc...
! !

That should make the testing stuff all compatible in Smalltalk and C++ now.

--Hugh