ExtensionIn order to make sure a method works correctly, a test can be implemented that assures the correct behavior.
It is a common practice to write tests to clarify how an object should respond, and it may avoid inconsistencies on the long run. A test is always a subclass of UnitTest, implementing at least one method starting with test_.
testsuite/classlibrary directory of the SuperCollider sources.
To install, download the sources and add the directory to your sclang_conf.yaml, either by editing it or via the ScIDE preferences.
A graphical interface to run and browse all tests
Run a single test for methodName.
| methodName |
Should have the format |
runs all subclasses of UnitTest
runs testclass for a class
| class |
the class |
| reset |
reset UnitTest environment |
| report |
report on pass/fail |
All method names that start with test_ are invoked.
| reset |
(describe argument here) |
| report |
(describe argument here) |
(describe returnvalue here)
Run a single test method of this class
| method |
the method to run |
(describe returnvalue here)
Runs the test class for YourClass, which is assumed to be named TestYourClass.
If no test class if found it politely declines.
Make sure to implement the methods setUp and tearDown. They will be called before and after the test.
| test |
Make sure that this returns a boolean, where |
| message |
posted if report is true. |
| onFailure |
If not |
Make sure that the two floats a and b equal within a given range (within).
| a |
a float |
| b |
a float |
| message |
posted if report is true. |
| onFailure |
If not |
Make sure that the two arrays of floats a and b equal within a given range (within).
| a |
an |
| b |
an |
| message |
posted if report is true. |
| onFailure |
If not |
Make a further assertion only if it passed, or only if it failed.
Wait for a condition, consider failed after maxTime. Only valid within a test (or a routine).
Wait for server boot until continued. Only valid within a test (or a routine).
If already booted, then freeAll and create new allocators.
call failure directly.