Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cadbiom
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VIGNET Pierre
cadbiom
Commits
d261dd38
Commit
d261dd38
authored
5 years ago
by
VIGNET Pierre
Browse files
Options
Downloads
Patches
Plain Diff
[lib] Tests: test_antlr_optimization; reactivation of a test deactivated for lack of file available
parent
6564052a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
library/cadbiom/models/clause_constraints/mcl/TestMCLTranslators.py
+28
-11
28 additions, 11 deletions
...dbiom/models/clause_constraints/mcl/TestMCLTranslators.py
with
28 additions
and
11 deletions
library/cadbiom/models/clause_constraints/mcl/TestMCLTranslators.py
+
28
−
11
View file @
d261dd38
...
@@ -43,6 +43,7 @@
...
@@ -43,6 +43,7 @@
Unitary tests for the translators
Unitary tests for the translators
"""
"""
from
__future__
import
print_function
from
__future__
import
print_function
import
pkg_resources
import
unittest
import
unittest
import
sys
import
sys
...
@@ -770,21 +771,37 @@ class TestFull(unittest.TestCase):
...
@@ -770,21 +771,37 @@ class TestFull(unittest.TestCase):
TRACE_FILE
.
write
(
'
place_clocks
'
+
cl_ds
.
place_clocks
.
__str__
()
+
'
\n
'
)
TRACE_FILE
.
write
(
'
place_clocks
'
+
cl_ds
.
place_clocks
.
__str__
()
+
'
\n
'
)
TRACE_FILE
.
write
(
'
inputs
'
+
cl_ds
.
inputs
.
__str__
()
+
'
\n
'
)
TRACE_FILE
.
write
(
'
inputs
'
+
cl_ds
.
inputs
.
__str__
()
+
'
\n
'
)
@unittest.skip
(
"
Test files not provided
"
)
def
test_antlr_optimization
(
self
):
def
test_tgf_no_clock
(
self
):
"""
Optimization gain comparison when using MCLTranslator optimizations
"""
for ANTLR translation (subexpression elimination)
optimisation gain comparison
.. note:: Use test file instead of not provided:
"
../ucl/examples/test_tgfb_ref_300511.bcx
"
"""
"""
rep
=
ErrorRep
()
rep
=
ErrorRep
()
mcla
=
MCLAnalyser
(
rep
)
mcla
=
MCLAnalyser
(
rep
)
mcla
.
opti
=
False
mcla
.
translator_opti
=
False
mcla
.
build_from_chart_file
(
"
../ucl/examples/test_tgfb_ref_300511.bcx
"
)
filename
=
pkg_resources
.
resource_filename
(
mess
=
'
\n
- NB Clauses:
'
+
str
(
len
(
mcla
.
dynamical_system
.
list_clauses
))
__name__
,
# package name
TRACE_FILE
.
write
(
mess
)
"
../../guard_transitions/translators/tests/tgf_cano_noclock_cmp.cal
"
)
mcla
.
build_from_cadlang
(
filename
)
nb_clauses_without_opti
=
len
(
mcla
.
dynamic_system
.
list_clauses
)
TRACE_FILE
.
write
(
'
\n
- NB Clauses:
'
+
str
(
nb_clauses_without_opti
))
mcla
=
MCLAnalyser
(
rep
)
mcla
=
MCLAnalyser
(
rep
)
mcla
.
build_from_chart_file
(
"
../ucl/examples/test_tgfb_ref_300511.bcx
"
)
filename
=
pkg_resources
.
resource_filename
(
mess
=
'
\n
- NB Clauses:
'
+
str
(
len
(
mcla
.
dynamical_system
.
list_clauses
))
__name__
,
# package name
TRACE_FILE
.
write
(
mess
)
"
../../guard_transitions/translators/tests/tgf_cano_noclock_cmp.cal
"
)
mcla
.
build_from_cadlang
(
filename
)
nb_clauses_with_opti
=
len
(
mcla
.
dynamic_system
.
list_clauses
)
TRACE_FILE
.
write
(
'
\n
- NB Clauses:
'
+
str
(
nb_clauses_with_opti
))
assert
nb_clauses_with_opti
<
nb_clauses_without_opti
assert
nb_clauses_with_opti
==
1573
assert
nb_clauses_without_opti
==
1909
class
TestMCLSigExprVisitor
(
unittest
.
TestCase
):
class
TestMCLSigExprVisitor
(
unittest
.
TestCase
):
"""
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment