Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mjtest
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
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
IPDSnelting
mjtest
Commits
23eee370
Commit
23eee370
authored
Nov 14, 2016
by
Johannes Bechberger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add semantic test runner
parent
713da1c4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
7 deletions
+24
-7
mjtest/environment.py
mjtest/environment.py
+2
-1
mjtest/test/semantic_tests.py
mjtest/test/semantic_tests.py
+12
-0
mjtest/test/tests.py
mjtest/test/tests.py
+10
-6
No files found.
mjtest/environment.py
View file @
23eee370
...
...
@@ -111,7 +111,8 @@ class Environment:
mode_flag
=
{
TestMode
.
lexer
:
"--lextest"
,
TestMode
.
syntax
:
"--parsetest"
,
TestMode
.
ast
:
"--print-ast"
TestMode
.
ast
:
"--print-ast"
,
TestMode
.
semantic
:
"--check"
}[
mode
]
cmd
=
[
self
.
mj_run_cmd
,
mode_flag
]
+
list
(
args
)
return
execute
(
cmd
,
timeout
=
self
.
timeout
)
...
...
mjtest/test/semantic_tests.py
0 → 100644
View file @
23eee370
from
mjtest.environment
import
TestMode
from
mjtest.test.syntax_tests
import
BasicSyntaxTest
from
mjtest.test.tests
import
TestCase
class
BasicSemanticTest
(
BasicSyntaxTest
):
FILE_ENDINGS
=
[
".invalid.mj"
,
".valid.mj"
,
".mj"
,
".invalid.java"
,
".java"
]
MODE
=
TestMode
.
semantic
TestCase
.
TEST_CASE_CLASSES
[
TestMode
.
semantic
].
append
(
BasicSemanticTest
)
\ No newline at end of file
mjtest/test/tests.py
View file @
23eee370
...
...
@@ -127,12 +127,15 @@ class TestSuite:
failed
=
0
count
=
0
for
test_case
in
self
.
test_cases
[
mode
]:
ret
=
self
.
_run_test_case
(
test_case
)
if
ret
is
False
or
not
ret
.
is_correct
():
failed
+=
1
else
:
self
.
_add_correct_test_case
(
test_case
)
count
+=
1
try
:
ret
=
self
.
_run_test_case
(
test_case
)
if
ret
is
False
or
not
ret
.
is_correct
():
failed
+=
1
else
:
self
.
_add_correct_test_case
(
test_case
)
count
+=
1
except
KeyboardInterrupt
:
return
RunResult
(
count
,
failed
)
return
RunResult
(
count
,
failed
)
def
_func
(
self
,
test_case
:
'TestCase'
):
...
...
@@ -425,3 +428,4 @@ TestCase.TEST_CASE_CLASSES[TestMode.lexer].append(LexerDiffTest)
import
mjtest.test.syntax_tests
import
mjtest.test.ast_tests
import
mjtest.test.semantic_tests
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