From 0b878ef214f6ba10eed90b32ad903106749db8c7 Mon Sep 17 00:00:00 2001 From: jce Date: Thu, 31 Aug 2023 15:36:33 +0200 Subject: [PATCH] No longer generate RST output when no test case is itemized --- mlx/robot2rst.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/mlx/robot2rst.py b/mlx/robot2rst.py index eecd224..b973cf4 100644 --- a/mlx/robot2rst.py +++ b/mlx/robot2rst.py @@ -142,8 +142,16 @@ def main(): parser = ParserApplication(Path(args.robot_file), args.include) parser.run() - return generate_robot_2_rst(parser, Path(args.rst_file), prefix, relationship_config, - gen_matrix, test_type=test_type, only=args.expression, coverages=coverages) + if parser.tests: + exit_code = generate_robot_2_rst(parser, Path(args.rst_file), prefix, relationship_config, + gen_matrix, test_type=test_type, only=args.expression, coverages=coverages) + else: + msg = f"robot2rst did not generate {args.rst_file} because {args.robot_file} does not contain any test cases" + if args.include: + msg += f" with tags matching all regexes {args.include}" + LOGGER.info(msg) + exit_code = 0 + return exit_code def entrypoint():