Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
monticore
EmbeddedMontiArc
generators
EMAM2Cpp
Commits
35fa2eee
Commit
35fa2eee
authored
Aug 05, 2018
by
Sascha Niklas Schneiders
Browse files
test execution and generation finally works on windows now
parent
f83ab6c7
Pipeline
#66653
failed with stage
in 2 minutes and 4 seconds
Changes
12
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
compileCPPTests.bat
View file @
35fa2eee
cd
native
call
variables
.bat
call
compileTestsArmadilloBackendOpenBLAS
.bat
%PROJECT_ROOT%
/
%
1
%PROJECT_ROOT%
/
%
2
call
compileTestsArmadilloBackendOpenBLAS
.bat
%PROJECT_ROOT%%
1
%PROJECT_ROOT%%
2
exit
\ No newline at end of file
executeStreamTest.bat
View file @
35fa2eee
cd
native
call
variables
.bat
cd
%PROJECT_ROOT%
/
%
1
cd
%PROJECT_ROOT%%
1
call
TestsForCurrentModel
.exe
\ No newline at end of file
src/main/java/de/monticore/lang/monticar/generator/order/nfp/TagBreakpointsTagSchema/TagBreakpointsSymbolCreator.java
View file @
35fa2eee
...
...
@@ -128,4 +128,8 @@ public class TagBreakpointsSymbolCreator implements TagSymbolCreator {
return
false
;
}
@Override
public
void
create
(
ASTTaggingUnit
astTaggingUnit
,
Scope
scope
)
{
//TODO implement me, required by newer version
}
}
src/main/java/de/monticore/lang/monticar/generator/order/nfp/TagDelayTagSchema/TagDelaySymbolCreator.java
View file @
35fa2eee
...
...
@@ -128,4 +128,8 @@ public class TagDelaySymbolCreator implements TagSymbolCreator {
return
false
;
}
@Override
public
void
create
(
ASTTaggingUnit
astTaggingUnit
,
Scope
scope
)
{
//TODO implement me, required by newer version
}
}
src/main/java/de/monticore/lang/monticar/generator/order/nfp/TagExecutionOrderTagSchema/TagExecutionOrderSymbolCreator.java
View file @
35fa2eee
...
...
@@ -27,4 +27,8 @@ public class TagExecutionOrderSymbolCreator implements TagSymbolCreator {
packageName
;
}
@Override
public
void
create
(
ASTTaggingUnit
astTaggingUnit
,
Scope
scope
)
{
//TODO implement me, required by newer version
}
}
src/main/java/de/monticore/lang/monticar/generator/order/nfp/TagInitTagSchema/TagInitSymbolCreator.java
View file @
35fa2eee
...
...
@@ -123,4 +123,8 @@ public class TagInitSymbolCreator implements TagSymbolCreator {
return
false
;
}
@Override
public
void
create
(
ASTTaggingUnit
astTaggingUnit
,
Scope
scope
)
{
//TODO implement me, required by newer version
}
}
src/main/java/de/monticore/lang/monticar/generator/order/nfp/TagMinMaxTagSchema/TagMinMaxSymbolCreator.java
View file @
35fa2eee
...
...
@@ -127,4 +127,9 @@ public class TagMinMaxSymbolCreator implements TagSymbolCreator {
scope
.
getScopeKind
()),
scope
.
get_SourcePositionStart
());
return
false
;
}
@Override
public
void
create
(
ASTTaggingUnit
astTaggingUnit
,
Scope
scope
)
{
//TODO implement me, required by newer version
}
}
src/main/java/de/monticore/lang/monticar/generator/order/nfp/TagTableTagSchema/TagTableSymbolCreator.java
View file @
35fa2eee
...
...
@@ -127,4 +127,8 @@ public class TagTableSymbolCreator implements TagSymbolCreator {
return
false
;
}
@Override
public
void
create
(
ASTTaggingUnit
astTaggingUnit
,
Scope
scope
)
{
//TODO implement me, required by newer version
}
}
src/main/java/de/monticore/lang/monticar/generator/order/nfp/TagThresholdTagSchema/TagThresholdSymbolCreator.java
View file @
35fa2eee
...
...
@@ -26,101 +26,105 @@ import java.util.stream.Collectors;
*/
public
class
TagThresholdSymbolCreator
implements
TagSymbolCreator
{
public
static
Scope
getGlobalScope
(
final
Scope
scope
)
{
Scope
s
=
scope
;
while
(
s
.
getEnclosingScope
().
isPresent
())
{
s
=
s
.
getEnclosingScope
().
get
();
public
static
Scope
getGlobalScope
(
final
Scope
scope
)
{
Scope
s
=
scope
;
while
(
s
.
getEnclosingScope
().
isPresent
())
{
s
=
s
.
getEnclosingScope
().
get
();
}
return
s
;
}
return
s
;
}
public
void
create
(
ASTTaggingUnit
unit
,
TaggingResolver
gs
)
{
if
(
unit
.
getQualifiedNameList
().
stream
()
.
map
(
q
->
q
.
toString
())
.
filter
(
n
->
n
.
endsWith
(
"TagThresholdTagSchema"
))
.
count
()
==
0
)
{
return
;
// the tagging model is not conform to the TagExecutionOrderTagSchema tagging schema
}
final
String
packageName
=
Joiners
.
DOT
.
join
(
unit
.
getPackageList
());
final
String
rootCmp
=
// if-else does not work b/cpp of final (required by streams)
(
unit
.
getTagBody
().
getTargetModelOpt
().
isPresent
())
?
Joiners
.
DOT
.
join
(
packageName
,
unit
.
getTagBody
().
getTargetModelOpt
().
get
()
.
getQualifiedNameString
())
:
packageName
;
public
void
create
(
ASTTaggingUnit
unit
,
TaggingResolver
gs
)
{
if
(
unit
.
getQualifiedNameList
().
stream
()
.
map
(
q
->
q
.
toString
())
.
filter
(
n
->
n
.
endsWith
(
"TagThresholdTagSchema"
))
.
count
()
==
0
)
{
return
;
// the tagging model is not conform to the TagExecutionOrderTagSchema tagging schema
}
final
String
packageName
=
Joiners
.
DOT
.
join
(
unit
.
getPackageList
());
final
String
rootCmp
=
// if-else does not work b/cpp of final (required by streams)
(
unit
.
getTagBody
().
getTargetModelOpt
().
isPresent
())
?
Joiners
.
DOT
.
join
(
packageName
,
unit
.
getTagBody
().
getTargetModelOpt
().
get
()
.
getQualifiedNameString
())
:
packageName
;
for
(
ASTTag
element
:
unit
.
getTagBody
().
getTagList
())
{
element
.
getTagElementList
().
stream
()
.
filter
(
t
->
t
.
getName
().
equals
(
"TagThreshold"
))
.
filter
(
t
->
t
.
getTagValueOpt
().
isPresent
())
.
map
(
t
->
checkContent
(
t
.
getTagValueOpt
().
get
()))
.
filter
(
v
->
v
!=
null
)
.
forEachOrdered
(
v
->
element
.
getScopeList
().
stream
()
.
filter
(
this
::
checkScope
)
.
map
(
s
->
(
ASTNameScope
)
s
)
.
map
(
s
->
getGlobalScope
(
gs
).<
Symbol
>
resolveDownMany
(
Joiners
.
DOT
.
join
(
rootCmp
,
s
.
getQualifiedName
().
toString
()),
SymbolKind
.
KIND
))
.
filter
(
s
->
!
s
.
isEmpty
())
.
map
(
this
::
checkKind
)
.
filter
(
s
->
s
!=
null
)
.
forEachOrdered
(
s
->
gs
.
addTag
(
s
,
new
TagThresholdSymbol
(
v
.
doubleValue
()))));
for
(
ASTTag
element
:
unit
.
getTagBody
().
getTagList
())
{
element
.
getTagElementList
().
stream
()
.
filter
(
t
->
t
.
getName
().
equals
(
"TagThreshold"
))
.
filter
(
t
->
t
.
getTagValueOpt
().
isPresent
())
.
map
(
t
->
checkContent
(
t
.
getTagValueOpt
().
get
()))
.
filter
(
v
->
v
!=
null
)
.
forEachOrdered
(
v
->
element
.
getScopeList
().
stream
()
.
filter
(
this
::
checkScope
)
.
map
(
s
->
(
ASTNameScope
)
s
)
.
map
(
s
->
getGlobalScope
(
gs
).<
Symbol
>
resolveDownMany
(
Joiners
.
DOT
.
join
(
rootCmp
,
s
.
getQualifiedName
().
toString
()),
SymbolKind
.
KIND
))
.
filter
(
s
->
!
s
.
isEmpty
())
.
map
(
this
::
checkKind
)
.
filter
(
s
->
s
!=
null
)
.
forEachOrdered
(
s
->
gs
.
addTag
(
s
,
new
TagThresholdSymbol
(
v
.
doubleValue
()))));
}
}
}
protected
Number
checkContent
(
String
s
)
{
TagValueParser
parser
=
new
TagValueParser
();
Optional
<
ASTNumericTagValue
>
ast
;
try
{
boolean
enableFailQuick
=
Log
.
isFailQuickEnabled
();
Log
.
enableFailQuick
(
false
);
long
errorCount
=
Log
.
getErrorCount
();
protected
Number
checkContent
(
String
s
)
{
TagValueParser
parser
=
new
TagValueParser
();
Optional
<
ASTNumericTagValue
>
ast
;
try
{
boolean
enableFailQuick
=
Log
.
isFailQuickEnabled
();
Log
.
enableFailQuick
(
false
);
long
errorCount
=
Log
.
getErrorCount
();
ast
=
parser
.
parse_StringNumericTagValue
(
s
);
ast
=
parser
.
parse_StringNumericTagValue
(
s
);
Log
.
enableFailQuick
(
enableFailQuick
);
if
(
Log
.
getErrorCount
()
>
errorCount
)
{
throw
new
Exception
(
"Error occured during parsing."
);
}
}
catch
(
Exception
e
)
{
Log
.
error
(
String
.
format
(
"0xT0030 Could not parse %s with TagValueParser#parse_StringNumericTagValue."
,
s
),
e
);
return
null
;
}
if
(!
ast
.
isPresent
())
{
return
null
;
Log
.
enableFailQuick
(
enableFailQuick
);
if
(
Log
.
getErrorCount
()
>
errorCount
)
{
throw
new
Exception
(
"Error occured during parsing."
);
}
}
catch
(
Exception
e
)
{
Log
.
error
(
String
.
format
(
"0xT0030 Could not parse %s with TagValueParser#parse_StringNumericTagValue."
,
s
),
e
);
return
null
;
}
if
(!
ast
.
isPresent
())
{
return
null
;
}
return
NumericLiteral
.
getValue
(
ast
.
get
().
getNumericLiteral
());
}
return
NumericLiteral
.
getValue
(
ast
.
get
().
getNumericLiteral
());
}
protected
ExpandedComponentInstanceSymbol
checkKind
(
Collection
<
Symbol
>
symbols
)
{
ExpandedComponentInstanceSymbol
ret
=
null
;
for
(
Symbol
symbol
:
symbols
)
{
if
(
symbol
.
getKind
().
isSame
(
ExpandedComponentInstanceSymbol
.
KIND
))
{
if
(
ret
!=
null
)
{
Log
.
error
(
String
.
format
(
"0xT0031 Found more than one symbol: '%s' and '%s'"
,
ret
,
symbol
));
return
null
;
protected
ExpandedComponentInstanceSymbol
checkKind
(
Collection
<
Symbol
>
symbols
)
{
ExpandedComponentInstanceSymbol
ret
=
null
;
for
(
Symbol
symbol
:
symbols
)
{
if
(
symbol
.
getKind
().
isSame
(
ExpandedComponentInstanceSymbol
.
KIND
))
{
if
(
ret
!=
null
)
{
Log
.
error
(
String
.
format
(
"0xT0031 Found more than one symbol: '%s' and '%s'"
,
ret
,
symbol
));
return
null
;
}
ret
=
(
ExpandedComponentInstanceSymbol
)
symbol
;
}
}
ret
=
(
ExpandedComponentInstanceSymbol
)
symbol
;
}
}
if
(
ret
==
null
)
{
Log
.
error
(
String
.
format
(
"0xT0032 Invalid symbol kinds: %s. tagTypeName expects as symbol kind 'ExpandedComponentInstanceSymbol.KIND'."
,
symbols
.
stream
().
map
(
s
->
"'"
+
s
.
getKind
().
toString
()
+
"'"
).
collect
(
Collectors
.
joining
(
", "
))));
return
null
;
if
(
ret
==
null
)
{
Log
.
error
(
String
.
format
(
"0xT0032 Invalid symbol kinds: %s. tagTypeName expects as symbol kind 'ExpandedComponentInstanceSymbol.KIND'."
,
symbols
.
stream
().
map
(
s
->
"'"
+
s
.
getKind
().
toString
()
+
"'"
).
collect
(
Collectors
.
joining
(
", "
))));
return
null
;
}
return
ret
;
}
return
ret
;
}
protected
boolean
checkScope
(
ASTScope
scope
)
{
if
(
scope
.
getScopeKind
().
equals
(
"NameScope"
))
{
return
true
;
protected
boolean
checkScope
(
ASTScope
scope
)
{
if
(
scope
.
getScopeKind
().
equals
(
"NameScope"
))
{
return
true
;
}
Log
.
error
(
String
.
format
(
"0xT0033 Invalid scope kind: '%s'. PowerConsumption expects as scope kind 'NameScope'."
,
scope
.
getScopeKind
()),
scope
.
get_SourcePositionStart
());
return
false
;
}
Log
.
error
(
String
.
format
(
"0xT0033 Invalid scope kind: '%s'. PowerConsumption expects as scope kind 'NameScope'."
,
scope
.
getScopeKind
()),
scope
.
get_SourcePositionStart
());
return
false
;
}
@Override
public
void
create
(
ASTTaggingUnit
astTaggingUnit
,
Scope
scope
)
{
//TODO implement me, required by newer version
}
}
src/main/java/de/monticore/lang/monticar/generator/order/tools/Slist.java
View file @
35fa2eee
...
...
@@ -118,4 +118,6 @@ public class Slist extends AbstractSymtab {
public
static
void
resetNonVirtualBlockSize
()
{
nonVirtualBlockSize
=
0
;
}
}
src/main/java/de/monticore/lang/monticar/generator/testing/StreamTest.java
View file @
35fa2eee
package
de.monticore.lang.monticar.generator.testing
;
import
de.se_rwth.commons.logging.Log
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -129,7 +131,7 @@ public class StreamTest {
if
(
matchPort
!=
port
)
{
String
curName
=
getNameWithoutArrayPart
(
port
.
getName
());
if
(
curName
.
equals
(
matchName
))
{
System
.
out
.
println
(
"Found Same Ports: "
+
matchPort
.
getName
()
+
" "
+
port
.
getName
()
+
" for names "
+
matchName
+
" "
+
curName
);
Log
.
debug
(
matchPort
.
getName
()
+
" "
+
port
.
getName
()
+
" for names "
+
matchName
+
" "
+
curName
,
"Found Same Ports"
);
if
(!
samePorts
.
contains
(
port
))
samePorts
.
add
(
port
);
if
(!
samePorts
.
contains
(
matchPort
))
{
...
...
src/main/java/de/monticore/lang/monticar/generator/testing/StreamTestExecution.java
View file @
35fa2eee
...
...
@@ -2,7 +2,7 @@ package de.monticore.lang.monticar.generator.testing;
import
de.se_rwth.commons.logging.Log
;
import
java.io.
IOException
;
import
java.io.
*
;
/**
* @author Sascha Schneiders
...
...
@@ -10,6 +10,12 @@ import java.io.IOException;
public
class
StreamTestExecution
{
public
static
void
compileTests
(
String
targetFullPath
,
String
targetBasePath
)
throws
IOException
{
File
f
=
new
File
(
"."
+
targetBasePath
+
"/exec"
);
if
(!
f
.
exists
())
{
f
.
mkdirs
();
f
.
mkdir
();
}
Process
p
=
Runtime
.
getRuntime
().
exec
(
new
String
[]{
"compileCPPTests.bat"
,
targetFullPath
,
targetBasePath
+
"/exec"
});
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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