lingua-franca 0.10.1
Lingua Franca code generator
Loading...
Searching...
No Matches
org.lflang.tests.LFTest Class Reference

Information about an indexed Lingua Franca test program. More...

Inherits Comparable< LFTest >.

Classes

class  ExecutionLogger
 Inner class for capturing streams during execution of a test, capable of recording output streams up until the moment that a test is interrupted upon timing out. More...
enum  Result
 Enumeration of test outcomes. More...

Public Member Functions

int compareTo (LFTest t)
 Comparison implementation to allow for tests to be sorted (e.g., when added to a tree set) based on their path (relative to the root of the test directory).
boolean equals (Object o)
 Return true if the given object is an LFTest instance with a name identical to this test.
LFGeneratorContext getContext ()
long getExecutionTimeNanoseconds ()
 Return the execution time of this test in nanoseconds.
FileConfig getFileConfig ()
Path getSrcPath ()
void handleTestError (TestError e)
boolean hasFailed ()
 Report whether this test has failed.
int hashCode ()
 Identify tests uniquely on the basis of their name.
boolean hasPassed ()
 LFTest (Path srcFile)
 Create a new test.
void markPassed ()
Thread recordStdErr (Process process)
 Return a thread responsible for recording the error stream of the given process.
Thread recordStdOut (Process process)
 Return a thread responsible for recording the standard output stream of the given process.
void redirectOutputs ()
 Redirect outputs for recording.
void reportErrors ()
 Print a report of all the collected errors.
void setExecutionTimeNanoseconds (long time)
 Record the execution time of this test in nanoseconds.
String toString ()
 Return a string representing the name of this test.

Static Public Member Functions

static void restoreOutputs ()
 End output redirection.

Package Functions

void loadContext (LFGeneratorContext context)

Detailed Description

Information about an indexed Lingua Franca test program.

Author
Marten Lohstroh

Constructor & Destructor Documentation

◆ LFTest()

org.lflang.tests.LFTest.LFTest ( Path srcFile)

Create a new test.

Parameters
srcFileThe path to the file of the test program.

Member Function Documentation

◆ compareTo()

int org.lflang.tests.LFTest.compareTo ( LFTest t)

Comparison implementation to allow for tests to be sorted (e.g., when added to a tree set) based on their path (relative to the root of the test directory).

◆ equals()

boolean org.lflang.tests.LFTest.equals ( Object o)

Return true if the given object is an LFTest instance with a name identical to this test.

Parameters
oThe object to test for equality with respect to this one.
Returns
True if the given object is equal to this one, false otherwise.

◆ getContext()

LFGeneratorContext org.lflang.tests.LFTest.getContext ( )

◆ getExecutionTimeNanoseconds()

long org.lflang.tests.LFTest.getExecutionTimeNanoseconds ( )

Return the execution time of this test in nanoseconds.

◆ getFileConfig()

FileConfig org.lflang.tests.LFTest.getFileConfig ( )

◆ getSrcPath()

Path org.lflang.tests.LFTest.getSrcPath ( )

◆ handleTestError()

void org.lflang.tests.LFTest.handleTestError ( TestError e)

◆ hasFailed()

boolean org.lflang.tests.LFTest.hasFailed ( )

Report whether this test has failed.

Returns
True if the test has failed, false otherwise.

◆ hashCode()

int org.lflang.tests.LFTest.hashCode ( )

Identify tests uniquely on the basis of their name.

Returns
The hash code of the name of this test.

◆ hasPassed()

boolean org.lflang.tests.LFTest.hasPassed ( )

◆ loadContext()

void org.lflang.tests.LFTest.loadContext ( LFGeneratorContext context)
package

◆ markPassed()

void org.lflang.tests.LFTest.markPassed ( )

◆ recordStdErr()

Thread org.lflang.tests.LFTest.recordStdErr ( Process process)

Return a thread responsible for recording the error stream of the given process.

A separate thread is used so that the activity can be preempted.

◆ recordStdOut()

Thread org.lflang.tests.LFTest.recordStdOut ( Process process)

Return a thread responsible for recording the standard output stream of the given process.

A separate thread is used so that the activity can be preempted.

◆ redirectOutputs()

void org.lflang.tests.LFTest.redirectOutputs ( )

Redirect outputs for recording.

◆ reportErrors()

void org.lflang.tests.LFTest.reportErrors ( )

Print a report of all the collected errors.

◆ restoreOutputs()

void org.lflang.tests.LFTest.restoreOutputs ( )
static

End output redirection.

◆ setExecutionTimeNanoseconds()

void org.lflang.tests.LFTest.setExecutionTimeNanoseconds ( long time)

Record the execution time of this test in nanoseconds.

◆ toString()

String org.lflang.tests.LFTest.toString ( )

Return a string representing the name of this test.

Returns
The name of this test.

The documentation for this class was generated from the following file:
  • /Users/runner/work/lingua-franca/lingua-franca/core/src/testFixtures/java/org/lflang/tests/LFTest.java