Package randoop.generation
Class TestUtils
- java.lang.Object
-
- randoop.generation.TestUtils
-
public class TestUtils extends Object
Utility methods for setting up selection and operation-history logging in integration tests that use a generator.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static boolean
debug
-
Constructor Summary
Constructors Constructor Description TestUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
setAllLogs(AbstractGenerator generator)
Use system properties to set command-line arguments for logging.static void
setOperationLog(@Nullable String filename, AbstractGenerator generator)
If the filename is non-null, sets the operation history logger for the generator using it.static void
setOperationLog(PrintWriter pw, AbstractGenerator generator)
If the PrintWriter is non-null, sets the operation history logger for the generator using it.static void
setOperationLog(AbstractGenerator generator)
If the system propertyrandoop.operation.history.log
is set, sets the operation history logger for the generator using the destination given by the property.static void
setRandoopLog()
Uses the system propertyrandoop.log
to setGenInputsAbstract.log
.static void
setRandoopLog(@Nullable String filename)
Uses the argument to setGenInputsAbstract.log
.static void
setSelectionLog()
Uses the system propertyrandoop.selection.log
to setGenInputsAbstract.selection_log
.static void
setSelectionLog(@Nullable String filename)
Uses the argument to setGenInputsAbstract.selection_log
.static void
setSelectionLog(org.plumelib.util.FileWriterWithName fw)
Uses the argument to setGenInputsAbstract.selection_log
.
-
-
-
Method Detail
-
setAllLogs
public static void setAllLogs(AbstractGenerator generator)
Use system properties to set command-line arguments for logging.This has no effect unless tests are run with gradle command-line options such as
-Drandoop.log=randoop-log.txt -Drandoop.selection.log=selection-log.txt -Drandoop.operation.history.log=operation-log.txt
- Parameters:
generator
- the AbstractGenerator in which to set the operation log
-
setRandoopLog
public static void setRandoopLog()
Uses the system propertyrandoop.log
to setGenInputsAbstract.log
.
-
setRandoopLog
public static void setRandoopLog(@Nullable String filename)
Uses the argument to setGenInputsAbstract.log
.- Parameters:
filename
- the file to write the log to; does nothing if filename is null
-
setSelectionLog
public static void setSelectionLog()
Uses the system propertyrandoop.selection.log
to setGenInputsAbstract.selection_log
.
-
setSelectionLog
public static void setSelectionLog(@Nullable String filename)
Uses the argument to setGenInputsAbstract.selection_log
.- Parameters:
filename
- the file to write the log to; does nothing if filename is null
-
setSelectionLog
public static void setSelectionLog(org.plumelib.util.FileWriterWithName fw)
Uses the argument to setGenInputsAbstract.selection_log
.- Parameters:
fw
- the FileWriter to write the log to; does nothing if fw is null
-
setOperationLog
public static void setOperationLog(AbstractGenerator generator)
If the system propertyrandoop.operation.history.log
is set, sets the operation history logger for the generator using the destination given by the property.- Parameters:
generator
- the generator for which logger is to be set
-
setOperationLog
public static void setOperationLog(@Nullable String filename, AbstractGenerator generator)
If the filename is non-null, sets the operation history logger for the generator using it.- Parameters:
filename
- the file to write the log to; does nothing if filename is nullgenerator
- the generator for which logger is to be set
-
setOperationLog
public static void setOperationLog(PrintWriter pw, AbstractGenerator generator)
If the PrintWriter is non-null, sets the operation history logger for the generator using it.- Parameters:
pw
- the PrintWriter to write the log to; does nothing if pw is nullgenerator
- the generator for which logger is to be set
-
-