|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object junit.framework.Assert junit.framework.TestCase org.objectweb.fractal.cecilia.adl.test.CeciliaAdlTestCase
public abstract class CeciliaAdlTestCase
Utility class for compiler tests. Defines methods to compile ADL and run
compiled application.
Tests can be configured using the following system properties:
cecilia.test.buildDir
specify the test
output directory.cecilia.test.sourcePath
specify the
source path of the tests.cecilia.test.compiler
specify the
command of the C-compiler.cecilia.test.linker
specify the
command of the linker.cecilia.test.cFlags
specify the
compilation flags.
Nested Class Summary | |
---|---|
class |
CeciliaAdlTestCase.FractalBackendLauncher
A subclass of the Launcher which uses a fully compliant Fractal compiler. |
class |
CeciliaAdlTestCase.StaticallyLoadedCeciliaAdlLauncher
|
Field Summary | |
---|---|
static java.lang.String |
BUILD_DIR_PROPERTY_NAME
The name of the system property that specify the test output directory. |
static java.lang.String |
C_FLAGS_PROPERTY_NAME
The name of the system property that specify the compilation flags. |
protected boolean |
clearBuildDir
This boolean can be set to false by sub class to avoid cleaning build directory at setup phase. |
static java.lang.String |
COMPILER_CMD_PROPERTY_NAME
The name of the system property that specify the compiler command. |
static java.lang.String |
DEFAULT_BUILD_DIR
The default value of the BUILD_DIR_PROPERTY_NAME property. |
static java.lang.String |
DEFAULT_C_FLAGS
The value of the default compilation flags. |
static java.lang.String |
DEFAULT_LD_FLAGS
|
static java.lang.String |
DEFAULT_SOURCE_PATH
|
static java.lang.String |
LD_FLAGS_PROPERTY_NAME
|
static java.lang.String |
LINKER_CMD_PROPERTY_NAME
The name of the system property that specify the linker command. |
static java.lang.String |
SOURCE_PATH_PROPERTY_NAME
The name of the system property that specify the source path of the tests. |
static java.lang.String |
TEST_JOBS_PROPERTY_NAME
|
Constructor Summary | |
---|---|
CeciliaAdlTestCase()
|
Method Summary | |
---|---|
java.io.File |
compileADL(java.lang.String adlName)
Compiles the given ADL using the CeciliaADL factory. |
void |
compileAndRun(java.lang.String adlName)
Compile and run th given ADL. |
protected static boolean |
deleteDirectory(java.io.File path)
|
static java.io.File |
getBuildDir()
Returns the test build directory. |
static org.objectweb.fractal.cecilia.adl.Launcher |
getLauncher()
Return the cached Launcher that is used by instances of this class. |
protected java.util.Map<java.lang.String,java.lang.String> |
getLauncherOptions()
|
void |
runTest(java.io.File test,
java.lang.String adlName)
Run a compiled ADL. |
int |
runTestAndReturnValue(java.io.File test,
java.lang.String adlName)
Run a given executable and return its process exit value, or fail() if it does finish in time. |
static void |
setLauncher(org.objectweb.fractal.cecilia.adl.Launcher l)
Set the cached Launcher that will be used by instances of this class. |
void |
setUp()
|
java.io.File |
tryCompileADL(java.lang.String adlName)
Compiles the given ADL using the CeciliaADL factory and throws Exception if the compilation fails. |
Methods inherited from class junit.framework.TestCase |
---|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown, toString |
Methods inherited from class junit.framework.Assert |
---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String BUILD_DIR_PROPERTY_NAME
public static final java.lang.String DEFAULT_BUILD_DIR
BUILD_DIR_PROPERTY_NAME
property.
public static final java.lang.String SOURCE_PATH_PROPERTY_NAME
public static final java.lang.String DEFAULT_SOURCE_PATH
public static final java.lang.String COMPILER_CMD_PROPERTY_NAME
gcc
).
public static final java.lang.String LINKER_CMD_PROPERTY_NAME
gcc
).
public static final java.lang.String C_FLAGS_PROPERTY_NAME
public static final java.lang.String DEFAULT_C_FLAGS
public static final java.lang.String LD_FLAGS_PROPERTY_NAME
public static final java.lang.String DEFAULT_LD_FLAGS
public static final java.lang.String TEST_JOBS_PROPERTY_NAME
protected boolean clearBuildDir
Constructor Detail |
---|
public CeciliaAdlTestCase()
Method Detail |
---|
public void setUp() throws java.lang.Exception
setUp
in class junit.framework.TestCase
java.lang.Exception
protected static boolean deleteDirectory(java.io.File path)
public static org.objectweb.fractal.cecilia.adl.Launcher getLauncher()
public static void setLauncher(org.objectweb.fractal.cecilia.adl.Launcher l)
l
- public static java.io.File getBuildDir() throws java.lang.Exception
java.lang.Exception
- if the "cecilia.test.buildDir" system property
is not specified.protected java.util.Map<java.lang.String,java.lang.String> getLauncherOptions() throws java.lang.Exception
java.lang.Exception
public java.io.File compileADL(java.lang.String adlName)
adlName
- the name of the ADL to compile
public java.io.File tryCompileADL(java.lang.String adlName) throws java.lang.Exception
adlName
- the name of the ADL to compile
java.lang.Exception
- if something goes wrong.public void runTest(java.io.File test, java.lang.String adlName) throws java.lang.Exception
test
- the compiled ADL.adlName
- the name of the ADL (used for error message).
java.lang.Exception
- if something goes wrong.public int runTestAndReturnValue(java.io.File test, java.lang.String adlName) throws java.lang.Exception
test
- adlName
-
java.lang.Exception
public void compileAndRun(java.lang.String adlName) throws java.lang.Exception
adlName
- the name of the adl to compile and run.
java.lang.Exception
- if something goes wrong.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |