Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
C
CNNArch2Caffe2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
monticore
EmbeddedMontiArc
generators
CNNArch2Caffe2
Commits
821b76b8
Commit
821b76b8
authored
Feb 20, 2019
by
Carlos Alfredo Yeverino Rodriguez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated and new junit tests
parent
dbf57936
Pipeline
#106564
passed with stages
in 4 minutes and 14 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
10 deletions
+42
-10
src/test/java/de/monticore/lang/monticar/cnnarch/caffe2generator/GenerationTest.java
...lang/monticar/cnnarch/caffe2generator/GenerationTest.java
+42
-10
No files found.
src/test/java/de/monticore/lang/monticar/cnnarch/caffe2generator/GenerationTest.java
View file @
821b76b8
...
...
@@ -22,6 +22,7 @@ package de.monticore.lang.monticar.cnnarch.caffe2generator;
import
de.se_rwth.commons.logging.Log
;
import
freemarker.template.TemplateException
;
import
org.apache.commons.cli.ParseException
;
import
org.junit.Before
;
import
org.junit.Rule
;
import
org.junit.Test
;
...
...
@@ -31,6 +32,7 @@ import java.nio.file.Path;
import
java.nio.file.Paths
;
import
java.util.*
;
import
org.junit.contrib.java.lang.system.Assertion
;
import
org.junit.contrib.java.lang.system.ExpectedSystemExit
;
import
static
junit
.
framework
.
TestCase
.
assertTrue
;
...
...
@@ -62,26 +64,33 @@ public class GenerationTest extends AbstractSymtabTest{
}
@Test
public
void
testCifar10Classifier
()
throws
IOException
,
TemplateException
{
public
void
test
UnsupportedLayers
Cifar10Classifier
()
throws
IOException
,
TemplateException
{
Log
.
getFindings
().
clear
();
String
[]
args
=
{
"-m"
,
"src/test/resources/valid_tests"
,
"-r"
,
"CifarClassifierNetwork"
,
"-o"
,
"./target/generated-sources-cnnarch/"
};
exit
.
expectSystemExit
();
exit
.
checkAssertionAfterwards
(
new
Assertion
()
{
public
void
checkAssertion
()
{
assertTrue
(
Log
.
getFindings
().
size
()
==
2
);
}
});
CNNArch2Caffe2Cli
.
main
(
args
);
assertTrue
(
Log
.
getFindings
().
size
()
==
2
);
}
@Test
public
void
test
AlexnetGeneration
()
throws
IOException
,
TemplateException
{
public
void
test
UnsupportedLayersAlexnet
()
throws
IOException
,
TemplateException
{
Log
.
getFindings
().
clear
();
String
[]
args
=
{
"-m"
,
"src/test/resources/architectures"
,
"-r"
,
"Alexnet"
,
"-o"
,
"./target/generated-sources-cnnarch/"
};
exit
.
expectSystemExit
();
exit
.
checkAssertionAfterwards
(
new
Assertion
()
{
public
void
checkAssertion
()
{
assertTrue
(
Log
.
getFindings
().
size
()
==
2
);
}
});
CNNArch2Caffe2Cli
.
main
(
args
);
assertTrue
(
Log
.
getFindings
().
size
()
==
2
);
}
@Test
public
void
testGeneratorVGG16
()
throws
IOException
,
TemplateException
{
public
void
testGeneratorVGG16
Generation
()
throws
IOException
,
TemplateException
{
Log
.
getFindings
().
clear
();
String
[]
args
=
{
"-m"
,
"src/test/resources/architectures"
,
"-r"
,
"VGG16"
,
"-o"
,
"./target/generated-sources-cnnarch/"
};
CNNArch2Caffe2Cli
.
main
(
args
);
...
...
@@ -102,17 +111,25 @@ public class GenerationTest extends AbstractSymtabTest{
Log
.
getFindings
().
clear
();
String
[]
args
=
{
"-m"
,
"src/test/resources/architectures"
,
"-r"
,
"ThreeInputCNN_M14"
};
exit
.
expectSystemExit
();
exit
.
checkAssertionAfterwards
(
new
Assertion
()
{
public
void
checkAssertion
()
{
assertTrue
(
Log
.
getFindings
().
size
()
==
2
);
}
});
CNNArch2Caffe2Cli
.
main
(
args
);
assertTrue
(
Log
.
getFindings
().
size
()
==
2
);
}
@Test
public
void
test
ResNeXtGeneration
()
throws
IOException
,
TemplateException
{
public
void
test
UnsupportedLayersResNeXt
()
throws
IOException
,
TemplateException
{
Log
.
getFindings
().
clear
();;
String
[]
args
=
{
"-m"
,
"src/test/resources/architectures"
,
"-r"
,
"ResNeXt50"
};
exit
.
expectSystemExit
();
exit
.
checkAssertionAfterwards
(
new
Assertion
()
{
public
void
checkAssertion
()
{
assertTrue
(
Log
.
getFindings
().
size
()
==
2
);
}
});
CNNArch2Caffe2Cli
.
main
(
args
);
assertTrue
(
Log
.
getFindings
().
size
()
==
2
);
}
@Test
...
...
@@ -190,7 +207,9 @@ public class GenerationTest extends AbstractSymtabTest{
String
rootModelName
=
"alexnet"
;
CNNArch2Caffe2
generator
=
new
CNNArch2Caffe2
();
generator
.
setGenerationTargetPath
(
"./target/generated-sources-cnnarch"
);
generator
.
generateCMake
(
rootModelName
);
if
(
generator
.
isCMakeRequired
()){
generator
.
generateCMake
(
rootModelName
);
}
assertTrue
(
Log
.
getFindings
().
isEmpty
());
...
...
@@ -207,4 +226,17 @@ public class GenerationTest extends AbstractSymtabTest{
"FindArmadillo.cmake"
));
}
@Test
public
void
testWrongArgumentCNNArch2Caffe2Cli
()
throws
ParseException
{
Log
.
getFindings
().
clear
();
String
[]
args
=
{
"-x"
,
"src/test/resources/architectures"
,
"-y"
,
"LeNet"
,
"-z"
,
"./target/generated-sources-cnnarch/"
};
exit
.
expectSystemExit
();
exit
.
checkAssertionAfterwards
(
new
Assertion
()
{
public
void
checkAssertion
()
{
assertTrue
(
Log
.
getFindings
().
size
()
==
2
);
}
});
CNNArch2Caffe2Cli
.
main
(
args
);
}
}
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