public class TestUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
TestUtils.StreamGrabber
Grab everything produced by a given input stream until the End-Of-File
(EOF) is reached.
|
| Constructor and Description |
|---|
TestUtils() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
compare(String output,
String referenceFile)
Compare the output of executing java on the test case with a reference
file.
|
static wycc.util.Pair<Compile.Result,String> |
compile(File whileydir,
boolean verify,
String... args)
Run the Whiley Compiler with the given list of arguments.
|
static void |
execWyil(File wyilDir,
wyfs.lang.Path.ID id)
Execute a given WyIL file using the default interpreter.
|
static Collection<Object[]> |
findTestNames(String srcDir)
Scan a directory to get the names of all the whiley source files
in that directory.
|
public static Collection<Object[]> findTestNames(String srcDir)
test.name.contains is set,
then the list of files returned will be filtered. Only file
names that contain the property will be returned. This makes it
possible to run a subset of tests when testing interactively
from the command line.srcDir - The path of the directory to scan.public static wycc.util.Pair<Compile.Result,String> compile(File whileydir, boolean verify, String... args) throws IOException
args - --- list of command-line arguments to provide to the Whiley
Compiler.IOExceptionpublic static void execWyil(File wyilDir, wyfs.lang.Path.ID id) throws IOException
wyilDir - The root directory to look for the WyIL file.id - The name of the WyIL fileIOExceptionpublic static boolean compare(String output, String referenceFile) throws IOException
output - This provides the output from executing java on the test case.referenceFile - The full path to the reference file. This should use the
appropriate separator char for the host operating system.IOExceptionCopyright © 2017. All rights reserved.