Commit 88eb588d authored by Kirhan, Cihad's avatar Kirhan, Cihad
Browse files

ConfLang integration

parent 5a403af6
Pipeline #448668 failed with stage
in 1 minute and 55 seconds
......@@ -4,15 +4,19 @@ package de.monticore.lang.monticar.cnnarch.mxnetgenerator;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import conflang._symboltable.ConfLangConfigurationSymbol;
import de.monticore.lang.monticar.cnnarch._symboltable.ArchitectureSymbol;
import de.monticore.lang.monticar.cnnarch.generator.CNNTrainGenerator;
import de.monticore.lang.monticar.cnnarch.generator.TemplateConfiguration;
import de.monticore.lang.monticar.generator.FileContent;
import de.monticore.lang.monticar.generator.cpp.GeneratorCPP;
import de.se_rwth.commons.logging.Log;
import java.nio.file.Path;
import java.io.IOException;
import java.util.*;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
public class CNNTrain2MxNet extends CNNTrainGenerator {
......@@ -66,7 +70,7 @@ public class CNNTrain2MxNet extends CNNTrainGenerator {
// }
@Override
public List<FileContent> generateFileContents(ConfLangConfigurationSymbol configuration, Map<String, Object> architectureAdapterMap) {
public List<FileContent> generateFileContents(ConfLangConfigurationSymbol configuration, Map<String, ArchitectureSymbol> architectureAdapterMap) {
TemplateConfiguration templateConfiguration = new MxNetTemplateConfiguration();
ConfigurationDataConfLang configData = new ConfigurationDataConfLang(configuration, getInstanceName());
List<ConfigurationDataConfLang> configDataList = Lists.newArrayList(configData);
......
......@@ -6,16 +6,15 @@ import freemarker.template.TemplateException;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.contrib.java.lang.system.Assertion;
import org.junit.contrib.java.lang.system.ExpectedSystemExit;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;
import java.util.Arrays;
import org.junit.contrib.java.lang.system.Assertion;
import org.junit.contrib.java.lang.system.ExpectedSystemExit;
import static junit.framework.TestCase.assertTrue;
import static org.junit.Assert.assertEquals;
public class GenerationTest extends AbstractSymtabTest{
@Rule
......@@ -131,9 +130,7 @@ public class GenerationTest extends AbstractSymtabTest{
CNNTrain2MxNet trainGenerator = new CNNTrain2MxNet();
trainGenerator.generate(Paths.get(sourcePath), "FullConfig");
// assertTrue(Log.getFindings().isEmpty()); TODO: activate
assertEquals(0, Log.getErrorCount());
assertTrue(Log.getFindings().isEmpty());
checkFilesAreEqual(
Paths.get("./target/generated-sources-cnnarch"),
Paths.get("./src/test/resources/target_code"),
......@@ -152,9 +149,7 @@ public class GenerationTest extends AbstractSymtabTest{
trainGenerator.generate(modelPath, "SimpleConfig");
// assertTrue(Log.getFindings().isEmpty()); TODO: activate
assertEquals(0, Log.getErrorCount());
assertTrue(Log.getFindings().isEmpty());
checkFilesAreEqual(
Paths.get("./target/generated-sources-cnnarch"),
Paths.get("./src/test/resources/target_code"),
......@@ -169,9 +164,7 @@ public class GenerationTest extends AbstractSymtabTest{
CNNTrain2MxNet trainGenerator = new CNNTrain2MxNet();
trainGenerator.generate(modelPath, "EmptyConfig");
// assertTrue(Log.getFindings().isEmpty()); TODO: activate
assertEquals(0, Log.getErrorCount());
assertTrue(Log.getFindings().isEmpty());
checkFilesAreEqual(
Paths.get("./target/generated-sources-cnnarch"),
Paths.get("./src/test/resources/target_code"),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment