Hello dev list,
Inspired by the intentions to set up an automated unit test procedure for Pd-extended, we propose a template for testing signal objects. "We" is Fred Jan Kraan and me, we've been puzzling on this together last weekend.
As far as we could see, there is no way to generate test patches for all signal objects with a 'one-size-fits-all' content and where you could replace the object under test using a simple script. Conditions are just too different per object. Instead, we opted for a template where you manually put the object under test, together with requisites like test signal, 'set' messages etc. Aspects of the template:
- compares signal under test with reference which is stored with the patch (512 points) - reference array can be recorded in the patch using a Pd known to work well (release build for example) - visual representation of signal under test, reference signal and diff - standard deviation is calculated - maximum tolerated standard deviation can be set (tolerance) - test result is reported as a function of found standard deviation and tolerance ('tested OK' or 'ERROR: deviation ....') - test result is printed to Pd window and stdout - test is automatically executed when patch is loaded - samplerate 44100 is considered the norm, error is reported when other samplerate is detected at patch load
The template is intended towards automated unit testing. Test patches based on the template could be included in a setup like the 'load-every-help' test.
Attached is a .zip with the template and two examples. Please comment on it if you have suggestions.
Katja