/*  AutoTester.java
 *  Geoff Oakham (oakhamg@cs)
 *  Nov 5, 2001
 */

import java.util.*;
import java.io.*;
import java.lang.*;

/** Responsible for keeping track of test results */
interface Logger {

    /** Records debugging information.  The logger doesn't have to
     *  do anything with this message, in fact it could discard it.
     *  Typically, this method will print the message immediately
     *  to standard output.
     *
     *  'testCase' must be a valid test case number or -1 if the
     *  message isn't associated with a testcase.  "text" is an
     *  arbitrary message and 'type' is an arbitrary category.
     */
    public void printDebug(int testCase, String type, String text);

    /** Records the outcome of a test case 'testCase'.  'result' is
     *  true if the testcase passed.
     */
    public void logResult(int testCase, boolean result);

    /** Records the outcome of a test case 'testCase' that failed
     *  because of an unhandled exception 'e'.
     */
    public void logResult(int testCase, java.lang.Throwable e);
    
    /** Records that 'testCase' failed due to a possible infinite loop.
     */
    public void logResultTimeLimit(int testCase);

    /** Logs a short message associated with a test case.  Messages are canned
     * comments or errors such as "testcase failed" or "infinite loop" or
     * "exception foobar".  Loggers are encouraged to make these message more
     * promentent than 'details'.
     */
    public void logMessage(int testCase, String message);

    /** Log a long and/or detailed message ('message') concerning 'testCase'.
     *  This is a good place to report nitty-gritty details about why a testcase
     *  failed.  For example, a good message could read:
     *    "we were looking for X but found Y".
     */
    public void logDetails(int testCase, String message);
}

