use of org.eclipse.n4js.hlc.base.N4jscBase in project n4js by eclipse.
the class N4JSXTest method testCyclicReferencesWithN4JS_singleFile.
/**
* Same as {@link #testCyclicReferencesWithN4JS()}, but the files are compiled individually using 'singlefile' mode.
*/
@Test
public void testCyclicReferencesWithN4JS_singleFile() throws ExitCodeException {
final String wsRoot = workspace.getAbsolutePath().toString();
String p3Root = wsRoot + "/" + "P3";
new N4jscBase().doMain("--projectlocations", wsRoot, "--buildType", "singlefile", p3Root + "/src/foo.n4js");
assertFilesCompiledToES(1, p3Root);
new N4jscBase().doMain("--projectlocations", wsRoot, "--buildType", "singlefile", p3Root + "/src/bar.n4jsx");
assertFilesCompiledToES(2, p3Root);
}
use of org.eclipse.n4js.hlc.base.N4jscBase in project n4js by eclipse.
the class N4JSXTest method testCyclicReferencesWithN4JS.
/**
* Compile two n4js and n4jsx files, with cyclic cross-references.
*/
@Test
public void testCyclicReferencesWithN4JS() throws ExitCodeException {
final String wsRoot = workspace.getAbsolutePath().toString();
String p3Root = wsRoot + "/" + "P3";
new N4jscBase().doMain("--projectlocations", wsRoot, "--buildType", "projects", p3Root);
assertFilesCompiledToES(2, p3Root);
}
use of org.eclipse.n4js.hlc.base.N4jscBase in project n4js by eclipse.
the class N4JSXTest method testCombinedWithN4JS.
/**
* Compile several n4js and n4jsx files, with cross-references between the files.
*/
@Test
public void testCombinedWithN4JS() throws ExitCodeException {
final String wsRoot = workspace.getAbsolutePath().toString();
String p2Root = wsRoot + "/" + "P2";
String react = wsRoot + "/react";
new N4jscBase().doMain("--projectlocations", wsRoot, "--buildType", "projects", p2Root, react);
assertFilesCompiledToES(3, p2Root);
}
use of org.eclipse.n4js.hlc.base.N4jscBase in project n4js by eclipse.
the class N4jscDependentProjectDependenciesTest method testSuccessfulCompilationWithInterdependentProjects.
/**
* Test failure when compiling without target platform file.
*
* @throws ExitCodeException
* propagated from compiler in case of issues
*/
@Test
public void testSuccessfulCompilationWithInterdependentProjects() throws ExitCodeException {
final String wsRoot = workspace.getAbsolutePath().toString();
final String[] args = { "--systemLoader", COMMON_JS.getId(), "--installMissingDependencies", "--targetPlatformInstallLocation", getTargetPlatformInstallLocation().getAbsolutePath(), "--verbose", "--projectlocations", wsRoot, "--buildType", BuildType.allprojects.toString() };
SuccessExitStatus status = new N4jscBase().doMain(args);
assertEquals("Should exit with success", SuccessExitStatus.INSTANCE.code, status.code);
assertTrue("install location was not created", getTargetPlatformInstallLocation().exists());
}
use of org.eclipse.n4js.hlc.base.N4jscBase in project n4js by eclipse.
the class TargetPlatformConfigurationsTest method testCompileWithInstallPlusCompileSkipInstall.
/**
* Test compiling with external libraries installation, then invoke compilation without installing. We expect second
* invocation to re-use installed external libraries in first invocation.
*
* @throws ExitCodeException
* propagated from compiler in case of issues
*/
@Test
public void testCompileWithInstallPlusCompileSkipInstall() throws ExitCodeException {
final String wsRoot = workspace.getAbsolutePath().toString();
final String[] argsInstall = { "--installMissingDependencies", "--targetPlatformInstallLocation", getTargetPlatformInstallLocation().getAbsolutePath(), "--verbose", "--projectlocations", wsRoot, "--buildType", BuildType.allprojects.toString() };
SuccessExitStatus statusInstall = new N4jscBase().doMain(argsInstall);
assertEquals("Should exit with success", SuccessExitStatus.INSTANCE.code, statusInstall.code);
assertTrue("install location was not created", getTargetPlatformInstallLocation().exists());
final String[] argsSkipInstall = { // "--installMissingDependencies",
"--targetPlatformInstallLocation", getTargetPlatformInstallLocation().getAbsolutePath(), "--verbose", "--projectlocations", wsRoot, "--buildType", BuildType.allprojects.toString() };
SuccessExitStatus statusSkipInstall = new N4jscBase().doMain(argsSkipInstall);
assertEquals("Should exit with success", SuccessExitStatus.INSTANCE.code, statusSkipInstall.code);
assertTrue("install location still exists", getTargetPlatformInstallLocation().exists());
}
Aggregations