@@ -66,10 +66,23 @@ def main(self, arguments: Any, **options: Any) -> Any:
66
66
prog_name = "RobotCode Runner" ,
67
67
message = f"%(prog)s %(version)s\n { USAGE .splitlines ()[0 ].split (' -- ' )[0 ].strip ()} { get_full_version ()} " ,
68
68
)
69
+ @click .option (
70
+ "longname" , "-ZLN" , "--by-longname" , type = str , multiple = True , help = "Select tests/tasks or suites by longname."
71
+ )
72
+ @click .option (
73
+ "exclude_longname" ,
74
+ "-ZEL" ,
75
+ "--exclude-by-longname" ,
76
+ type = str ,
77
+ multiple = True ,
78
+ help = "Excludes tests/tasks or suites by longname." ,
79
+ )
69
80
@click .argument ("robot_options_and_args" , nargs = - 1 , type = click .Path ())
70
81
@pass_application
71
82
def robot (
72
83
app : Application ,
84
+ longname : Tuple [str , ...],
85
+ exclude_longname : Tuple [str , ...],
73
86
robot_options_and_args : Tuple [str , ...],
74
87
) -> Union [str , int , None ]:
75
88
"""Runs "robot" with the selected configuration, profiles, options and arguments.
@@ -99,6 +112,14 @@ def robot(
99
112
100
113
options = profile .build_command_line ()
101
114
115
+ if longname :
116
+ sep = ";" if any (True for l in longname if ":" in l ) else ":"
117
+ options += ("--prerunmodifier" , f"robotcode.modifiers.ByLongName:{ sep .join (longname )} " )
118
+
119
+ if exclude_longname :
120
+ sep = ";" if any (True for l in exclude_longname if ":" in l ) else ":"
121
+ options += ("--prerunmodifier" , f"robotcode.modifiers.ExcludedByLongName:{ sep .join (exclude_longname )} " )
122
+
102
123
if profile .env :
103
124
for k , v in profile .env .items ():
104
125
os .environ [k ] = v
0 commit comments