Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
monticore
EmbeddedMontiArc
generators
EMAM2Middleware
Commits
7cd0bf49
Commit
7cd0bf49
authored
Feb 26, 2019
by
Alexander David Hellwig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix testListParameterClusteringArgs
parent
3e86c373
Pipeline
#107772
passed with stages
in 13 minutes and 33 seconds
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
33 additions
and
32 deletions
+33
-32
pom.xml
pom.xml
+2
-2
src/main/java/de/monticore/lang/monticar/generator/middleware/DistributedTargetGeneratorCli.java
...r/generator/middleware/DistributedTargetGeneratorCli.java
+1
-1
src/main/java/de/monticore/lang/monticar/generator/middleware/impls/CPPGenImpl.java
.../lang/monticar/generator/middleware/impls/CPPGenImpl.java
+10
-5
src/test/bash/dockerLocalIntegrationTestRos.sh
src/test/bash/dockerLocalIntegrationTestRos.sh
+1
-0
src/test/bash/dockerLocalIntegrationTestRos2.sh
src/test/bash/dockerLocalIntegrationTestRos2.sh
+1
-0
src/test/java/de/monticore/lang/monticar/generator/middleware/ClusterTest.java
...icore/lang/monticar/generator/middleware/ClusterTest.java
+1
-1
src/test/java/de/monticore/lang/monticar/generator/middleware/GenerationTest.java
...re/lang/monticar/generator/middleware/GenerationTest.java
+13
-19
src/test/java/de/monticore/lang/monticar/generator/middleware/Ros2GenerationTest.java
...ang/monticar/generator/middleware/Ros2GenerationTest.java
+4
-4
No files found.
pom.xml
View file @
7cd0bf49
...
...
@@ -9,7 +9,7 @@
<groupId>
de.monticore.lang.monticar
</groupId>
<artifactId>
embedded-montiarc-math-middleware-generator
</artifactId>
<version>
0.0.1
8
-SNAPSHOT
</version>
<version>
0.0.1
9
-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>
...
...
src/main/java/de/monticore/lang/monticar/generator/middleware/DistributedTargetGeneratorCli.java
View file @
7cd0bf49
...
...
@@ -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
))
{
...
...
src/main/java/de/monticore/lang/monticar/generator/middleware/impls/CPPGenImpl.java
View file @
7cd0bf49
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
);
...
...
src/test/bash/dockerLocalIntegrationTestRos.sh
View file @
7cd0bf49
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
src/test/bash/dockerLocalIntegrationTestRos2.sh
View file @
7cd0bf49
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
src/test/java/de/monticore/lang/monticar/generator/middleware/ClusterTest.java
View file @
7cd0bf49
...
...
@@ -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
);
...
...
src/test/java/de/monticore/lang/monticar/generator/middleware/GenerationTest.java
View file @
7cd0bf49
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
);
...
...
src/test/java/de/monticore/lang/monticar/generator/middleware/Ros2GenerationTest.java
View file @
7cd0bf49
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment