Author: danielsh
Date: Fri Oct 22 19:07:09 2010
New Revision: 1026451

URL: http://svn.apache.org/viewvc?rev=1026451&view=rev
Log:
Make './fs-test -- -1' work as a way to run the last test in test_funcs.
(To be used when that test is a local addition that hasn't been committed yet.)

* subversion/tests/svn_test_main.c
  (do_test_num):  Allow the test number to be negatiave.
  (main):  Account for negative numbers; filter out --options differently.

Modified:
    subversion/trunk/subversion/tests/svn_test_main.c

Modified: subversion/trunk/subversion/tests/svn_test_main.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/svn_test_main.c?rev=1026451&r1=1026450&r2=1026451&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/svn_test_main.c (original)
+++ subversion/trunk/subversion/tests/svn_test_main.c Fri Oct 22 19:07:09 2010
@@ -191,9 +191,12 @@ do_test_num(const char *progname,
   svn_boolean_t test_failed;
   const char *msg = NULL;  /* the message this individual test prints out */
   const struct svn_test_descriptor_t *desc;
+  const int array_size = get_array_size();
 
   /* Check our array bounds! */
-  if ((test_num > get_array_size()) || (test_num <= 0))
+  if (test_num < 0)
+    test_num += array_size + 1;
+  if ((test_num > array_size) || (test_num <= 0))
     {
       printf("FAIL: %s: THERE IS NO TEST NUMBER %2d\n", progname, test_num);
       skip_cleanup = TRUE;
@@ -424,9 +427,12 @@ main(int argc, const char *argv[])
         {
           for (i = 1; i < argc; i++)
             {
-              if (svn_ctype_isdigit(argv[i][0]))
+              if (svn_ctype_isdigit(argv[i][0]) || argv[i][0] == '-')
                 {
                   int test_num = atoi(argv[i]);
+                  if (test_num == 0)
+                    /* A --option argument, most likely. */
+                    continue;
 
                   ran_a_test = TRUE;
                   if (do_test_num(prog_name, test_num, FALSE, &opts, 
test_pool))


Reply via email to