package org.bouncycastle.crypto.test;

import junit.framework.TestCase;
import org.bouncycastle.util.test.SimpleTestResult;

public class SimpleTestTest
    extends TestCase
{
    public void testCrypto()
    {
        runTests(RegressionTest.tests);
    }

    private void runTests(org.bouncycastle.util.test.Test[] tests)
    {
        for (int i = 0; i != tests.length; i++)
        {
            SimpleTestResult result = (SimpleTestResult)tests[i].perform();

            if (!result.isSuccessful())
            {
                if (result.getException() != null)
                {
                    result.getException().printStackTrace();
                }
                fail(i + " -> " + result.toString());
            }
        }
    }

    public static void main(String[] args)
    {
        SimpleTestTest test = new SimpleTestTest();
        test.testCrypto();
    }
}
