Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
monticore
EmbeddedMontiArc
generators
EMAM2Cpp
Commits
81fbcbd3
Commit
81fbcbd3
authored
Dec 02, 2017
by
Sascha Niklas Schneiders
Browse files
Added test for loading of small model
parent
07c265b9
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/test/java/de/monticore/lang/monticar/generator/cpp/BasicGenerationTest.java
View file @
81fbcbd3
...
...
@@ -30,4 +30,15 @@ public class BasicGenerationTest extends AbstractSymtabTest {
String
restPath
=
"testing/l0/"
;
testFilesAreEqual
(
files
,
restPath
);
}
@Test
public
void
testSampleModel
()
throws
IOException
{
TaggingResolver
symtab
=
createSymTabAndTaggingResolver
(
"src/test/resources"
);
ExpandedComponentInstanceSymbol
componentSymbol
=
symtab
.<
ExpandedComponentInstanceSymbol
>
resolve
(
"testing.model"
,
ExpandedComponentInstanceSymbol
.
KIND
).
orElse
(
null
);
assertNotNull
(
componentSymbol
);
GeneratorCPP
generatorCPP
=
new
GeneratorCPP
();
generatorCPP
.
setGenerationTargetPath
(
"./target/generated-sources-cpp/testing/l0"
);
List
<
File
>
files
=
generatorCPP
.
generateFiles
(
componentSymbol
,
symtab
);
}
}
src/test/resources/testing/Model.emam
0 → 100644
View file @
81fbcbd3
package
testing
;
component
Model
{
port
out
Z
(
0
:
255
)^{
640
,
480
}
rgba
[
4
];
instance
ModelColor
<
640
,
480
>
modelColor
;
connect
modelColor
.
red
->
rgba
[
1
];
connect
modelColor
.
green
->
rgba
[
2
];
connect
modelColor
.
blue
->
rgba
[
2
];
connect
modelColor
.
alpha
->
rgba
[
4
];
}
\ No newline at end of file
src/test/resources/testing/ModelColor.emam
0 → 100644
View file @
81fbcbd3
package
testing
;
component
ModelColor
<
N1
width
=
1
,
N1
height
=
1
>{
ports
out
Z
(
0
:
255
)^{
width
,
height
}
red
,
out
Z
(
0
:
255
)^{
width
,
height
}
green
,
out
Z
(
0
:
255
)^{
width
,
height
}
blue
,
out
Z
(
0
:
255
)^{
width
,
height
}
alpha
;
implementation
Math
{
red
=
zeros
(
640
,
480
);
green
=
zeros
(
640
,
480
);
blue
=
zeros
(
640
,
480
);
alpha
=
zeros
(
640
,
480
);
//
set
concrete
values
here
}
}
\ No newline at end of file
Write
Preview
Supports
Markdown
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