Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
uqdwn
mjtest
Commits
558cba13
Commit
558cba13
authored
Jan 18, 2019
by
Johannes Bechberger
Browse files
Fix `bench` command
parent
529180eb
Changes
4
Show whitespace changes
Inline
Side-by-side
README.md
View file @
558cba13
...
@@ -185,9 +185,10 @@ Output of the `./mjt.py --help`
...
@@ -185,9 +185,10 @@ Output of the `./mjt.py --help`
usage: mjt.py
[
-h
]
[
--only_incorrect_tests
]
[
--all_exec_tests
]
usage: mjt.py
[
-h
]
[
--only_incorrect_tests
]
[
--all_exec_tests
]
[
--produce_no_reports
]
[
--produce_all_reports
]
[
--parallel
]
[
--produce_no_reports
]
[
--produce_all_reports
]
[
--parallel
]
[
--output_no_incorrect_reports
]
[
--color
]
[
--ci_testing
]
[
--output_no_incorrect_reports
]
[
--color
]
[
--ci_testing
]
[
--log_level
LOG_LEVEL]
[
--log_level
LOG_LEVEL]
[
--bench_compiler_flag_1
]
[
--bench_compiler_flag_2
]
{
all,lexer,syntax,ast,semantic,compile-firm-only,compile-only,
{
all,lexer,syntax,ast,semantic,compile-firm-only,compile-only,
compile-firm,compile,exec,exec-firm
}
MJ_RUN
compile-firm,compile,exec,exec-firm
,bench
}
MJ_RUN
MiniJava
test
runner
MiniJava
test
runner
...
@@ -217,6 +218,14 @@ optional arguments:
...
@@ -217,6 +218,14 @@ optional arguments:
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
fail
in
this phase.
fail
in
this phase.
--bench_compiler_flag_1
BENCH_COMPILER_FLAG_1
Set the first compiler flag/mode that is used
for
comparison,
'javac'
for
the java compiler
--bench_compiler_flag_2
BENCH_COMPILER_FLAG_2
Set the first compiler flag/mode that is used
for
comparison,
'javac'
for
the java compiler
--bench_runs
BENCH_RUNS
Number of
times
to run a benchmarked code
--log_level
LOG_LEVEL
--log_level
LOG_LEVEL
Logging level
(
error, warn, info or debug
)
Logging level
(
error, warn, info or debug
)
```
```
...
...
mjtest/cli.py
View file @
558cba13
...
@@ -55,8 +55,12 @@ if True:#__name__ == '__main__':
...
@@ -55,8 +55,12 @@ if True:#__name__ == '__main__':
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."
)
parser
.
add_argument
(
"--bench_compiler_flags"
,
action
=
"store"
,
default
=
""
,
type
=
str
,
nargs
=
2
,
parser
.
add_argument
(
"--bench_compiler_flag_1"
,
action
=
"store"
,
default
=
""
,
type
=
str
,
help
=
"Set the different compiler flags/modes that are compared, 'javac' for the java compiler"
)
help
=
"Set the first compiler flag/mode that is used for comparison, "
"'javac' for the java compiler"
)
parser
.
add_argument
(
"--bench_compiler_flag_2"
,
action
=
"store"
,
default
=
""
,
type
=
str
,
help
=
"Set the first compiler flag/mode that is used for comparison, "
"'javac' for the java compiler"
)
parser
.
add_argument
(
"--bench_runs"
,
action
=
"store"
,
type
=
int
,
default
=
10
,
parser
.
add_argument
(
"--bench_runs"
,
action
=
"store"
,
type
=
int
,
default
=
10
,
help
=
"Number of times to run a benchmarked code"
)
help
=
"Number of times to run a benchmarked code"
)
#parser.add_argument("--timeout", action="store_const", default=30, const="timeout",
#parser.add_argument("--timeout", action="store_const", default=30, const="timeout",
...
...
mjtest/environment.py
View file @
558cba13
...
@@ -80,7 +80,8 @@ class Environment:
...
@@ -80,7 +80,8 @@ class Environment:
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
,
color
:
bool
=
False
,
ci_testing
:
bool
=
False
,
color
:
bool
=
False
,
all_exec_tests
:
bool
=
True
,
bench_compiler_flags
:
List
[
str
]
=
[],
all_exec_tests
:
bool
=
True
,
bench_compiler_flag_1
:
str
=
""
,
bench_compiler_flag_2
:
str
=
""
,
bench_runs
:
int
=
10
):
bench_runs
:
int
=
10
):
if
color
:
if
color
:
force_colored_output
()
force_colored_output
()
...
@@ -134,7 +135,7 @@ class Environment:
...
@@ -134,7 +135,7 @@ class Environment:
self
.
timeout
=
float
(
os
.
getenv
(
"MJ_TIMEOUT"
,
"10"
))
self
.
timeout
=
float
(
os
.
getenv
(
"MJ_TIMEOUT"
,
"10"
))
self
.
big_timeout
=
float
(
os
.
getenv
(
"MJ_BIG_TIMEOUT"
,
"60"
))
self
.
big_timeout
=
float
(
os
.
getenv
(
"MJ_BIG_TIMEOUT"
,
"60"
))
self
.
bench_compiler_flags
=
bench_compiler_flag
s
self
.
bench_compiler_flags
=
[
bench_compiler_flag
_1
,
bench_compiler_flag_2
]
self
.
bench_runs
=
bench_runs
self
.
bench_runs
=
bench_runs
def
create_tmpfile
(
self
)
->
str
:
def
create_tmpfile
(
self
)
->
str
:
...
...
tests
@
78b27a10
Compare
55a3bc04
...
78b27a10
Subproject commit
55a3bc0406183f781d9ed1308a2c46d47ebdad8d
Subproject commit
78b27a109cb1a1a6bc6d3a6e0f57b5018305530c
uqdwn
@uqdwn
mentioned in commit
12186160
·
Jan 18, 2019
mentioned in commit
12186160
mentioned in commit 1218616084807a307c6a40792588f1625a05d552
Toggle commit list
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