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
8a950618
Commit
8a950618
authored
Nov 19, 2016
by
Johannes Bechberger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add `--color` option and only color output to tty
parent
ea7827ba
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
15 deletions
+18
-15
README.mdwn
README.mdwn
+3
-2
mjtest/cli.py
mjtest/cli.py
+2
-2
mjtest/environment.py
mjtest/environment.py
+4
-4
mjtest/util/utils.py
mjtest/util/utils.py
+9
-7
No files found.
README.mdwn
View file @
8a950618
...
@@ -127,7 +127,7 @@ Output of the `./mjt.py --help`
...
@@ -127,7 +127,7 @@ Output of the `./mjt.py --help`
```
```
usage: mjt.py [-h] [--only_incorrect_tests] [--produce_no_reports]
usage: mjt.py [-h] [--only_incorrect_tests] [--produce_no_reports]
[--produce_all_reports] [--parallel]
[--produce_all_reports] [--parallel]
[--output_no_incorrect_reports] [--
no_
color] [--ci_testing]
[--output_no_incorrect_reports] [--color] [--ci_testing]
[--log_level LOG_LEVEL]
[--log_level LOG_LEVEL]
{all,lexer,syntax,ast,semantic,exec} MJ_RUN
{all,lexer,syntax,ast,semantic,exec} MJ_RUN
...
@@ -151,7 +151,8 @@ optional arguments:
...
@@ -151,7 +151,8 @@ optional arguments:
--parallel Run the tests in parallel
--parallel Run the tests in parallel
--output_no_incorrect_reports
--output_no_incorrect_reports
Output the long report for every incorrect test case
Output the long report for every incorrect test case
--no_color Output no color codes
--color Output color output even if the output goes to into a
file
--ci_testing In mode X the succeeding test cases of later
--ci_testing In mode X the succeeding test cases of later
modes/phases should also succeed in this mode, and
modes/phases should also succeed in this mode, and
failing test cases of prior modes/phases should also
failing test cases of prior modes/phases should also
...
...
mjtest/cli.py
View file @
8a950618
...
@@ -48,8 +48,8 @@ if True:#__name__ == '__main__':
...
@@ -48,8 +48,8 @@ if True:#__name__ == '__main__':
help
=
"Run the tests in parallel"
)
help
=
"Run the tests in parallel"
)
parser
.
add_argument
(
"--output_no_incorrect_reports"
,
action
=
"store_true"
,
default
=
False
,
parser
.
add_argument
(
"--output_no_incorrect_reports"
,
action
=
"store_true"
,
default
=
False
,
help
=
"Output the long report for every incorrect test case"
)
help
=
"Output the long report for every incorrect test case"
)
parser
.
add_argument
(
"--
no_
color"
,
action
=
"store_true"
,
default
=
False
,
parser
.
add_argument
(
"--color"
,
action
=
"store_true"
,
default
=
False
,
help
=
"Output
no color codes
"
)
help
=
"Output
color output even if the output goes to into a file
"
)
parser
.
add_argument
(
"--ci_testing"
,
action
=
"store_true"
,
default
=
False
,
parser
.
add_argument
(
"--ci_testing"
,
action
=
"store_true"
,
default
=
False
,
help
=
"In mode X the succeeding test cases of later modes/phases should also succeed in "
help
=
"In mode X the succeeding test cases of later modes/phases should also succeed in "
"this mode, and failing test cases of prior modes/phases should also fail in this phase."
)
"this mode, and failing test cases of prior modes/phases should also fail in this phase."
)
...
...
mjtest/environment.py
View file @
8a950618
...
@@ -6,7 +6,7 @@ import tempfile
...
@@ -6,7 +6,7 @@ import tempfile
from
datetime
import
datetime
from
datetime
import
datetime
import
time
import
time
from
mjtest.util.shell
import
execute
from
mjtest.util.shell
import
execute
from
mjtest.util.utils
import
get_mjtest_basedir
,
disabl
e_colored_output
from
mjtest.util.utils
import
get_mjtest_basedir
,
forc
e_colored_output
import
mjtest.util.utils
import
mjtest.util.utils
from
typing
import
Tuple
,
List
from
typing
import
Tuple
,
List
from
preproc.preproc.preprocessor
import
PreProcessor
,
PreProcessorError
,
is_importable_file
from
preproc.preproc.preprocessor
import
PreProcessor
,
PreProcessorError
,
is_importable_file
...
@@ -46,9 +46,9 @@ class Environment:
...
@@ -46,9 +46,9 @@ class Environment:
timeout
:
int
=
30
,
report_dir
:
str
=
""
,
log_level
:
str
=
"warn"
,
timeout
:
int
=
30
,
report_dir
:
str
=
""
,
log_level
:
str
=
"warn"
,
produce_no_reports
:
bool
=
True
,
output_no_incorrect_reports
:
bool
=
False
,
produce_no_reports
:
bool
=
True
,
output_no_incorrect_reports
:
bool
=
False
,
produce_all_reports
:
bool
=
False
,
report_subdir
:
str
=
None
,
produce_all_reports
:
bool
=
False
,
report_subdir
:
str
=
None
,
ci_testing
:
bool
=
False
,
no_
color
:
bool
=
False
):
ci_testing
:
bool
=
False
,
color
:
bool
=
False
):
if
no_
color
:
if
color
:
disabl
e_colored_output
()
forc
e_colored_output
()
self
.
mode
=
mode
self
.
mode
=
mode
self
.
mj_run_cmd
=
os
.
path
.
realpath
(
mj_run
)
self
.
mj_run_cmd
=
os
.
path
.
realpath
(
mj_run
)
...
...
mjtest/util/utils.py
View file @
8a950618
...
@@ -3,17 +3,19 @@ from os import path
...
@@ -3,17 +3,19 @@ from os import path
import
sys
import
sys
from
typing
import
Tuple
from
typing
import
Tuple
COLOR_OUTPUT_IF_POSSIBLE
=
Tru
e
COLOR_OUTPUT_IF_POSSIBLE
=
Fals
e
try
:
if
sys
.
stdout
.
isatty
():
import
termcolor
try
:
except
ImportError
:
import
termcolor
COLOR_OUTPUT_IF_POSSIBLE
=
False
COLOR_OUTPUT_IF_POSSIBLE
=
True
except
ImportError
:
COLOR_OUTPUT_IF_POSSIBLE
=
False
def
disabl
e_colored_output
():
def
forc
e_colored_output
():
global
COLOR_OUTPUT_IF_POSSIBLE
global
COLOR_OUTPUT_IF_POSSIBLE
COLOR_OUTPUT_IF_POSSIBLE
=
Fals
e
COLOR_OUTPUT_IF_POSSIBLE
=
Tru
e
def
get_mjtest_basedir
()
->
str
:
def
get_mjtest_basedir
()
->
str
:
...
...
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