no message

This commit is contained in:
Ivan Kravets
2022-05-15 14:54:07 +03:00
parent db11244f49
commit b90e89a791
3 changed files with 15 additions and 12 deletions

2
docs

Submodule docs updated: 30e2c2d667...5e906bbc75

View File

@ -83,8 +83,8 @@ from platformio.test.runners.factory import TestRunnerFactory
help="A program argument (multiple are allowed)", help="A program argument (multiple are allowed)",
) )
@click.option("--list-tests", is_flag=True) @click.option("--list-tests", is_flag=True)
@click.option("--json-output", type=click.Path(resolve_path=True)) @click.option("--json-output-path", type=click.Path(resolve_path=True))
@click.option("--junit-output", type=click.Path(resolve_path=True)) @click.option("--junit-output-path", type=click.Path(resolve_path=True))
@click.option("--verbose", "-v", is_flag=True) @click.option("--verbose", "-v", is_flag=True)
@click.pass_context @click.pass_context
def test_cmd( # pylint: disable=too-many-arguments,too-many-locals,redefined-builtin def test_cmd( # pylint: disable=too-many-arguments,too-many-locals,redefined-builtin
@ -104,8 +104,8 @@ def test_cmd( # pylint: disable=too-many-arguments,too-many-locals,redefined-bu
monitor_dtr, monitor_dtr,
program_args, program_args,
list_tests, list_tests,
json_output, json_output_path,
junit_output, junit_output_path,
verbose, verbose,
): ):
app.set_session_var("custom_project_conf", project_conf) app.set_session_var("custom_project_conf", project_conf)
@ -157,7 +157,10 @@ def test_cmd( # pylint: disable=too-many-arguments,too-many-locals,redefined-bu
stdout_report = TestReportFactory.new("stdout", test_result) stdout_report = TestReportFactory.new("stdout", test_result)
stdout_report.generate(verbose=verbose or list_tests) stdout_report.generate(verbose=verbose or list_tests)
for output_format, output_path in [("json", json_output), ("junit", junit_output)]: for output_format, output_path in [
("json", json_output_path),
("junit", junit_output_path),
]:
if not output_path: if not output_path:
continue continue
custom_report = TestReportFactory.new(output_format, test_result) custom_report = TestReportFactory.new(output_format, test_result)

View File

@ -36,7 +36,7 @@ def test_calculator_example(tmp_path: Path):
"uno", "uno",
"-e", "-e",
"native", "native",
"--junit-output", "--junit-output-path",
str(junit_output_path), str(junit_output_path),
] ]
) )
@ -73,7 +73,7 @@ def test_list_tests(clirunner, validate_cliresult, tmp_path: Path):
"-d", "-d",
os.path.join("examples", "unit-testing", "calculator"), os.path.join("examples", "unit-testing", "calculator"),
"--list-tests", "--list-tests",
"--json-output", "--json-output-path",
str(json_output_path), str(json_output_path),
], ],
) )
@ -547,7 +547,7 @@ int main(int argc, char **argv)
[ [
"-d", "-d",
str(project_dir), str(project_dir),
"--junit-output", "--junit-output-path",
str(junit_output_path), str(junit_output_path),
], ],
) )
@ -572,7 +572,7 @@ int main(int argc, char **argv)
[ [
"-d", "-d",
str(project_dir), str(project_dir),
"--json-output", "--json-output-path",
str(json_output_path), str(json_output_path),
"-a", "-a",
"-aa=1", # fail after the 1 error "-aa=1", # fail after the 1 error
@ -596,7 +596,7 @@ def test_googletest_framework(clirunner, tmp_path: Path):
project_dir, project_dir,
"-e", "-e",
"native", "native",
"--junit-output", "--junit-output-path",
str(junit_output_path), str(junit_output_path),
], ],
) )
@ -623,7 +623,7 @@ def test_googletest_framework(clirunner, tmp_path: Path):
project_dir, project_dir,
"-e", "-e",
"native", "native",
"--json-output", "--json-output-path",
str(json_output_path), str(json_output_path),
"-a", "-a",
"--gtest_filter=-FooTest.Bar", "--gtest_filter=-FooTest.Bar",