Author: rinrab
Date: Thu Jul 25 19:20:54 2024
New Revision: 1919518

URL: http://svn.apache.org/viewvc?rev=1919518&view=rev
Log:
On the 'cmake' branch: Sync some revisions from the 'trunk', related to tests.

r1919505
ra-test: Support finding svnserve from install layout for ra-test.
---------------------
r1919490
run_tests.py: Add --tools-bin argument to the script and pass it to the tests.
---------------------
r1919489
py-tests: Correctly search for tools in install layout.
---------------------

Modified:
    subversion/branches/cmake/   (props changed)
    subversion/branches/cmake/build/run_tests.py
    subversion/branches/cmake/subversion/tests/cmdline/svntest/main.py
    subversion/branches/cmake/subversion/tests/libsvn_ra/ra-test.c

Propchange: subversion/branches/cmake/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1919489-1919505

Modified: subversion/branches/cmake/build/run_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/cmake/build/run_tests.py?rev=1919518&r1=1919517&r2=1919518&view=diff
==============================================================================
--- subversion/branches/cmake/build/run_tests.py (original)
+++ subversion/branches/cmake/build/run_tests.py Thu Jul 25 19:20:54 2024
@@ -24,8 +24,8 @@
 #
 
 '''usage: python run_tests.py
-            [--verbose] [--log-to-stdout] [--cleanup] [--bin=<path>]
-            [--parallel | --parallel=<n>] [--global-scheduler]
+            [--verbose] [--log-to-stdout] [--cleanup] [--tools-bin=<path>]
+            [--bin=<path>] [--parallel | --parallel=<n>] [--global-scheduler]
             [--url=<base-url>] [--http-library=<http-library>] [--enable-sasl]
             [--fs-type=<fs-type>] [--fsfs-packing] [--fsfs-sharding=<n>]
             [--list] [--milestone-filter=<regex>] [--mode-filter=<type>]
@@ -285,6 +285,8 @@ class TestHarness:
         cmdline.append('--parallel')
       else:
         cmdline.append('--parallel-instances=%d' % self.opts.parallel)
+    if self.opts.tools_bin is not None:
+      cmdline.append('--tools-bin=%s' % self.opts.tools_bin)
     if self.opts.svn_bin is not None:
       cmdline.append('--bin=%s' % self.opts.svn_bin)
     if self.opts.url is not None:
@@ -1062,6 +1064,8 @@ def create_parser():
                     help="Make svn use this DAV library (neon or serf)")
   parser.add_option('--bin', action='store', dest='svn_bin',
                     help='Use the svn binaries installed in this path')
+  parser.add_option('--tools-bin', action='store', dest='tools_bin',
+                    help='Use the svn tools installed in this path')
   parser.add_option('--fsfs-sharding', action='store', type='int',
                     help='Default shard size (for fsfs)')
   parser.add_option('--fsfs-packing', action='store_true',

Modified: subversion/branches/cmake/subversion/tests/cmdline/svntest/main.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/cmake/subversion/tests/cmdline/svntest/main.py?rev=1919518&r1=1919517&r2=1919518&view=diff
==============================================================================
--- subversion/branches/cmake/subversion/tests/cmdline/svntest/main.py 
(original)
+++ subversion/branches/cmake/subversion/tests/cmdline/svntest/main.py Thu Jul 
25 19:20:54 2024
@@ -2496,6 +2496,12 @@ def execute_tests(test_list, serial_only
   global svnmucc_binary
   global svnauthz_binary
   global svnauthz_validate_binary
+  global svnfsfs_binary
+  global entriesdump_binary
+  global lock_helper_binary
+  global atomic_ra_revprop_change_binary
+  global wc_lock_tester_binary
+  global wc_incomplete_tester_binary
   global options
 
   if test_name:
@@ -2597,11 +2603,20 @@ def execute_tests(test_list, serial_only
                                           'svndumpfilter' + _exe)
       svnversion_binary = os.path.join(options.svn_bin, 'svnversion' + _exe)
       svnmucc_binary = os.path.join(options.svn_bin, 'svnmucc' + _exe)
+      svnfsfs_binary = os.path.join(options.svn_bin, 'svnfsfs' + _exe)
 
   if options.tools_bin:
     svnauthz_binary = os.path.join(options.tools_bin, 'svnauthz' + _exe)
     svnauthz_validate_binary = os.path.join(options.tools_bin,
                                             'svnauthz-validate' + _exe)
+    entriesdump_binary = os.path.join(options.tools_bin, 'entries-dump' + _exe)
+    lock_helper_binary = os.path.join(options.tools_bin, 'lock-helper' + _exe)
+    atomic_ra_revprop_change_binary = os.path.join(options.tools_bin,
+                                                   'atomic-ra-revprop-change' 
+ _exe)
+    wc_lock_tester_binary = os.path.join(options.tools_bin,
+                                         'wc-lock-tester' + _exe)
+    wc_incomplete_tester_binary = os.path.join(options.tools_bin,
+                                               'wc-incomplete-tester' + _exe)
 
   ######################################################################
 

Modified: subversion/branches/cmake/subversion/tests/libsvn_ra/ra-test.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/cmake/subversion/tests/libsvn_ra/ra-test.c?rev=1919518&r1=1919517&r2=1919518&view=diff
==============================================================================
--- subversion/branches/cmake/subversion/tests/libsvn_ra/ra-test.c (original)
+++ subversion/branches/cmake/subversion/tests/libsvn_ra/ra-test.c Thu Jul 25 
19:20:54 2024
@@ -208,6 +208,50 @@ check_tunnel(void *tunnel_baton, const c
 static void
 close_tunnel(void *tunnel_context, void *tunnel_baton);
 
+#ifdef WIN32
+#define EXE_EXTENSION ".exe"
+#else
+#define EXE_EXTENSION ""
+#endif
+
+static svn_error_t *
+find_svnserve(const char **svnserve, apr_pool_t *pool)
+{
+  const char *abspath_build_layout;
+  const char *abspath_install_layout;
+  svn_node_kind_t kind;
+
+  /* try build layout first */
+  SVN_ERR(svn_dirent_get_absolute(&abspath_build_layout,
+                                  "../../svnserve/svnserve" EXE_EXTENSION,
+                                  pool));
+
+  SVN_ERR(svn_io_check_path(abspath_build_layout, &kind, pool));
+  if (kind == svn_node_file)
+    {
+      *svnserve = abspath_build_layout;
+      return SVN_NO_ERROR;
+    }
+
+  /* otherwise, try install layout */
+  SVN_ERR(svn_dirent_get_absolute(&abspath_install_layout,
+                                  "svnserve" EXE_EXTENSION, pool));
+
+  SVN_ERR(svn_io_check_path(abspath_install_layout, &kind, pool));
+  if (kind == svn_node_file)
+    {
+      *svnserve = abspath_install_layout;
+      return SVN_NO_ERROR;
+    }
+
+  return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
+                           "Could not find svnserve. Checked paths:\n"
+                           "  %s\n"
+                           "  %s",
+                           svn_dirent_local_style(abspath_build_layout, pool),
+                           svn_dirent_local_style(abspath_install_layout, 
pool));
+}
+
 static svn_error_t *
 open_tunnel(svn_stream_t **request, svn_stream_t **response,
             svn_ra_close_tunnel_func_t *close_func, void **close_baton,
@@ -217,7 +261,6 @@ open_tunnel(svn_stream_t **request, svn_
             svn_cancel_func_t cancel_func, void *cancel_baton,
             apr_pool_t *pool)
 {
-  svn_node_kind_t kind;
   apr_proc_t *proc;
   apr_procattr_t *attr;
   apr_status_t status;
@@ -228,15 +271,7 @@ open_tunnel(svn_stream_t **request, svn_
 
   SVN_TEST_ASSERT(b->magic == TUNNEL_MAGIC);
 
-  SVN_ERR(svn_dirent_get_absolute(&svnserve, "../../svnserve/svnserve", pool));
-#ifdef WIN32
-  svnserve = apr_pstrcat(pool, svnserve, ".exe", SVN_VA_NULL);
-#endif
-  SVN_ERR(svn_io_check_path(svnserve, &kind, pool));
-  if (kind != svn_node_file)
-    return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
-                             "Could not find svnserve at %s",
-                             svn_dirent_local_style(svnserve, pool));
+  SVN_ERR(find_svnserve(&svnserve, pool));
 
   status = apr_procattr_create(&attr, pool);
   if (status == APR_SUCCESS)


Reply via email to