subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1545334 - in /subversion/trunk: build/ subversion/tests/ subversion/tests/libsvn_client/ subversion/tests/libsvn_delta/ subversion/tests/libsvn_diff/ subversion/tests/libsvn_fs/ subversion/tests/libsvn_fs_base/ subversion/tests/libsvn_fs_f...
Date Mon, 25 Nov 2013 16:11:43 GMT
Author: stefan2
Date: Mon Nov 25 16:11:42 2013
New Revision: 1545334

URL: http://svn.apache.org/r1545334
Log:
Add "--parallel" option to our C tests.

Besides shaving off a few seconds off our total test execution time,
parallel execution also stresses our code and the tests themselves
harder.  It uncovers things like improperly separated working sets
that make post-failure analysis harder.

Parallel mode is only available with APR 1.3+ and threads enabled.
The option will simply be ignored in other configurations. Further
limitations are cleanups being delayed to after all tests completed
and segfaults not being intercepted.

Some tests can't be executed in parallel.  Therefore, we introduce
svn_test_max_threads a simple upper limit to the number of threads
supported that each test must define alongside the test_funcs array.
This patch sets it to "1" in many cases because the tests are so
small that multi-threaded execution is simply not worth it.

* build/run_tests.py
  (TestHarness._run_c_test): Pass --parallel option to the individual
                             test applications.

* subversion/tests/svn_test.h
  (svn_test_max_threads): Declare new external setting to be set by
                          every test application.

* subversion/tests/svn_test_main.c
  (parallel): New command line option presence flag.
  (parallel_opt,
   cl_options): Declare the new "--parallel" option.
  (svn_test_add_dir_cleanup): Synchronize shared pool access since
                              this might be called from multiple
                              threads at the same time.
  (log_results): Result logger function factored out from do_test_num
                 to be shared between serialized and parallel test
                 execution code.
  (do_test_num): Use that new function.
  (test_params_t,
   test_thread,
   do_tests_concurrently): Threads, their parameter and the thread
                           starter for thread-pooled test execution.
  (main): Handle the new option.
          Call concurrent execution when in PARALLEL mode.

* subversion/tests/libsvn_delta/random-test.c
  subversion/tests/libsvn_subr/named_atomic-test.c
  (svn_test_max_threads): These tests don't support concurrent execution.

* subversion/tests/libsvn_delta/random-test.c
  subversion/tests/libsvn_delta/window-test.c
  subversion/tests/libsvn_diff/parse-diff-test.c
  subversion/tests/libsvn_ra_local/ra-local-test.c
  subversion/tests/libsvn_ra/ra-test.c
  subversion/tests/libsvn_subr/auth-test.c
  subversion/tests/libsvn_subr/cache-test.c
  subversion/tests/libsvn_subr/checksum-test.c
  subversion/tests/libsvn_subr/compat-test.c
  subversion/tests/libsvn_subr/config-test.c
  subversion/tests/libsvn_subr/crypto-test.c
  subversion/tests/libsvn_subr/dirent_uri-test.c
  subversion/tests/libsvn_subr/error-code-test.c
  subversion/tests/libsvn_subr/error-test.c
  subversion/tests/libsvn_subr/hashdump-test.c
  subversion/tests/libsvn_subr/mergeinfo-test.c
  subversion/tests/libsvn_subr/named_atomic-test.c
  subversion/tests/libsvn_subr/opt-test.c
  subversion/tests/libsvn_subr/packed-data-test.c
  subversion/tests/libsvn_subr/path-test.c
  subversion/tests/libsvn_subr/prefix-string-test.c
  subversion/tests/libsvn_subr/priority-queue-test.c
  subversion/tests/libsvn_subr/revision-test.c
  subversion/tests/libsvn_subr/root-pools-test.c
  subversion/tests/libsvn_subr/skel-test.c
  subversion/tests/libsvn_subr/spillbuf-test.c
  subversion/tests/libsvn_subr/sqlite-test.c
  subversion/tests/libsvn_subr/stream-test.c
  subversion/tests/libsvn_subr/string-test.c
  subversion/tests/libsvn_subr/subst_translate-test.c
  subversion/tests/libsvn_subr/time-test.c
  subversion/tests/libsvn_subr/utf-test.c
  subversion/tests/libsvn_wc/conflict-data-test.c
  subversion/tests/libsvn_wc/wc-queries-test.c:
  (svn_test_max_threads): These are too small to benefit from multi-threading.

* subversion/tests/libsvn_client/client-test.c
  subversion/tests/libsvn_diff/diff-diff3-test.c
  subversion/tests/libsvn_fs_base/changes-test.c
  subversion/tests/libsvn_fs_base/fs-base-test.c
  subversion/tests/libsvn_fs_base/strings-reps-test.c
  subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c
  subversion/tests/libsvn_fs/fs-test.c
  subversion/tests/libsvn_fs/locks-test.c
  subversion/tests/libsvn_fs_x/fs-x-pack-test.c
  subversion/tests/libsvn_fs_x/string-table-test.c
  subversion/tests/libsvn_repos/repos-test.c
  subversion/tests/libsvn_subr/io-test.c
  subversion/tests/libsvn_subr/translate-test.c
  subversion/tests/libsvn_wc/db-test.c
  subversion/tests/libsvn_wc/op-depth-test.c
  subversion/tests/libsvn_wc/wc-test.c
  (svn_test_max_threads): Set concurrency limit to whatever various test
                          runs suggested as the most efficient value.

* subversion/tests/libsvn_wc/entries-compat.c
  subversion/tests/libsvn_wc/pristine-store-test.c
  (svn_test_max_threads): Set concurrency limit to "unbounded".

Modified:
    subversion/trunk/build/run_tests.py
    subversion/trunk/subversion/tests/libsvn_client/client-test.c
    subversion/trunk/subversion/tests/libsvn_delta/random-test.c
    subversion/trunk/subversion/tests/libsvn_delta/window-test.c
    subversion/trunk/subversion/tests/libsvn_diff/diff-diff3-test.c
    subversion/trunk/subversion/tests/libsvn_diff/parse-diff-test.c
    subversion/trunk/subversion/tests/libsvn_fs/fs-test.c
    subversion/trunk/subversion/tests/libsvn_fs/locks-test.c
    subversion/trunk/subversion/tests/libsvn_fs_base/changes-test.c
    subversion/trunk/subversion/tests/libsvn_fs_base/fs-base-test.c
    subversion/trunk/subversion/tests/libsvn_fs_base/strings-reps-test.c
    subversion/trunk/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c
    subversion/trunk/subversion/tests/libsvn_fs_x/fs-x-pack-test.c
    subversion/trunk/subversion/tests/libsvn_fs_x/string-table-test.c
    subversion/trunk/subversion/tests/libsvn_ra/ra-test.c
    subversion/trunk/subversion/tests/libsvn_ra_local/ra-local-test.c
    subversion/trunk/subversion/tests/libsvn_repos/repos-test.c
    subversion/trunk/subversion/tests/libsvn_subr/auth-test.c
    subversion/trunk/subversion/tests/libsvn_subr/cache-test.c
    subversion/trunk/subversion/tests/libsvn_subr/checksum-test.c
    subversion/trunk/subversion/tests/libsvn_subr/compat-test.c
    subversion/trunk/subversion/tests/libsvn_subr/config-test.c
    subversion/trunk/subversion/tests/libsvn_subr/crypto-test.c
    subversion/trunk/subversion/tests/libsvn_subr/dirent_uri-test.c
    subversion/trunk/subversion/tests/libsvn_subr/error-code-test.c
    subversion/trunk/subversion/tests/libsvn_subr/error-test.c
    subversion/trunk/subversion/tests/libsvn_subr/hashdump-test.c
    subversion/trunk/subversion/tests/libsvn_subr/io-test.c
    subversion/trunk/subversion/tests/libsvn_subr/mergeinfo-test.c
    subversion/trunk/subversion/tests/libsvn_subr/named_atomic-test.c
    subversion/trunk/subversion/tests/libsvn_subr/opt-test.c
    subversion/trunk/subversion/tests/libsvn_subr/packed-data-test.c
    subversion/trunk/subversion/tests/libsvn_subr/path-test.c
    subversion/trunk/subversion/tests/libsvn_subr/prefix-string-test.c
    subversion/trunk/subversion/tests/libsvn_subr/priority-queue-test.c
    subversion/trunk/subversion/tests/libsvn_subr/revision-test.c
    subversion/trunk/subversion/tests/libsvn_subr/root-pools-test.c
    subversion/trunk/subversion/tests/libsvn_subr/skel-test.c
    subversion/trunk/subversion/tests/libsvn_subr/spillbuf-test.c
    subversion/trunk/subversion/tests/libsvn_subr/sqlite-test.c
    subversion/trunk/subversion/tests/libsvn_subr/stream-test.c
    subversion/trunk/subversion/tests/libsvn_subr/string-test.c
    subversion/trunk/subversion/tests/libsvn_subr/subst_translate-test.c
    subversion/trunk/subversion/tests/libsvn_subr/time-test.c
    subversion/trunk/subversion/tests/libsvn_subr/translate-test.c
    subversion/trunk/subversion/tests/libsvn_subr/utf-test.c
    subversion/trunk/subversion/tests/libsvn_wc/conflict-data-test.c
    subversion/trunk/subversion/tests/libsvn_wc/db-test.c
    subversion/trunk/subversion/tests/libsvn_wc/entries-compat.c
    subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c
    subversion/trunk/subversion/tests/libsvn_wc/pristine-store-test.c
    subversion/trunk/subversion/tests/libsvn_wc/wc-queries-test.c
    subversion/trunk/subversion/tests/libsvn_wc/wc-test.c
    subversion/trunk/subversion/tests/svn_test.h
    subversion/trunk/subversion/tests/svn_test_main.c

Modified: subversion/trunk/build/run_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/build/run_tests.py?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/build/run_tests.py (original)
+++ subversion/trunk/build/run_tests.py Mon Nov 25 16:11:42 2013
@@ -377,6 +377,8 @@ class TestHarness:
       cmdline.append('--list')
     if self.mode_filter is not None:
       cmdline.append('--mode-filter=' + self.mode_filter)
+    if self.parallel is not None:
+      cmdline.append('--parallel')
 
     if test_nums:
       test_nums = test_nums.split(',')

Modified: subversion/trunk/subversion/tests/libsvn_client/client-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_client/client-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_client/client-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_client/client-test.c Mon Nov 25 16:11:42 2013
@@ -771,6 +771,9 @@ test_foreign_repos_copy(const svn_test_o
 
 /* ========================================================================== */
 
+
+int svn_test_max_threads = 3;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_delta/random-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_delta/random-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_delta/random-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_delta/random-test.c Mon Nov 25 16:11:42 2013
@@ -512,6 +512,8 @@ random_combine_test(apr_pool_t *pool)
 
 /* The test table.  */
 
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_delta/window-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_delta/window-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_delta/window-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_delta/window-test.c Mon Nov 25 16:11:42 2013
@@ -100,6 +100,8 @@ stream_window_test(apr_pool_t *pool)
 
 /* The test table.  */
 
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_diff/diff-diff3-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_diff/diff-diff3-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_diff/diff-diff3-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_diff/diff-diff3-test.c Mon Nov 25 16:11:42 2013
@@ -2950,6 +2950,9 @@ two_way_issue_3362_v2(apr_pool_t *pool)
 
 /* ========================================================================== */
 
+
+int svn_test_max_threads = 4;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_diff/parse-diff-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_diff/parse-diff-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_diff/parse-diff-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_diff/parse-diff-test.c Mon Nov 25 16:11:42 2013
@@ -961,6 +961,9 @@ test_parse_unidiff_lacking_trailing_eol(
 
 /* ========================================================================== */
 
+
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_fs/fs-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_fs/fs-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_fs/fs-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_fs/fs-test.c Mon Nov 25 16:11:42 2013
@@ -5078,6 +5078,8 @@ test_fs_info_format(const svn_test_opts_
 
 /* The test table.  */
 
+int svn_test_max_threads = 8;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_fs/locks-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_fs/locks-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_fs/locks-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_fs/locks-test.c Mon Nov 25 16:11:42 2013
@@ -792,6 +792,8 @@ lock_out_of_date(const svn_test_opts_t *
 
 /* The test table.  */
 
+int svn_test_max_threads = 2;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_fs_base/changes-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_fs_base/changes-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_fs_base/changes-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_fs_base/changes-test.c Mon Nov 25 16:11:42 2013
@@ -903,6 +903,8 @@ changes_bad_sequences(const svn_test_opt
 
 /* The test table.  */
 
+int svn_test_max_threads = 4;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_fs_base/fs-base-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_fs_base/fs-base-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_fs_base/fs-base-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_fs_base/fs-base-test.c Mon Nov 25 16:11:42 2013
@@ -1519,6 +1519,8 @@ key_test(apr_pool_t *pool)
 
 /* The test table.  */
 
+int svn_test_max_threads = 2;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_fs_base/strings-reps-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_fs_base/strings-reps-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_fs_base/strings-reps-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_fs_base/strings-reps-test.c Mon Nov 25 16:11:42 2013
@@ -732,6 +732,8 @@ copy_string(const svn_test_opts_t *opts,
 
 /* The test table.  */
 
+int svn_test_max_threads = 3;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c Mon Nov 25 16:11:42 2013
@@ -894,6 +894,8 @@ get_set_multiple_huge_revprops_packed_fs
 
 /* The test table.  */
 
+int svn_test_max_threads = 4;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_fs_x/fs-x-pack-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_fs_x/fs-x-pack-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_fs_x/fs-x-pack-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_fs_x/fs-x-pack-test.c Mon Nov 25 16:11:42 2013
@@ -937,6 +937,8 @@ pack_shard_size_one(const svn_test_opts_
 
 /* The test table.  */
 
+int svn_test_max_threads = 4;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_fs_x/string-table-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_fs_x/string-table-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_fs_x/string-table-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_fs_x/string-table-test.c Mon Nov 25 16:11:42 2013
@@ -288,6 +288,8 @@ store_load_many_strings_table(apr_pool_t
 
 /* The test table.  */
 
+int svn_test_max_threads = 4;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_ra/ra-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_ra/ra-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_ra/ra-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_ra/ra-test.c Mon Nov 25 16:11:42 2013
@@ -326,6 +326,9 @@ tunel_callback_test(const svn_test_opts_
 
 
 /* The test table.  */
+
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_ra_local/ra-local-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_ra_local/ra-local-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_ra_local/ra-local-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_ra_local/ra-local-test.c Mon Nov 25 16:11:42 2013
@@ -279,6 +279,8 @@ split_url_test(const svn_test_opts_t *op
 #define HAS_UNC_HOST 0
 #endif
 
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_repos/repos-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_repos/repos-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_repos/repos-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_repos/repos-test.c Mon Nov 25 16:11:42 2013
@@ -3545,6 +3545,8 @@ test_repos_fs_type(const svn_test_opts_t
 
 /* The test table.  */
 
+int svn_test_max_threads = 4;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_subr/auth-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/auth-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/auth-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/auth-test.c Mon Nov 25 16:11:42 2013
@@ -315,6 +315,8 @@ test_auth_clear(apr_pool_t *pool)
 
 /* The test table.  */
 
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_subr/cache-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/cache-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/cache-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/cache-test.c Mon Nov 25 16:11:42 2013
@@ -259,6 +259,8 @@ test_memcache_long_key(const svn_test_op
 
 /* The test table.  */
 
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_subr/checksum-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/checksum-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/checksum-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/checksum-test.c Mon Nov 25 16:11:42 2013
@@ -240,6 +240,9 @@ zlib_expansion_test(const svn_test_opts_
 }
 
 /* An array of all test functions */
+
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_subr/compat-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/compat-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/compat-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/compat-test.c Mon Nov 25 16:11:42 2013
@@ -209,6 +209,9 @@ test_version_at_least(apr_pool_t *pool)
 }
 
 /* An array of all test functions */
+
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_subr/config-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/config-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/config-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/config-test.c Mon Nov 25 16:11:42 2013
@@ -343,6 +343,9 @@ test_read_only_mode(const svn_test_opts_
 */
 
 /* An array of all test functions */
+
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_subr/crypto-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/crypto-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/crypto-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/crypto-test.c Mon Nov 25 16:11:42 2013
@@ -177,6 +177,8 @@ test_passphrase_check(apr_pool_t *pool)
 
 /* The test table.  */
 
+int svn_test_max_threads = -1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_subr/dirent_uri-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/dirent_uri-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/dirent_uri-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/dirent_uri-test.c Mon Nov 25 16:11:42 2013
@@ -2717,6 +2717,8 @@ test_fspath_get_longest_ancestor(apr_poo
 
 /* The test table.  */
 
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_subr/error-code-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/error-code-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/error-code-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/error-code-test.c Mon Nov 25 16:11:42 2013
@@ -74,6 +74,8 @@ check_error_codes_unique(apr_pool_t *poo
 
 /* The test table.  */
 
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_subr/error-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/error-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/error-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/error-test.c Mon Nov 25 16:11:42 2013
@@ -229,6 +229,8 @@ test_error_symbolic_name(apr_pool_t *poo
 
 /* The test table.  */
 
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_subr/hashdump-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/hashdump-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/hashdump-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/hashdump-test.c Mon Nov 25 16:11:42 2013
@@ -178,6 +178,9 @@ test3(apr_pool_t *pool)
 */
 
 /* An array of all test functions */
+
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_subr/io-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/io-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/io-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/io-test.c Mon Nov 25 16:11:42 2013
@@ -666,6 +666,8 @@ aligned_seek_test(apr_pool_t *pool)
 
 /* The test table.  */
 
+int svn_test_max_threads = 3;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_subr/mergeinfo-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/mergeinfo-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/mergeinfo-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/mergeinfo-test.c Mon Nov 25 16:11:42 2013
@@ -1673,6 +1673,8 @@ test_remove_prefix_from_catalog(apr_pool
 
 /* The test table.  */
 
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_subr/named_atomic-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/named_atomic-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/named_atomic-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/named_atomic-test.c Mon Nov 25 16:11:42 2013
@@ -742,6 +742,9 @@ test_multiprocess(apr_pool_t *pool)
 */
 
 /* An array of all test functions */
+
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_subr/opt-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/opt-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/opt-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/opt-test.c Mon Nov 25 16:11:42 2013
@@ -193,6 +193,8 @@ test_svn_opt_args_to_target_array2(apr_p
 
 /* The test table.  */
 
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_subr/packed-data-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/packed-data-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/packed-data-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/packed-data-test.c Mon Nov 25 16:11:42 2013
@@ -548,6 +548,9 @@ test_full_structure(apr_pool_t *pool)
 }
 
 /* An array of all test functions */
+
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_subr/path-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/path-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/path-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/path-test.c Mon Nov 25 16:11:42 2013
@@ -1700,6 +1700,8 @@ test_path_resolve_repos_relative_url(apr
 
 /* The test table.  */
 
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_subr/prefix-string-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/prefix-string-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/prefix-string-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/prefix-string-test.c Mon Nov 25 16:11:42 2013
@@ -136,6 +136,9 @@ test_string_comparison(apr_pool_t *pool)
 }
 
 /* An array of all test functions */
+
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_subr/priority-queue-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/priority-queue-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/priority-queue-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/priority-queue-test.c Mon Nov 25 16:11:42 2013
@@ -220,6 +220,9 @@ test_update(apr_pool_t *pool)
 }
 
 /* An array of all test functions */
+
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_subr/revision-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/revision-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/revision-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/revision-test.c Mon Nov 25 16:11:42 2013
@@ -123,6 +123,8 @@ test_revnum_parse(apr_pool_t *pool)
 
 /* The test table.  */
 
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_subr/root-pools-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/root-pools-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/root-pools-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/root-pools-test.c Mon Nov 25 16:11:42 2013
@@ -121,6 +121,8 @@ test_root_pool_concurrency(apr_pool_t *p
 
 /* The test table.  */
 
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_subr/skel-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/skel-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/skel-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/skel-test.c Mon Nov 25 16:11:42 2013
@@ -886,6 +886,8 @@ unparse_list(apr_pool_t *pool)
 
 /* The test table.  */
 
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_subr/spillbuf-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/spillbuf-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/spillbuf-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/spillbuf-test.c Mon Nov 25 16:11:42 2013
@@ -560,6 +560,9 @@ test_spillbuf_file_attrs_spill_all(apr_p
 }
 
 /* The test table.  */
+
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_subr/sqlite-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/sqlite-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/sqlite-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/sqlite-test.c Mon Nov 25 16:11:42 2013
@@ -112,6 +112,8 @@ test_sqlite_reset(apr_pool_t *pool)
 }
 
 
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_subr/stream-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/stream-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/stream-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/stream-test.c Mon Nov 25 16:11:42 2013
@@ -773,6 +773,8 @@ test_stringbuf_from_stream(apr_pool_t *p
 
 /* The test table.  */
 
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_subr/string-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/string-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/string-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/string-test.c Mon Nov 25 16:11:42 2013
@@ -833,6 +833,9 @@ test_string_matching(apr_pool_t *pool)
 */
 
 /* An array of all test functions */
+
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_subr/subst_translate-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/subst_translate-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/subst_translate-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/subst_translate-test.c Mon Nov 25 16:11:42 2013
@@ -501,6 +501,8 @@ test_svn_subst_long_keywords(apr_pool_t 
   return SVN_NO_ERROR;
 }
 
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_subr/time-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/time-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/time-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/time-test.c Mon Nov 25 16:11:42 2013
@@ -339,6 +339,8 @@ test_parse_date(apr_pool_t *pool)
 
 /* The test table.  */
 
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_subr/translate-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/translate-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/translate-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/translate-test.c Mon Nov 25 16:11:42 2013
@@ -1268,6 +1268,8 @@ mixed_to_crlf_unexpand_author_date_rev_u
 
 /* The test table.  */
 
+int svn_test_max_threads = 7;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_subr/utf-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/utf-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/utf-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/utf-test.c Mon Nov 25 16:11:42 2013
@@ -740,6 +740,8 @@ test_utf_is_normalized(apr_pool_t *pool)
 
 /* The test table.  */
 
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_wc/conflict-data-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/conflict-data-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/conflict-data-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/conflict-data-test.c Mon Nov 25 16:11:42 2013
@@ -810,6 +810,8 @@ test_prop_conflicts(const svn_test_opts_
 
 /* The test table.  */
 
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_wc/db-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/db-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/db-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/db-test.c Mon Nov 25 16:11:42 2013
@@ -1521,6 +1521,8 @@ test_externals_store(apr_pool_t *pool)
   return SVN_NO_ERROR;
 }
 
+int svn_test_max_threads = 2;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_wc/entries-compat.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/entries-compat.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/entries-compat.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/entries-compat.c Mon Nov 25 16:11:42 2013
@@ -638,6 +638,8 @@ test_access_baton_like_locking(apr_pool_
 }
 
 
+int svn_test_max_threads = -1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c Mon Nov 25 16:11:42 2013
@@ -9455,6 +9455,8 @@ movedhere_extract_retract(const svn_test
 /* ---------------------------------------------------------------------- */
 /* The list of test functions */
 
+int svn_test_max_threads = 2;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_wc/pristine-store-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/pristine-store-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/pristine-store-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/pristine-store-test.c Mon Nov 25 16:11:42 2013
@@ -319,6 +319,8 @@ reject_mismatching_text(const svn_test_o
 }
 
 
+int svn_test_max_threads = -1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_wc/wc-queries-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/wc-queries-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/wc-queries-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/wc-queries-test.c Mon Nov 25 16:11:42 2013
@@ -976,6 +976,8 @@ test_schema_statistics(apr_pool_t *scrat
   return SVN_NO_ERROR;
 }
 
+int svn_test_max_threads = 1;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/libsvn_wc/wc-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/wc-test.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/wc-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/wc-test.c Mon Nov 25 16:11:42 2013
@@ -309,6 +309,8 @@ test_externals_parse_erratic(apr_pool_t 
 /* ---------------------------------------------------------------------- */
 /* The list of test functions */
 
+int svn_test_max_threads = 2;
+
 struct svn_test_descriptor_t test_funcs[] =
   {
     SVN_TEST_NULL,

Modified: subversion/trunk/subversion/tests/svn_test.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/svn_test.h?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/svn_test.h (original)
+++ subversion/trunk/subversion/tests/svn_test.h Mon Nov 25 16:11:42 2013
@@ -189,6 +189,9 @@ extern struct svn_test_descriptor_t test
 #define SVN_TEST_OPTS_WIMP_COND(func, p, msg, wip) \
   {(p) ? svn_test_xfail : svn_test_pass, NULL, func, msg, wip}
 
+/* Maximum number of concurrent test threads.  Set to 1 if all tests must
+   be executed serially.  Numbers less than 1 mean "unbounded" */
+extern int svn_test_max_threads;
 
 
 /* Return a pseudo-random number based on SEED, and modify SEED.

Modified: subversion/trunk/subversion/tests/svn_test_main.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/svn_test_main.c?rev=1545334&r1=1545333&r2=1545334&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/svn_test_main.c (original)
+++ subversion/trunk/subversion/tests/svn_test_main.c Mon Nov 25 16:11:42 2013
@@ -47,9 +47,18 @@
 #include "svn_utf.h"
 
 #include "private/svn_cmdline_private.h"
+#include "private/svn_atomic.h"
+#include "private/svn_mutex.h"
 
 #include "svn_private_config.h"
 
+#if APR_HAS_THREADS && APR_VERSION_AT_LEAST(1,3,0)
+#  include <apr_thread_pool.h>
+#  define HAVE_THREADPOOLS 1
+#else
+#  define HAVE_THREADPOOLS 0
+#endif
+
 /* Some Subversion test programs may want to parse options in the
    argument list, so we remember it here. */
 int test_argc;
@@ -76,6 +85,9 @@ static svn_boolean_t allow_segfaults = F
    Pass, All). */
 enum svn_test_mode_t mode_filter = svn_test_all;
 
+/* Test option: Allow concurrent execution of tests */
+static svn_boolean_t parallel = FALSE;
+
 /* Option parsing enums and structures */
 enum {
   help_opt = SVN_OPT_FIRST_LONGOPT_ID,
@@ -88,7 +100,8 @@ enum {
   server_minor_version_opt,
   allow_segfault_opt,
   srcdir_opt,
-  mode_filter_opt
+  mode_filter_opt,
+  parallel_opt
 };
 
 static const apr_getopt_option_t cl_options[] =
@@ -117,6 +130,8 @@ static const apr_getopt_option_t cl_opti
                     N_("don't trap seg faults (useful for debugging)")},
   {"srcdir",        srcdir_opt, 1,
                     N_("source directory")},
+  {"parallel",      parallel_opt, 0,
+                    N_("allow concurrent execution of tests")},
   {0,               0, 0, 0}
 };
 
@@ -130,6 +145,9 @@ static svn_boolean_t skip_cleanup = FALS
 /* All cleanup actions are registered as cleanups on this pool. */
 static apr_pool_t *cleanup_pool = NULL;
 
+/* Used by test_thread to serialize access to stdout. */
+static svn_mutex__t *log_mutex = NULL;
+
 static apr_status_t
 cleanup_rmtree(void *data)
 {
@@ -160,13 +178,34 @@ svn_test_add_dir_cleanup(const char *pat
   if (cleanup_mode)
     {
       const char *abspath;
-      svn_error_t *err = svn_path_get_absolute(&abspath, path, cleanup_pool);
+      svn_error_t *err;
+
+      /* All cleanup functions use the *same* pool (not subpools of it).
+         Thus, we need to synchronize. */
+      err = svn_mutex__lock(log_mutex);
+      if (err)
+        {
+          if (verbose_mode) 
+            printf("FAILED svn_mutex__lock in svn_test_add_dir_cleanup.\n");
+          svn_error_clear(err);
+          return;
+        }
+
+      err = svn_path_get_absolute(&abspath, path, cleanup_pool);
       svn_error_clear(err);
       if (!err)
         apr_pool_cleanup_register(cleanup_pool, abspath, cleanup_rmtree,
                                   apr_pool_cleanup_null);
       else if (verbose_mode)
         printf("FAILED ABSPATH: %s\n", path);
+
+      err = svn_mutex__unlock(log_mutex, NULL);
+      if (err)
+        {
+          if (verbose_mode) 
+            printf("FAILED svn_mutex__unlock in svn_test_add_dir_cleanup.\n");
+          svn_error_clear(err);
+        }
     }
 }
 
@@ -209,6 +248,86 @@ crash_handler(int signum)
   longjmp(jump_buffer, 1);
 }
 
+/* Write the result of test number TEST_NUM to stdout.  Pretty-print test
+   name and dots according to our test-suite spec, and return TRUE if there
+   has been a test failure.
+
+   The parameters are basically the internal state of do_test_num() and
+   test_thread(). */
+/*  */
+static svn_boolean_t
+log_results(const char *progname,
+            int test_num,
+            svn_boolean_t msg_only,
+            svn_boolean_t run_this_test,
+            svn_boolean_t skip,
+            svn_boolean_t xfail,
+            svn_boolean_t wimp,
+            svn_error_t *err,
+            const char *msg,
+            const struct svn_test_descriptor_t *desc)
+{
+  svn_boolean_t test_failed;
+
+  if (err && err->apr_err == SVN_ERR_TEST_SKIPPED)
+    {
+      svn_error_clear(err);
+      err = SVN_NO_ERROR;
+      skip = TRUE;
+    }
+
+  /* Failure means unexpected results -- FAIL or XPASS. */
+  test_failed = (!wimp && ((err != SVN_NO_ERROR) != (xfail != 0)));
+
+  /* If we got an error, print it out.  */
+  if (err)
+    {
+      svn_handle_error2(err, stdout, FALSE, "svn_tests: ");
+      svn_error_clear(err);
+    }
+
+  if (msg_only)
+    {
+      if (run_this_test)
+        printf(" %3d    %-5s  %s%s%s%s\n",
+               test_num,
+               (xfail ? "XFAIL" : (skip ? "SKIP" : "")),
+               msg ? msg : "(test did not provide name)",
+               (wimp && verbose_mode) ? " [[" : "",
+               (wimp && verbose_mode) ? desc->wip : "",
+               (wimp && verbose_mode) ? "]]" : "");
+    }
+  else if (run_this_test && ((! quiet_mode) || test_failed))
+    {
+      printf("%s %s %d: %s%s%s%s\n",
+             (err
+              ? (xfail ? "XFAIL:" : "FAIL: ")
+              : (xfail ? "XPASS:" : (skip ? "SKIP: " : "PASS: "))),
+             progname,
+             test_num,
+             msg ? msg : "(test did not provide name)",
+             wimp ? " [[WIMP: " : "",
+             wimp ? desc->wip : "",
+             wimp ? "]]" : "");
+    }
+
+  if (msg)
+    {
+      size_t len = strlen(msg);
+      if (len > 50)
+        printf("WARNING: Test docstring exceeds 50 characters\n");
+      if (msg[len - 1] == '.')
+        printf("WARNING: Test docstring ends in a period (.)\n");
+      if (svn_ctype_isupper(msg[0]))
+        printf("WARNING: Test docstring is capitalized\n");
+    }
+  if (desc->msg == NULL)
+    printf("WARNING: New-style test descriptor is missing a docstring.\n");
+
+  fflush(stdout);
+
+  return test_failed;
+}
 
 /* Execute a test number TEST_NUM.  Pretty-print test name and dots
    according to our test-suite spec, and return the result code.
@@ -224,7 +343,6 @@ do_test_num(const char *progname,
 {
   svn_boolean_t skip, xfail, wimp;
   svn_error_t *err = NULL;
-  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();
@@ -296,60 +414,130 @@ do_test_num(const char *progname,
     }
 
   /* Failure means unexpected results -- FAIL or XPASS. */
-  test_failed = (!wimp && ((err != SVN_NO_ERROR) != (xfail != 0)));
+  skip_cleanup = log_results(progname, test_num, msg_only, run_this_test,
+                             skip, xfail, wimp, err, msg, desc);
 
-  /* If we got an error, print it out.  */
-  if (err)
-    {
-      svn_handle_error2(err, stdout, FALSE, "svn_tests: ");
-      svn_error_clear(err);
-    }
+  return skip_cleanup;
+}
 
-  if (msg_only)
+#if HAVE_THREADPOOLS
+
+/* Per-test parameters used by test_thread */
+typedef struct test_params_t
+{
+  /* Name of the application */
+  const char *progname;
+
+  /* Number / index of the test to execute */
+  int test_num;
+
+  /* Global test options as provided by main() */
+  svn_test_opts_t *opts;
+
+  /* Thread-safe parent pool for the test-specific pool.  We expect the
+     test thread to create a sub-pool and destroy it after test completion. */
+  apr_pool_t *pool;
+
+  /* Reference to the global failure flag.  Set this if any test failed. */
+  svn_atomic_t *got_error;
+} test_params_t;
+
+/* Thread function similar to do_test_num() but with fewer options.  We do
+   catch segfaults.  All parameters are given as a test_params_t in DATA.
+ */
+static void * APR_THREAD_FUNC
+test_thread(apr_thread_t *tid, void *data)
+{
+  svn_boolean_t skip, xfail, wimp;
+  svn_error_t *err = NULL;
+  const struct svn_test_descriptor_t *desc;
+  svn_boolean_t run_this_test; /* This test's mode matches DESC->MODE. */
+  test_params_t *params = data;
+
+  apr_pool_t *test_pool = svn_pool_create(params->pool);
+
+  desc = &test_funcs[params->test_num];
+  skip = desc->mode == svn_test_skip;
+  xfail = desc->mode == svn_test_xfail;
+  wimp = xfail && desc->wip;
+  run_this_test = mode_filter == svn_test_all || mode_filter == desc->mode;
+
+  /* Do test */
+  if (skip || !run_this_test)
+    ; /* pass */
+  else if (desc->func2)
+    err = (*desc->func2)(test_pool);
+  else
+    err = (*desc->func_opts)(params->opts, test_pool);
+
+  /* Write results to console */
+  svn_error_clear(svn_mutex__lock(log_mutex));
+  if (log_results(params->progname, params->test_num, FALSE, run_this_test,
+                  skip, xfail, wimp, err, desc->msg, desc))
+    svn_atomic_set(params->got_error, TRUE);
+  svn_error_clear(svn_mutex__unlock(log_mutex, NULL));
+
+  /* release all test memory */
+  svn_pool_destroy(test_pool);
+    
+  return NULL;
+}
+
+/* Execute all ARRAY_SIZE tests concurrently using MAX_THREADS threads.
+   Pass PROGNAME and OPTS to the individual tests.  Return TRUE if at least
+   one of the tests failed.  Allocate all data in POOL.
+
+   Note that cleanups are delayed until all tests have been completed.
+ */
+static svn_boolean_t
+do_tests_concurrently(const char *progname,
+                      int array_size,
+                      int max_threads,
+                      svn_test_opts_t *opts,
+                      apr_pool_t *pool)
+{
+  apr_thread_pool_t *threads;
+  apr_status_t status;
+  svn_atomic_t got_error = FALSE;
+  int i;
+
+  /* Create the thread pool. */
+  status = apr_thread_pool_create(&threads, max_threads, max_threads, pool);
+  if (status)
     {
-      if (run_this_test)
-        printf(" %3d    %-5s  %s%s%s%s\n",
-               test_num,
-               (xfail ? "XFAIL" : (skip ? "SKIP" : "")),
-               msg ? msg : "(test did not provide name)",
-               (wimp && verbose_mode) ? " [[" : "",
-               (wimp && verbose_mode) ? desc->wip : "",
-               (wimp && verbose_mode) ? "]]" : "");
-    }
-  else if (run_this_test && ((! quiet_mode) || test_failed))
-    {
-      printf("%s %s %d: %s%s%s%s\n",
-             (err
-              ? (xfail ? "XFAIL:" : "FAIL: ")
-              : (xfail ? "XPASS:" : (skip ? "SKIP: " : "PASS: "))),
-             progname,
-             test_num,
-             msg ? msg : "(test did not provide name)",
-             wimp ? " [[WIMP: " : "",
-             wimp ? desc->wip : "",
-             wimp ? "]]" : "");
+      printf("apr_thread_pool_create() failed.\n");
+      return TRUE;
     }
 
-  if (msg)
+  /* Don't queue requests unless we reached the worker thread limit. */
+  apr_thread_pool_threshold_set(threads, 0);
+
+  /* Generate one task per test and queue them in the thread pool. */
+  for (i = 1; i <= array_size; i++)
     {
-      size_t len = strlen(msg);
-      if (len > 50)
-        printf("WARNING: Test docstring exceeds 50 characters\n");
-      if (msg[len - 1] == '.')
-        printf("WARNING: Test docstring ends in a period (.)\n");
-      if (svn_ctype_isupper(msg[0]))
-        printf("WARNING: Test docstring is capitalized\n");
+      test_params_t *params = apr_pcalloc(pool, sizeof(*params));
+      params->got_error = &got_error;
+      params->opts = opts;
+      params->pool = pool;
+      params->progname = progname;
+      params->test_num = i;
+
+      apr_thread_pool_push(threads, test_thread, params, 0, NULL);
     }
-  if (desc->msg == NULL)
-    printf("WARNING: New-style test descriptor is missing a docstring.\n");
 
-  fflush(stdout);
+  /* Wait for all tasks (tests) to complete.  As it turns out, this is the
+     variant with the least run-time overhead to the test threads. */
+  while (   apr_thread_pool_tasks_count(threads)
+         || apr_thread_pool_busy_count(threads))
+    apr_thread_yield();
 
-  skip_cleanup = test_failed;
+  /* Execute all cleanups. */
+  svn_pool_clear(cleanup_pool);
 
-  return test_failed;
+  return got_error != FALSE;
 }
 
+#endif
 
 static void help(const char *progname, apr_pool_t *pool)
 {
@@ -449,6 +637,12 @@ main(int argc, const char *argv[])
    * usage but make it thread-safe to allow for multi-threaded tests.
    */
   pool = apr_allocator_owner_get(svn_pool_create_allocator(TRUE));
+  err = svn_mutex__init(&log_mutex, TRUE, pool);
+  if (err)
+    {
+      svn_handle_error2(err, stderr, TRUE, "svn_tests: ");
+      svn_error_clear(err);
+    }
 
   /* Remember the command line */
   test_argc = argc;
@@ -585,7 +779,13 @@ main(int argc, const char *argv[])
                 fprintf(stderr, "FAIL: Invalid minor version given\n");
                 exit(1);
               }
+            break;
           }
+#if HAVE_THREADPOOLS
+        case parallel_opt:
+          parallel = TRUE;
+          break;
+#endif
       }
     }
 
@@ -656,15 +856,29 @@ main(int argc, const char *argv[])
   if (! ran_a_test)
     {
       /* just run all tests */
-      for (i = 1; i <= array_size; i++)
+      if (svn_test_max_threads < 1)
+        svn_test_max_threads = array_size;
+
+      if (svn_test_max_threads == 1 || !parallel)
         {
-          if (do_test_num(prog_name, i, FALSE, &opts, NULL, test_pool))
-            got_error = TRUE;
+          for (i = 1; i <= array_size; i++)
+            {
+              if (do_test_num(prog_name, i, FALSE, &opts, NULL, test_pool))
+                got_error = TRUE;
 
-          /* Clear the per-function pool */
-          svn_pool_clear(test_pool);
-          svn_pool_clear(cleanup_pool);
+              /* Clear the per-function pool */
+              svn_pool_clear(test_pool);
+              svn_pool_clear(cleanup_pool);
+            }
         }
+#if HAVE_THREADPOOLS
+      else
+        {
+          got_error = do_tests_concurrently(prog_name, array_size,
+                                            svn_test_max_threads,
+                                            &opts, pool);
+        }
+#endif
     }
 
   /* Clean up APR */



Mime
View raw message