Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cdlang/src/main/java/de/monticore/cdgen/CDGenTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@
asts.forEach(this::runCoCos);
Log.enableFailQuick(true);
}
else {
Log.warn(
"0xTODO: You explicitly ran the CD generator without CoCos. This might lead to incorrect Java code and is not supported.");

Check warning on line 170 in cdlang/src/main/java/de/monticore/cdgen/CDGenTool.java

View workflow job for this annotation

GitHub Actions / check-error-codes

ErrorCodeInvalid

Invalid error code 0xTODO (./cdlang/src/main/java/de/monticore/cdgen/CDGenTool.java:170)
}

// Export original symbol table
if (cmd.hasOption("s")) {
Expand Down
20 changes: 11 additions & 9 deletions cdlang/src/test/java/de/monticore/CDGeneratorToolTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,23 @@ public void testGeneratorToolWithCoCos() {
@Test
public void testGeneratorToolWithSymbolTable() {
new CDGenTool().run(new String[] { "-i",
"src/test/resources/de/monticore/cdgentool/model/Example.cd", "-c2mc", "-s",
"src/test/resources/de/monticore/cdgentool/model/Example.cd", "-c2mc", "-c", "-s",
"target/generated/example/symboltable" });
assertTrue(new File("target/generated/example/symboltable/model/Example.cdsym").isFile());
}

@Test
public void testGeneratorToolWithJavaGeneration() {
new CDGenTool().run(new String[] { "-i",
"src/test/resources/de/monticore/cdgentool/model/Example.cd", "-c2mc", "-o",
"src/test/resources/de/monticore/cdgentool/model/Example.cd", "-c", "-c2mc", "-o",
"target/generated/example/standard", });
assertTrue(new File("target/generated/example/standard/model/Example/A.java").isFile());
}

@Test
public void testGeneratorToolWithEmptyCDWithPackage() {
new CDGenTool().run(new String[] { "-i",
"src/test/resources/de/monticore/cdgentool/model/EmptyWithPackage.cd", "-c2mc", "-o",
"src/test/resources/de/monticore/cdgentool/model/EmptyWithPackage.cd", "-c", "-c2mc", "-o",
"target/generated/example/standard", });

assertTrue(new File("target/generated/example/standard/model/EmptyWithPackage").isDirectory());
Expand All @@ -66,8 +66,8 @@ public void testGeneratorToolWithEmptyCDWithPackage() {
public void testGeneratorToolWithEmptyCDWithoutPackage() {

new CDGenTool().run(new String[] { "-i",
"src/test/resources/de/monticore/cdgentool/model/EmptyWithoutPackage.cd", "-c2mc", "-o",
"target/generated/example/standard", });
"src/test/resources/de/monticore/cdgentool/model/EmptyWithoutPackage.cd", "-c", "-c2mc",
"-o", "target/generated/example/standard", });
assertTrue(new File("target/generated/example/standard/EmptyWithoutPackage").isDirectory());
}

Expand All @@ -93,7 +93,7 @@ public void testGeneratorToolWithAdditionalTemplates() {
@Test
public void testGeneratorToolWithHWC() {
new CDGenTool().run(new String[] { "-i",
"src/test/resources/de/monticore/cdgentool/model/Example.cd", "-c2mc", "-o",
"src/test/resources/de/monticore/cdgentool/model/Example.cd", "-c", "-c2mc", "-o",
"target/generated/example/hwc", "-hwc", "src/test/resources/de/monticore/cdgentool/hwc" });
assertTrue(new File("target/generated/example/hwc/model/Example/ATOP.java").isFile());
}
Expand All @@ -113,7 +113,7 @@ public void testToolPrintVersion() {
public void testGeneratorToolWithPkgSymTab() throws IOException {
new CDGenTool().run(new String[] { "-i",
"src/test/resources/de/monticore/cdgentool/pkg/ExampleWithPkg.cd", "-c2mc", "-o",
"target/generated/example/examplewithpkg", "-s",
"target/generated/example/examplewithpkg", "-c", "-s",
"target/generated/example/examplewithpkg" });
File symtab = new File("target/generated/example/examplewithpkg/pkg/ExampleWithPkg.cdsym");
assertTrue(symtab.isFile());
Expand All @@ -135,12 +135,14 @@ public void testDefaultConstructorDecorator() {
@Test
public void testImportStatements() {
new CDGenTool().run(new String[] { "-i",
"src/test/resources/de/monticore/cdgentool/model/Example.cd", "-o",
"src/test/resources/de/monticore/cdgentool/model/Example.cd", "-c", "-o",
"target/generated/example/imports", "-c2mc", "-s", "target/generated/example/imports/" });

MCAssertions.assertNoFindings();

new CDGenTool().run(new String[] { "-i",
"src/test/resources/de/monticore/cdgentool/ImportTest.cd", "-o",
"target/generated/example/imports", "-c2mc", "-path",
"target/generated/example/imports", "-c", "-c2mc", "-path",
"target/generated/example/imports/" });
}

Expand Down
Loading