|
@@ -21,7 +21,8 @@ testrail-tests - list tests in a run matching the provided filters.
|
|
|
|
|
|
|
|
-p --plan [plan]: desired plan name. Required if the run passed is a child of a plan.
|
|
-p --plan [plan]: desired plan name. Required if the run passed is a child of a plan.
|
|
|
-m --match [dir]: attempt to find filenames matching the test names in the provided dir.
|
|
-m --match [dir]: attempt to find filenames matching the test names in the provided dir.
|
|
|
- -n --no-recurse: if match passed, do not recurse subdirectories.
|
|
|
|
|
|
|
+ --no-match [dir]: attempt to find filenames that do not match test names in the provided dir.
|
|
|
|
|
+ -n --no-recurse: if match (or no-match) passed, do not recurse subdirectories.
|
|
|
|
|
|
|
|
=head3 OPTIONAL PARAMETERS
|
|
=head3 OPTIONAL PARAMETERS
|
|
|
|
|
|
|
@@ -82,6 +83,7 @@ PARAMETERS:
|
|
|
|
|
|
|
|
-p --plan [plan]: desired plan name. Required if the run passed is a child of a plan.
|
|
-p --plan [plan]: desired plan name. Required if the run passed is a child of a plan.
|
|
|
-m --match [dir]: attempt to find filenames matching the test names in the provided dir.
|
|
-m --match [dir]: attempt to find filenames matching the test names in the provided dir.
|
|
|
|
|
+ --no-match [dir]: attempt to find filenames that do not match the test names in the provided dir.
|
|
|
-n --no-recurse: if match passed, do not recurse subdirectories.
|
|
-n --no-recurse: if match passed, do not recurse subdirectories.
|
|
|
|
|
|
|
|
[OPTIONAL PARAMETERS]
|
|
[OPTIONAL PARAMETERS]
|
|
@@ -126,6 +128,7 @@ GetOptions(
|
|
|
'a|assignedto=s@' => \$opts{'users'},
|
|
'a|assignedto=s@' => \$opts{'users'},
|
|
|
'mock' => \$opts{'mock'},
|
|
'mock' => \$opts{'mock'},
|
|
|
'm|match=s' => \$opts{'match'},
|
|
'm|match=s' => \$opts{'match'},
|
|
|
|
|
+ 'no-match=s' => \$opts{'no-match'},
|
|
|
'n|no-recurse' => \$opts{'no-recurse'},
|
|
'n|no-recurse' => \$opts{'no-recurse'},
|
|
|
'h|help' => \$opts{'help'}
|
|
'h|help' => \$opts{'help'}
|
|
|
);
|
|
);
|
|
@@ -235,14 +238,17 @@ if (!$cases) {
|
|
|
my @tests = map {$_->{'title'}} @$cases;
|
|
my @tests = map {$_->{'title'}} @$cases;
|
|
|
my @realtests;
|
|
my @realtests;
|
|
|
|
|
|
|
|
-if ($opts{'match'}) {
|
|
|
|
|
|
|
+if ($opts{'match'} || $opts{'no-match'}) {
|
|
|
|
|
+ my $dir = $opts{'match'} ? $opts{'match'} : $opts{'no-match'};
|
|
|
if (!$opts{'no-recurse'}) {
|
|
if (!$opts{'no-recurse'}) {
|
|
|
- File::Find::find( sub { push(@realtests,$File::Find::name) if -f }, $opts{'match'} );
|
|
|
|
|
|
|
+ File::Find::find( sub { push(@realtests,$File::Find::name) if -f }, $dir );
|
|
|
@tests = grep {my $real = $_; grep { basename($real) eq $_ } @tests} @realtests; #XXX if you have dups in your tree, be-ware
|
|
@tests = grep {my $real = $_; grep { basename($real) eq $_ } @tests} @realtests; #XXX if you have dups in your tree, be-ware
|
|
|
} else {
|
|
} else {
|
|
|
#Handle special windows case -- glob doesn't prepend abspath
|
|
#Handle special windows case -- glob doesn't prepend abspath
|
|
|
- @tests = map {$^O eq 'MSWin32' ? $opts{'match'}."/$_" : $_ } grep {my $fname = $_; grep { basename($_) eq $fname} glob($opts{'match'}."/*") } @tests;
|
|
|
|
|
|
|
+ @realtests = glob("$dir/*");
|
|
|
|
|
+ @tests = map {$^O eq 'MSWin32' ? "$dir/$_" : $_ } grep {my $fname = $_; grep { basename($_) eq $fname} @realtests } @tests;
|
|
|
}
|
|
}
|
|
|
|
|
+ @tests = grep {my $otest = basename($_); scalar(grep {basename($_) eq $otest} @tests) == 0} @realtests if $opts{'no-match'}; #invert the list in this case.
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@tests = map { abs_path($_) } @tests if $opts{'match'};
|
|
@tests = map { abs_path($_) } @tests if $opts{'match'};
|