Commit de7ad482 authored by Evgeny Kusmenko's avatar Evgeny Kusmenko

Merge branch 'CMakeAutoTest' into 'master'

CMake auto test

See merge request !31
parents 3e86c373 b01fa09a
Pipeline #108051 passed with stages
in 16 minutes and 19 seconds
......@@ -32,17 +32,6 @@ DeployJobLinux:
only:
- master
FakeDeployJobLinux:
stage: linuxDeploy
image: maven:3-jdk-8
dependencies:
- CompileJobLinux
script:
- echo "branch != master => skipping deploy"
- ls target
except:
- master
RosIntegrationJob:
stage: integration
image: registry.git.rwth-aachen.de/monticore/embeddedmontiarc/generators/emam2middleware/ema-ros-kinetic
......
......@@ -9,7 +9,7 @@
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>embedded-montiarc-math-middleware-generator</artifactId>
<version>0.0.18-SNAPSHOT</version>
<version>0.0.19-SNAPSHOT</version>
<!-- == PROJECT DEPENDENCIES ============================================= -->
......@@ -20,7 +20,7 @@
<se-commons.version>1.7.7</se-commons.version>
<embedded-montiarc.version>0.1.9-SNAPSHOT</embedded-montiarc.version>
<Embedded-montiarc-math-generator.version>0.1.5-SNAPSHOT</Embedded-montiarc-math-generator.version>
<Embedded-montiarc-math-generator.version>0.1.7-SNAPSHOT</Embedded-montiarc-math-generator.version>
<Embedded-montiarc-math-roscpp-generator.version>0.1.3-SNAPSHOT</Embedded-montiarc-math-roscpp-generator.version>
<EMADL2CPP.version>0.2.8</EMADL2CPP.version>
<EMADL.version>0.2.6</EMADL.version>
......
......@@ -139,7 +139,7 @@ public final class DistributedTargetGeneratorCli {
}
if (generators.contains(GENERATOR_CPP)) {
generator.add(new CPPGenImpl(), "cpp");
generator.add(new CPPGenImpl(cliParameters.getModelsDir()), "cpp");
}
if (generators.contains(GENERATOR_EMADL)) {
......
package de.monticore.lang.monticar.generator.middleware.impls;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
import de.monticore.lang.monticar.generator.FileContent;
import de.monticore.lang.monticar.generator.cmake.CMakeConfig;
import de.monticore.lang.monticar.generator.cpp.GeneratorCPP;
import de.monticore.lang.monticar.generator.middleware.helpers.NameHelper;
import de.monticore.lang.monticar.generator.middleware.helpers.TemplateHelper;
import de.monticore.lang.tagging._symboltable.TaggingResolver;
import java.io.File;
import java.io.IOException;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
public class CPPGenImpl implements GeneratorImpl {
private String generationTargetPath;
private GeneratorCPP generatorCPP;
private String modelsDir;
public CPPGenImpl(){
public CPPGenImpl(String modelsDir){
this.modelsDir = modelsDir;
}
private void resetGenerator(){
generatorCPP = new GeneratorCPP();
generatorCPP.useArmadilloBackend();
generatorCPP.setGenerateCMake(true);
generatorCPP.setModelsDirPath(Paths.get(modelsDir));
generatorCPP.setGenerateTests(true);
}
public void setGeneratorCPP(GeneratorCPP generatorCPP){
......@@ -29,6 +33,7 @@ public class CPPGenImpl implements GeneratorImpl {
@Override
public List<File> generate(EMAComponentInstanceSymbol componentInstanceSymbol, TaggingResolver taggingResolver) throws IOException {
resetGenerator();
List<File> files = new ArrayList<>();
generatorCPP.setGenerationTargetPath(generationTargetPath);
......
baseDir=$(readlink -f `dirname $0`/../../..)
docker run -v $baseDir:/project registry.git.rwth-aachen.de/monticore/embeddedmontiarc/generators/emam2middleware/ema-ros-kinetic /bin/bash -c "cd project; src/test/bash/integrationTestRos.sh"
chown -R `who am i | awk '{print $1}'` "$baseDir/target/generated-sources-cmake/"
\ No newline at end of file
baseDir=$(readlink -f `dirname $0`/../../..)
docker run -v $baseDir:/project registry.git.rwth-aachen.de/monticore/embeddedmontiarc/generators/emam2middleware/ema-ros-crystal /bin/bash -c "cd project; src/test/bash/integrationTestRos2.sh"
chown -R `who am i | awk '{print $1}'` "$baseDir/target/generated-sources-ros2/"
\ No newline at end of file
......@@ -108,7 +108,7 @@ public class ClusterTest extends AbstractSymtabTest {
DistributedTargetGenerator distributedTargetGenerator = new DistributedTargetGenerator();
distributedTargetGenerator.setGenerationTargetPath("./target/generated-sources-cmake/multiCompCluster/src/");
distributedTargetGenerator.add(new CPPGenImpl(), "cpp");
distributedTargetGenerator.add(new CPPGenImpl("src/test/resources/"), "cpp");
distributedTargetGenerator.add(new RosCppGenImpl(), "roscpp");
List<File> files = distributedTargetGenerator.generate(componentInstanceSymbol, taggingResolver);
......
package de.monticore.lang.monticar.generator.middleware;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast.ASTComponent;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAComponentSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAPortSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAPortInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarcmath.cocos.EmbeddedMontiArcMathCoCos;
import de.monticore.lang.embeddedmontiarc.tagging.middleware.ros.RosConnectionSymbol;
import de.monticore.lang.embeddedmontiarc.tagging.middleware.ros.RosToEmamTagSchema;
import de.monticore.lang.monticar.emadl.generator.EMADLAbstractSymtab;
......@@ -20,13 +17,10 @@ import org.junit.Test;
import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import static junit.framework.TestCase.assertTrue;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.*;
public class GenerationTest extends AbstractSymtabTest {
......@@ -43,7 +37,7 @@ public class GenerationTest extends AbstractSymtabTest {
StarBridgeGenerator starBridgeGenerator = new StarBridgeGenerator();
starBridgeGenerator.setGenerationTargetPath("./target/generated-sources-emam/basicGeneration/src/");
starBridgeGenerator.add(new CPPGenImpl(), "cpp");
starBridgeGenerator.add(new CPPGenImpl(TEST_PATH), "cpp");
starBridgeGenerator.add(new RosCppGenImpl(), "roscpp");
starBridgeGenerator.generate(componentInstanceSymbol, taggingResolver);
......@@ -60,7 +54,7 @@ public class GenerationTest extends AbstractSymtabTest {
CMakeGenerator cmakeGenerator = new CMakeGenerator();
cmakeGenerator.setGenerationTargetPath("./target/generated-sources-cmake-no-build/CMakeGeneration/src/");
cmakeGenerator.add(new CPPGenImpl(), "cpp");
cmakeGenerator.add(new CPPGenImpl(TEST_PATH), "cpp");
cmakeGenerator.add(new RosCppGenImpl(), "roscpp");
cmakeGenerator.generate(componentInstanceSymbol, taggingResolver);
......@@ -75,7 +69,7 @@ public class GenerationTest extends AbstractSymtabTest {
MiddlewareGenerator middlewareGenerator = new MiddlewareGenerator();
String generationTargetPath = "./target/generated-sources-cmake/CMakeCppOnly/src/";
middlewareGenerator.setGenerationTargetPath(generationTargetPath);
middlewareGenerator.add(new CPPGenImpl(), "cpp");
middlewareGenerator.add(new CPPGenImpl(TEST_PATH), "cpp");
List<File> files = middlewareGenerator.generate(componentInstanceSymbol, taggingResolver);
}
......@@ -98,7 +92,7 @@ public class GenerationTest extends AbstractSymtabTest {
String generationTargetPath = "./target/generated-sources-cmake/system/src/";
distributedTargetGenerator.setGenerationTargetPath(generationTargetPath);
//distributedTargetGenerator.setGenDebug(true);
distributedTargetGenerator.add(new CPPGenImpl(), "cpp");
distributedTargetGenerator.add(new CPPGenImpl(TEST_PATH), "cpp");
distributedTargetGenerator.add(new RosCppGenImpl(), "roscpp");
List<File> files = distributedTargetGenerator.generate(componentInstanceSymbol, taggingResolver);
......@@ -118,7 +112,7 @@ public class GenerationTest extends AbstractSymtabTest {
MiddlewareGenerator middlewareGenerator = new MiddlewareGenerator();
middlewareGenerator.setGenerationTargetPath("./target/generated-sources-cmake/middlewareGenerator/src/");
//generator for component itself
middlewareGenerator.add(new CPPGenImpl(), "cpp");
middlewareGenerator.add(new CPPGenImpl(TEST_PATH), "cpp");
//generator for the ros connection
middlewareGenerator.add(new RosCppGenImpl(), "roscpp");
//generator for a dummy to test support for multiple middleware at the same time
......@@ -140,7 +134,7 @@ public class GenerationTest extends AbstractSymtabTest {
DistributedTargetGenerator distributedTargetGenerator = new DistributedTargetGenerator();
distributedTargetGenerator.setGenerationTargetPath("./target/generated-sources-cmake/distributed/src/");
distributedTargetGenerator.add(new CPPGenImpl(), "cpp");
distributedTargetGenerator.add(new CPPGenImpl(TEST_PATH), "cpp");
distributedTargetGenerator.add(new RosCppGenImpl(), "roscpp");
distributedTargetGenerator.generate(componentInstanceSymbol, taggingResolver);
......@@ -159,7 +153,7 @@ public class GenerationTest extends AbstractSymtabTest {
DistributedTargetGenerator distributedTargetGenerator = new DistributedTargetGenerator();
distributedTargetGenerator.setGenerationTargetPath("./target/generated-sources-cmake/distributedStruct/src/");
distributedTargetGenerator.add(new CPPGenImpl(), "cpp");
distributedTargetGenerator.add(new CPPGenImpl(TEST_PATH), "cpp");
distributedTargetGenerator.add(new RosCppGenImpl(), "roscpp");
distributedTargetGenerator.generate(componentInstanceSymbol, taggingResolver);
......@@ -175,7 +169,7 @@ public class GenerationTest extends AbstractSymtabTest {
DistributedTargetGenerator distributedTargetGenerator = new DistributedTargetGenerator();
distributedTargetGenerator.setGenerationTargetPath("./target/generated-sources-cmake/paramInit/src/");
distributedTargetGenerator.add(new CPPGenImpl(), "cpp");
distributedTargetGenerator.add(new CPPGenImpl(TEST_PATH), "cpp");
distributedTargetGenerator.generate(componentInstanceSymbol, taggingResolver);
}
......@@ -222,7 +216,7 @@ public class GenerationTest extends AbstractSymtabTest {
DistributedTargetGenerator distributedTargetGenerator = new DistributedTargetGenerator();
distributedTargetGenerator.setGenerationTargetPath("./target/generated-sources-cmake/" + relPath + "/src/");
distributedTargetGenerator.add(new CPPGenImpl(), "cpp");
distributedTargetGenerator.add(new CPPGenImpl(TEST_PATH), "cpp");
distributedTargetGenerator.add(new RosCppGenImpl(), "roscpp");
distributedTargetGenerator.add(new DummyMiddlewareGenImpl(), "dummy");
......@@ -253,7 +247,7 @@ public class GenerationTest extends AbstractSymtabTest {
MiddlewareGenerator middlewareGenerator = new MiddlewareGenerator();
middlewareGenerator.setGenerationTargetPath("./target/generated-sources-cmake/threeDimMatrixComp/src/");
//generator for component itself
middlewareGenerator.add(new CPPGenImpl(), "cpp");
middlewareGenerator.add(new CPPGenImpl(TEST_PATH), "cpp");
//generator for the ros connection
middlewareGenerator.add(new RosCppGenImpl(), "roscpp");
......@@ -274,7 +268,7 @@ public class GenerationTest extends AbstractSymtabTest {
MiddlewareGenerator middlewareGenerator = new MiddlewareGenerator();
middlewareGenerator.setGenerationTargetPath("./target/generated-sources-cmake/twoDimMatrixComp/src/");
//generator for component itself
middlewareGenerator.add(new CPPGenImpl(), "cpp");
middlewareGenerator.add(new CPPGenImpl(TEST_PATH), "cpp");
//generator for the ros connection
middlewareGenerator.add(new RosCppGenImpl(), "roscpp");
......@@ -328,7 +322,7 @@ public class GenerationTest extends AbstractSymtabTest {
DistributedTargetGenerator distributedTargetGenerator = new DistributedTargetGenerator();
distributedTargetGenerator.setGenerationTargetPath("./target/generated-sources-cmake/noRosMsg/src");
distributedTargetGenerator.add(new CPPGenImpl(),"cpp");
distributedTargetGenerator.add(new CPPGenImpl(TEST_PATH),"cpp");
List<File> files = distributedTargetGenerator.generate(componentInstanceSymbol, taggingResolver);
......
......@@ -29,7 +29,7 @@ public class Ros2GenerationTest extends AbstractSymtabTest {
DistributedTargetGenerator distributedTargetGenerator = new DistributedTargetGenerator();
distributedTargetGenerator.setGenerationTargetPath(OUT_BASE + "addComp/src");
distributedTargetGenerator.add(new CPPGenImpl(),"cpp");
distributedTargetGenerator.add(new CPPGenImpl(TEST_PATH),"cpp");
distributedTargetGenerator.add(new RclCppGenImpl(), "rclcpp");
List<File> files = distributedTargetGenerator.generate(componentInstanceSymbol, taggingResolver);
}
......@@ -48,7 +48,7 @@ public class Ros2GenerationTest extends AbstractSymtabTest {
String generationTargetPath = OUT_BASE + "system/src/";
distributedTargetGenerator.setGenerationTargetPath(generationTargetPath);
//distributedTargetGenerator.setGenDebug(true);
distributedTargetGenerator.add(new CPPGenImpl(), "cpp");
distributedTargetGenerator.add(new CPPGenImpl(TEST_PATH), "cpp");
distributedTargetGenerator.add(new RclCppGenImpl(), "rclcpp");
List<File> files = distributedTargetGenerator.generate(componentInstanceSymbol, taggingResolver);
......@@ -67,7 +67,7 @@ public class Ros2GenerationTest extends AbstractSymtabTest {
DistributedTargetGenerator distributedTargetGenerator = new DistributedTargetGenerator();
distributedTargetGenerator.setGenerationTargetPath(OUT_BASE + "distributed/src/");
distributedTargetGenerator.add(new CPPGenImpl(), "cpp");
distributedTargetGenerator.add(new CPPGenImpl(TEST_PATH), "cpp");
distributedTargetGenerator.add(new RclCppGenImpl(), "rclcpp");
distributedTargetGenerator.generate(componentInstanceSymbol, taggingResolver);
......@@ -86,7 +86,7 @@ public class Ros2GenerationTest extends AbstractSymtabTest {
DistributedTargetGenerator distributedTargetGenerator = new DistributedTargetGenerator();
distributedTargetGenerator.setGenerationTargetPath(OUT_BASE + "distributedStruct/src/");
distributedTargetGenerator.add(new CPPGenImpl(), "cpp");
distributedTargetGenerator.add(new CPPGenImpl(TEST_PATH), "cpp");
distributedTargetGenerator.add(new RclCppGenImpl(), "rclcpp");
distributedTargetGenerator.generate(componentInstanceSymbol, taggingResolver);
......
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