Browse Source

Minor housekeeping with CHANGES and dist

add mutual exculsivity checking to testrail-tests
George S. Baugh 10 years ago
parent
commit
d0bf0686be
4 changed files with 19 additions and 2 deletions
  1. 3 0
      Changes
  2. 8 0
      bin/testrail-tests
  3. 1 1
      dist.ini
  4. 7 1
      t/testrail-tests.t

+ 3 - 0
Changes

@@ -1,5 +1,8 @@
 Revision history for Perl module TestRail::API
 
+0.026 2015-06-?? TEODESIAN
+    - Add --no-match option to testrail-tests to find orphan tests in a tree
+
 0.025 2015-05-21 TEODESIAN
     - Fix test failures on windows (and an issue in testrail-tests on win32)
     - Fix issue where testrail-tests was unresponsive to --help

+ 8 - 0
bin/testrail-tests

@@ -84,6 +84,9 @@ PARAMETERS:
     -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.
     --no-match [dir]: attempt to find filenames that do not match the test names in the provided dir.
+
+    The match and no-match options are mutually exclusive, and will terminate execution if both are passed.
+
     -n --no-recurse: if match passed, do not recurse subdirectories.
 
   [OPTIONAL PARAMETERS]
@@ -134,6 +137,11 @@ GetOptions(
 );
 
 if ($opts{help}) { help(); }
+if ($opts{'match'} && $opts{'no-match'}) {
+    print "Error! match and no-match options are mutually exclusive.\n";
+    exit 255;
+}
+
 
 #Parse config file if we are missing api url/key or user
 my $homedir = my_home() || '.';

+ 1 - 1
dist.ini

@@ -1,6 +1,6 @@
 name = TestRail-API
 main_module = lib/TestRail/API.pm
-version = 0.025
+version = 0.026
 author = George S. Baugh <teodesian@cpan.org>
 license = Perl_5
 copyright_holder = George S. Baugh

+ 7 - 1
t/testrail-tests.t

@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 
-use Test::More "tests" => 30;
+use Test::More "tests" => 32;
 
 #check plan mode
 my @args = ($^X,qw{bin/testrail-tests --apiurl http://testrail.local --user "test@fake.fake" --password "fake" -j TestProject -p "GosPlan" -r "Executing the great plan" -m t --config testConfig --mock --no-recurse});
@@ -92,4 +92,10 @@ $out = `@args`;
 is($? >> 8, 0, "Exit code OK asking for help");
 like($out,qr/usage/i,"Help output OK");
 
+#Verify no-match and match are mutually exclusive
+@args = ($^X,qw{bin/testrail-tests --no-match t/ --match t/qa });
+$out = `@args`;
+isnt($? >> 8, 0, "Exit code not OK asking for mutually exclusive match options");
+like($out,qr/mutually exclusive/i,"Death message OK");
+