package jmsltestsuite; import com.softsynth.jmsl.*; /** Call self testing qa() methods for various classes. * @author Phil Burk and Nick Didkovsky */ public class SelfTest { static int checkResult(int errnum, String className) { if (errnum != 0) { System.err.println("ERROR in " + className + " = " + errnum); return 1; } else { System.out.println("SUCCESS in " + className); return 0; } } public static void main(String args[]) { int numErrors = 0; // Call each class that has a qa() method. numErrors += checkResult(KeyTranslator.qa(), "KeyTranslator"); numErrors += checkResult(JMSLRandom.qa(), "JMSLRandom"); numErrors += checkResult(EventScheduler.qa(), "EventScheduler"); numErrors += checkResult(MusicShape.qa(), "MusicShape"); System.out.println("Total tests returning errors = " + numErrors); if (numErrors > 0) System.err.println("ERROR - ERROR - ERROR - ERROR"); System.exit(numErrors); } }