To write, use and develop UnitTests, you need to
Download or clone SuperCollider from github: https://github.com/supercollider/supercollider.It is not needed to compile SuperCollider from its sources, you can instead use a pre-compiled binary and include the relevant folders (SCClassLibrary, HelpSource, testsuite/classlibrary
in your environment. See below for an example.
In order to mimick the standard SuperCollider installation, make sure that you have only the class library installed.
Best practise is to create a separate .yaml
configuration file that resides parallel to the default one. You can do this either interactively from within the preferences of your IDE (Preferences>Interpreter
), or programatically
Core class UnitTest
s are located in the directory 1. UnitTests go into parrallel directlry 2. server-related tests go into `server` subdir (travis) 3. UnitTests should use assert and assertFloat 4. look at existing UnitTests to understand what are good UnitTests 5. UnitTest setup 8. run UnitTests either automatically (UnitTest.runAll), interactively (UnitTEst.gui), or individually by class (MyClass.test / TestMyClass.run << synonyms)
The simplest way is to look at an existing help file or class document, and read this document and SCDoc Syntax