Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
SUnit for 3.10
Last updated at 1:59 pm UTC on 10 March 2007

Script to load improved SUnit

usage:
Installer installUrl: 'wiki.squeak.org/squeak/SUnit%20for%203.10'.
author: kph
script:

Installer mantis fixBug: 5319.


Additional Features

  1. SUnit
    1. Suite defining mechanism
    2. Suite and Filter publishing interface
  2. TestResultTimed
    1. Collects test timings
    2. Collects whether a test uses the network
  3. TestCaseVersioned - Specialized TestCase class
    1. Categorize tests for platforms
    2. Categorize tests for image version
    3. Categorize tests for vm Version
  4. ClassClonerTestResource
    1. Enables testing of the class side without disturbing the classes' soleInstance
  5. TestReporter - Non Gui test runner
    1. Reports test run progress
    2. Reports failures/errors to file
    3. Can read failures/errors file into a method browser
  6. TestRunner
    1. Browse selected test cases in a method browser
    2. Method browser shows timings/net use
    3. UI for selecting published suites
    4. UI for applying filters to remove tests
    5. UI for applying filters to select tests
    6. UI for marking tests, as long

From the class comment:

The magic that a TestCase subclass with no test selectors automatically inherits testSelectors. This can and should be explicitly set by overriding #shouldInheritSelectors to true so as to make the behaviour explicit.

Simplification/refactoring/enhancement:

All hard wired references to 'test*' have been removed from the suiteBuild protocol, indeed the suiteBuild protocol has been greatly simplified/removed.

More flexible suite building API:

Asking an abstract class for #suite: will build the entire suite for all of its concrete subclasses.
Asking a concrete class for #suite: will just return the suite for that one class.

Suites are defined as class methods for a testcase class.
example:
myTestSuite
"all 'test*' methods, but not those in category 'long tests', or tests flagged with #BrokenTest"
^ #( 'include:test*' 'exclude@long tests' 'exclude#BrokenTest' )

Suites are obtained via either
a) a selector which references a defined suite or
b) an explicit string
c) an array of a & b.

TestCase suite: #myTestSuite.
TestCase suite: 'include:test*'.
TestCase suite: #( 'include:test*' 'include:longtest*').

The array can be used to combine other suites
example:
myTestSuiteWithLongTests
^ #( #myTestSuite 'include@long tests' )

Published Suites API

  1. publishedSuites provides a list of test suites published by each TestCase class that can be picked in the TestRunner. This provides a natural UI for selecting from a range of testing scenarios. e.g. tests for different products, releases, platforms, performance monitoring tests, long tests, tests needing additional services (db)

Published Filters API

  1. published filters provides a list of filters that can be picked in the TestRunner. This provides a natural UI for including/excluding groups of tests from a suite.

publishedFilters
^#( #filterOutBrokenTests )

filterOutBrokenTests
^ 'exclude#BrokenTest'

With this new publishing suites API the functionality of LongTestCase is no longer needed. It could be removed but is left for backwards compatibility.

Additional asserts

added #assert:equals and #assert:includes

Future:
The expectedFailures mechanism may not be needed anymore, and needlessly complicates the results.