use of org.eclipse.n4js.cli.helper.CliCompileResult in project n4js by eclipse.
the class AT_GHOLD_212_transpilecrashTest method testCompileOfExtendedIterator_from_RuntimeLibrary.
/**
* The Problem was, that nothing was compiled.
*/
@Test
public void testCompileOfExtendedIterator_from_RuntimeLibrary() {
File proot = new File(workspace, PACKAGES);
N4jscOptions options = COMPILE(proot);
CliCompileResult cliResult = n4jsc(options, VALIDATION_ERRORS);
// Make sure, we get here and have exactly one file compiled:
assertEquals(cliResult.toString(), 1, cliResult.getTranspiledFilesCount());
}
use of org.eclipse.n4js.cli.helper.CliCompileResult in project n4js by eclipse.
the class AT_IDEBUG_532_transpilecrashTest method testCompileOfExtendedIterator_from_RuntimeLibrary.
/**
* The Problem was, that nothing was compiled.
*/
@Test
public void testCompileOfExtendedIterator_from_RuntimeLibrary() {
File proot = new File(workspace, PACKAGES);
N4jscOptions options = COMPILE(proot);
CliCompileResult cliResult = n4jsc(options);
// Make sure, we get here and have exactly one file compiled:
assertEquals(cliResult.toString(), 0, cliResult.getTranspiledFilesCount(proot.toPath().resolve("APIx")));
assertEquals(cliResult.toString(), 1, cliResult.getTranspiledFilesCount(proot.toPath().resolve("IMPLx")));
}
use of org.eclipse.n4js.cli.helper.CliCompileResult in project n4js by eclipse.
the class AT_IDEBUG_695_CannotSetFinalFieldInCtorForStaticPolyfillsTest method compileCheckFinalFieldCanBeSetInInheritedCtor_ExpectCanBeSet.
/**
*/
@Test
public void compileCheckFinalFieldCanBeSetInInheritedCtor_ExpectCanBeSet() {
Path projectDir = workspace.toPath().resolve(WS_IDEBUG_695);
Path fileToRun = projectDir.resolve("src-gen/Main.js");
N4jscOptions options = COMPILE(workspace);
CliCompileResult cliResult = n4jsc(options, VALIDATION_ERRORS);
assertEquals(cliResult.toString(), 2, cliResult.getTranspiledFilesCount());
ProcessResult nodejsResult = nodejsRun(projectDir, fileToRun);
assertEquals(nodejsResult.toString(), "A.a == 5: true", nodejsResult.getStdOut());
}
use of org.eclipse.n4js.cli.helper.CliCompileResult in project n4js by eclipse.
the class N4JSXTest method testN4JSX.
/**
* Compile an n4jsx workspace.
*/
@Test
public void testN4JSX() {
CliCompileResult cliResult = n4jsc(COMPILE(workspace), VALIDATION_ERRORS);
Collection<String> fileNames = cliResult.getTranspiledFileNames();
String expected = "packages/P1/src-gen/bar.js, ";
expected += "packages/P2/src-gen/foo.js, ";
expected += "packages/P2/src-gen/bar.js, ";
expected += "packages/P2/src-gen/bar2.js, ";
expected += "packages/P3/src-gen/bar.js, ";
expected += "packages/P3/src-gen/foo.js";
assertEquals(cliResult.toString(), 6, cliResult.getTranspiledFilesCount());
assertEquals(cliResult.toString(), expected, String.join(", ", fileNames));
}
use of org.eclipse.n4js.cli.helper.CliCompileResult in project n4js by eclipse.
the class N4jscCleanTest method testCleanCompile.
/**
* Basic compile test.
*/
@Test
public void testCleanCompile() {
CliCompileResult compileResult = n4jsc(COMPILE(workspace), VALIDATION_ERRORS);
assertEquals(compileResult.toString(), 4, compileResult.getTranspiledFilesCount());
CliCompileResult cleanResult = n4jsc(COMPILE(workspace).clean(), VALIDATION_ERRORS);
assertEquals(cleanResult.toString(), 8, cleanResult.getDeletedFilesCount());
}
Aggregations