Commit 0ea9d834 authored by Christopher Jan-Steffen Brix's avatar Christopher Jan-Steffen Brix
Browse files

Merge branch 'oneclick_nn_training' of...

Merge branch 'oneclick_nn_training' of git.rwth-aachen.de:monticore/EmbeddedMontiArc/generators/EMADL2CPP into oneclick_nn_training
parents 667aacaa cbc64522
Pipeline #101963 failed with stages
in 37 seconds
......@@ -39,7 +39,7 @@
<id>se-nexus</id>
<username>cibuild</username>
<password>${env.cibuild}</password>
</server>
</server>
<server>
<id>github</id>
......@@ -53,7 +53,7 @@
<id>se-nexus</id>
<mirrorOf>external:*</mirrorOf>
<url>https://nexus.se.rwth-aachen.de/content/groups/public</url>
</mirror>
</mirror>
</mirrors>
<profiles>
......@@ -79,6 +79,14 @@
<profile>
<id>se-nexus</id>
<repositories>
<repository>
<id>local-maven-repo</id>
<url>file:///home/maurice/local-maven-repo/</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
<repository>
<id>central</id>
<url>http://central</url>
......@@ -99,5 +107,5 @@
<activeProfiles>
<activeProfile>se-nexus</activeProfile>
</activeProfiles>
</settings>
\ No newline at end of file
</activeProfiles>
</settings>
......@@ -168,7 +168,7 @@ public class EMADLGenerator {
return tempScript;
}
private String getChecksumForFile(String filePath) throws IOException {
public String getChecksumForFile(String filePath) throws IOException {
Path wiki_path = Paths.get(filePath);
MessageDigest md5;
......@@ -350,7 +350,12 @@ public class EMADLGenerator {
EMADLCocos.checkAll(componentInstanceSymbol);
if (architecture.isPresent()){
String dPath = DataPathConfigParser.getDataPath(getModelsPath() + "data_paths.txt", componentSymbol.getFullName());
System.out.println(getModelsPath() + "data_paths.txt");
System.out.println("Lookign for key " + componentSymbol.getFullName());
DataPathConfigParser newParserConfig = new DataPathConfigParser(getModelsPath() + "data_paths.txt");
String dPath = newParserConfig.getDataPath(componentSymbol.getFullName());
/*String dPath = DataPathConfigParser.getDataPath(getModelsPath() + "data_paths.txt", componentSymbol.getFullName());*/
architecture.get().setDataPath(dPath);
architecture.get().setComponentName(componentSymbol.getFullName());
generateCNN(fileContents, taggingResolver, componentInstanceSymbol, architecture.get());
......
......@@ -20,6 +20,8 @@
*/
package de.monticore.lang.monticar.emadl;
import de.monticore.lang.monticar.emadl.generator.Backend;
import de.monticore.lang.monticar.emadl.generator.EMADLGenerator;
import de.monticore.lang.monticar.emadl.generator.EMADLGeneratorCli;
import de.se_rwth.commons.logging.Log;
import freemarker.template.TemplateException;
......@@ -31,6 +33,9 @@ import java.nio.file.Paths;
import java.util.Arrays;
import static junit.framework.TestCase.assertTrue;
import static org.junit.Assert.assertEquals;
import static org.junit.Assume.assumeFalse;
import static org.junit.Assume.assumeTrue;
public class GenerationTest extends AbstractSymtabTest {
......@@ -125,4 +130,19 @@ public class GenerationTest extends AbstractSymtabTest {
EMADLGeneratorCli.main(args);
assertTrue(Log.getFindings().isEmpty());
}
//Test hash-function
@Test
public void testHashFunction() throws IOException, TemplateException {
//EMADLGenerator is tested
EMADLGenerator tester = new EMADLGenerator(Backend.MXNET);
//assert statements
try{
tester.getChecksumForFile("invalid Path!");
assumeFalse("Exception in getChecksum is not correct", false);
}catch(IOException e){
assumeTrue("Exception in getChecksum is correct", true);
}
}
}
cifar10.CifarNetwork data/cifar10_cifar10Classifier_net
\ No newline at end of file
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