You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2013/11/27 12:52:46 UTC
svn commit: r1546002 [37/39] - in /subversion/branches/verify-keep-going: ./
build/ build/ac-macros/ build/generator/ build/generator/swig/
build/generator/templates/ build/win32/ contrib/client-side/emacs/
contrib/server-side/ contrib/server-side/svnc...
Modified: subversion/branches/verify-keep-going/subversion/tests/svn_test_main.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/tests/svn_test_main.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/tests/svn_test_main.c (original)
+++ subversion/branches/verify-keep-going/subversion/tests/svn_test_main.c Wed Nov 27 11:52:35 2013
@@ -44,16 +44,30 @@
#include "svn_io.h"
#include "svn_path.h"
#include "svn_ctype.h"
+#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;
const char **test_argv;
+/* Many tests write to disk. Instead of writing to the current
+ directory, they should use this path as the root of the test data
+ area. */
+static const char *data_path;
/* Test option: Print more output */
static svn_boolean_t verbose_mode = FALSE;
@@ -71,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,
@@ -83,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[] =
@@ -112,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}
};
@@ -125,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)
{
@@ -155,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);
+ }
}
}
@@ -204,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.
@@ -219,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();
@@ -291,60 +414,147 @@ 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 (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))
+#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;
+
+ /* Reference to the global completed test counter. */
+ svn_atomic_t *run_count;
+} 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);
+
+ /* one more test completed */
+ svn_atomic_inc(params->run_count);
+
+ 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;
+ svn_atomic_t run_count = 0;
+
+ /* Create the thread pool. */
+ status = apr_thread_pool_create(&threads, max_threads, max_threads, pool);
+ if (status)
{
- 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;
+ params->run_count = &run_count;
+
+ 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();
+
+ /* For some unknown reason, cleaning POOL (TEST_POOL in main()) does not
+ call the following reliably for all users. */
+ apr_thread_pool_destroy(threads);
- skip_cleanup = test_failed;
+ /* Verify that we didn't skip any tasks. */
+ if (run_count != array_size)
+ {
+ printf("Parallel test failure: only %d of %d tests executed.\n",
+ (int)run_count, array_size);
+ return TRUE;
+ }
- return test_failed;
+ return got_error != FALSE;
}
+#endif
static void help(const char *progname, apr_pool_t *pool)
{
@@ -365,6 +575,51 @@ static void help(const char *progname, a
svn_error_clear(svn_cmdline_fprintf(stdout, pool, "\n"));
}
+static svn_error_t *init_test_data(const char *argv0, apr_pool_t *pool)
+{
+ const char *temp_path;
+ const char *base_name;
+
+ /* Convert the program path to an absolute path. */
+ SVN_ERR(svn_utf_cstring_to_utf8(&temp_path, argv0, pool));
+ temp_path = svn_dirent_internal_style(temp_path, pool);
+ SVN_ERR(svn_dirent_get_absolute(&temp_path, temp_path, pool));
+ SVN_ERR_ASSERT(!svn_dirent_is_root(temp_path, strlen(temp_path)));
+
+ /* Extract the interesting bits of the path. */
+ temp_path = svn_dirent_dirname(temp_path, pool);
+ base_name = svn_dirent_basename(temp_path, pool);
+ if (0 == strcmp(base_name, ".libs"))
+ {
+ /* This is a libtoolized binary, skip the .libs directory. */
+ temp_path = svn_dirent_dirname(temp_path, pool);
+ base_name = svn_dirent_basename(temp_path, pool);
+ }
+ temp_path = svn_dirent_dirname(temp_path, pool);
+
+ /* temp_path should now point to the root of the test
+ builddir. Construct the path to the transient dir. Note that we
+ put the path insinde the cmdline/svn-test-work area. This is
+ because trying to get the cmdline tests to use a different work
+ area is unprintable; so we put the C test transient dir in the
+ cmdline tests area, as the lesser of evils ... */
+ temp_path = svn_dirent_join_many(pool, temp_path,
+ "cmdline", "svn-test-work",
+ base_name, SVN_VA_NULL);
+
+ /* Finally, create the transient directory. */
+ SVN_ERR(svn_io_make_dir_recursively(temp_path, pool));
+
+ data_path = temp_path;
+ return SVN_NO_ERROR;
+}
+
+const char *
+svn_test_data_path(const char *base_name, apr_pool_t *result_pool)
+{
+ return svn_dirent_join(data_path, base_name, result_pool);
+}
+
/* Standard svn test program */
int
@@ -399,12 +654,31 @@ 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;
test_argv = argv;
+ err = init_test_data(argv[0], pool);
+ if (err)
+ {
+ svn_handle_error2(err, stderr, TRUE, "svn_tests: ");
+ svn_error_clear(err);
+ }
+
err = svn_cmdline__getopt_init(&os, argc, argv, pool);
+ if (err)
+ {
+ svn_handle_error2(err, stderr, TRUE, "svn_tests: ");
+ svn_error_clear(err);
+ }
+
os->interleave = TRUE; /* Let options and arguments be interleaved */
@@ -475,6 +749,10 @@ main(int argc, const char *argv[])
case fstype_opt:
opts.fs_type = apr_pstrdup(pool, opt_arg);
break;
+ case srcdir_opt:
+ SVN_INT_ERR(svn_utf_cstring_to_utf8(&opts.srcdir, opt_arg, pool));
+ opts.srcdir = svn_dirent_internal_style(opts.srcdir, pool);
+ break;
case list_opt:
list_mode = TRUE;
break;
@@ -518,7 +796,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
}
}
@@ -589,15 +873,33 @@ 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 */
+ /* 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, test_pool);
+
+ /* Execute all cleanups */
svn_pool_clear(test_pool);
svn_pool_clear(cleanup_pool);
}
+#endif
}
/* Clean up APR */
Modified: subversion/branches/verify-keep-going/tools/buildbot/slaves/win32-SharpSvn/svn-config.cmd.template
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/tools/buildbot/slaves/win32-SharpSvn/svn-config.cmd.template?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/tools/buildbot/slaves/win32-SharpSvn/svn-config.cmd.template (original)
+++ subversion/branches/verify-keep-going/tools/buildbot/slaves/win32-SharpSvn/svn-config.cmd.template Wed Nov 27 11:52:35 2013
@@ -29,3 +29,22 @@ SET TMP=%TEMP%
IF NOT EXIST "%TESTDIR%\" MKDIR "%TESTDIR%"
IF NOT EXIST "%TEMP%\" MKDIR "%TEMP%"
+
+
+
+
+
+SET SVN_URL=
+SET SVN_RELURL=
+for /F "usebackq tokens=1,* delims=:" %%i IN (`svn info .`) do (
+
+ IF "%%i" == "URL" (
+ SET SVN_URL=%%j
+ ) ELSE IF "%%i" == "Relative URL" (
+ SET SVN_RELURL=%%j
+ )
+)
+SET SVN_URL=%SVN_URL:~1%
+SET SVN_RELURL=%SVN_RELURL:~3%
+SET SVN_SUBBRANCH=%SVN_RELURL:~11%
+SET SVN_BRANCH=%SVN_SUBBRANCH:branches/=%
Modified: subversion/branches/verify-keep-going/tools/buildbot/slaves/win32-SharpSvn/svntest-bindings.cmd
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/tools/buildbot/slaves/win32-SharpSvn/svntest-bindings.cmd?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/tools/buildbot/slaves/win32-SharpSvn/svntest-bindings.cmd (original)
+++ subversion/branches/verify-keep-going/tools/buildbot/slaves/win32-SharpSvn/svntest-bindings.cmd Wed Nov 27 11:52:35 2013
@@ -23,63 +23,99 @@ SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDE
CALL ..\svn-config.cmd
IF ERRORLEVEL 1 EXIT /B 1
-svnversion . /1.6.x | find "S" > nul:
-IF ERRORLEVEL 1 (
- ECHO --- Building 1.6.x: Skipping bindings ---
- EXIT /B 0
+IF "%SVN_BRANCH%" LEQ "1.6.x" (
+ ECHO --- Building 1.6.x or older: Skipping bindings ---
+ EXIT /B 0
)
-PATH %PATH%;%TESTDIR%\bin
-SET result=0
+IF "%SVN_BRANCH%" LSS "1.9." (
+ IF NOT EXIST "%TESTDIR%\bin" MKDIR "%TESTDIR%\bin"
+ xcopy /y /i ..\deps\release\bin\*.dll "%TESTDIR%\bin"
-python win-tests.py -d -f fsfs --javahl "%TESTDIR%\tests"
-IF ERRORLEVEL 1 (
- echo [python reported error %ERRORLEVEL%]
- SET result=1
+ PATH %TESTDIR%\bin;!PATH!
)
-IF EXIST "%TESTDIR%\swig" rmdir /s /q "%TESTDIR%\swig"
-mkdir "%TESTDIR%\swig\py-release\libsvn"
-mkdir "%TESTDIR%\swig\py-release\svn"
-
-xcopy "release\subversion\bindings\swig\python\*.pyd" "%TESTDIR%\swig\py-release\libsvn\*.pyd" > nul:
-xcopy "release\subversion\bindings\swig\python\libsvn_swig_py\*.dll" "%TESTDIR%\swig\py-release\libsvn\*.dll" > nul:
-xcopy "subversion\bindings\swig\python\*.py" "%TESTDIR%\swig\py-release\libsvn\*.py" > nul:
-xcopy "subversion\bindings\swig\python\svn\*.py" "%TESTDIR%\swig\py-release\svn\*.py" > nul:
-
-SET PYTHONPATH=%TESTDIR%\swig\py-release
-
-python subversion\bindings\swig\python\tests\run_all.py
-IF ERRORLEVEL 1 (
- echo [Python reported error %ERRORLEVEL%]
- SET result=1
-)
+SET result=0
-mkdir "%TESTDIR%\swig\pl-release\SVN"
-mkdir "%TESTDIR%\swig\pl-release\auto\SVN"
-xcopy subversion\bindings\swig\perl\native\*.pm "%TESTDIR%\swig\pl-release\SVN" > nul:
-pushd release\subversion\bindings\swig\perl\native
-for %%i in (*.dll) do (
- set name=%%i
- mkdir "%TESTDIR%\swig\pl-release\auto\SVN\!name:~0,-4!"
- xcopy "!name:~0,-4!.*" "%TESTDIR%\swig\pl-release\auto\SVN\!name:~0,-4!" > nul:
- xcopy /y "_Core.dll" "%TESTDIR%\swig\pl-release\auto\SVN\!name:~0,-4!" > nul:
-)
-popd
+if "%SVN_BRANCH%" GTR "1.9." (
-svnversion . /1.7.x | find "S" > nul:
-IF ERRORLEVEL 1 (
- ECHO --- Building 1.7.x: Skipping perl tests ---
- EXIT /B %result%
-)
+ python win-tests.py -r -f fsfs --swig=python "%TESTDIR%\tests"
+
+ IF ERRORLEVEL 1 (
+ echo [Python tests reported error !ERRORLEVEL!] 1>&2
+ SET result=1
+ ) ELSE (
+ echo Done.
+ )
+
+) ELSE (
+ IF EXIST "%TESTDIR%\swig" rmdir /s /q "%TESTDIR%\swig"
+ mkdir "%TESTDIR%\swig\py-release\libsvn"
+ mkdir "%TESTDIR%\swig\py-release\svn"
+
+ xcopy "release\subversion\bindings\swig\python\*.pyd" "%TESTDIR%\swig\py-release\libsvn\*.pyd" > nul:
+ xcopy "release\subversion\bindings\swig\python\libsvn_swig_py\*.dll" "%TESTDIR%\swig\py-release\libsvn\*.dll" > nul:
+ xcopy "subversion\bindings\swig\python\*.py" "%TESTDIR%\swig\py-release\libsvn\*.py" > nul:
+ xcopy "subversion\bindings\swig\python\svn\*.py" "%TESTDIR%\swig\py-release\svn\*.py" > nul:
+
+ SET PYTHONPATH=%TESTDIR%\swig\py-release
+
+ python subversion\bindings\swig\python\tests\run_all.py
+ IF ERRORLEVEL 1 (
+ echo [Python tests reported error !ERRORLEVEL!] 1>&2
+ SET result=1
+ ) ELSE (
+ echo Done.
+ )
+)
+
+if "%SVN_BRANCH%" GTR "1.9." (
+
+ python win-tests.py -d -f fsfs --swig=perl "%TESTDIR%\tests"
+
+ IF ERRORLEVEL 1 (
+ echo [Perl tests reported error !ERRORLEVEL!] 1>&2
+ REM SET result=1
+ ) ELSE (
+ echo Done.
+ )
+
+) ELSE IF "%SVN_BRANCH%" GTR "1.8." (
+
+ mkdir "%TESTDIR%\swig\pl-debug\SVN"
+ mkdir "%TESTDIR%\swig\pl-debug\auto\SVN"
+ xcopy subversion\bindings\swig\perl\native\*.pm "%TESTDIR%\swig\pl-debug\SVN" > nul:
+ pushd debug\subversion\bindings\swig\perl\native
+ for %%i in (*.dll) do (
+ set name=%%i
+ mkdir "%TESTDIR%\swig\pl-debug\auto\SVN\!name:~0,-4!"
+ xcopy "!name:~0,-4!.*" "%TESTDIR%\swig\pl-debug\auto\SVN\!name:~0,-4!" > nul:
+ xcopy /y "_Core.dll" "%TESTDIR%\swig\pl-debug\auto\SVN\!name:~0,-4!" > nul:
+ )
+ popd
+
+
+ SET PERL5LIB=%PERL5LIB%;%TESTDIR%\swig\pl-debug;
+ pushd subversion\bindings\swig\perl\native
+ perl -MExtUtils::Command::MM -e "test_harness()" t\*.t
+ IF ERRORLEVEL 1 (
+ echo [Test runner reported error !ERRORLEVEL!]
+ SET result=1
+ )
+ popd
+)
+
+if "%SVN_BRANCH%" GTR "1.9." (
+ python win-tests.py -d -f fsfs --swig=ruby "%TESTDIR%\tests"
+
+ IF ERRORLEVEL 1 (
+ echo [Ruby tests reported error !ERRORLEVEL!] 1>&2
+ REM SET result=1
+ ) ELSE (
+ echo Done.
+ )
-SET PERL5LIB=%PERL5LIB%;%TESTDIR%\swig\pl-release;
-pushd subversion\bindings\swig\perl\native
-perl -MExtUtils::Command::MM -e test_harness() t\*.t
-IF ERRORLEVEL 1 (
- echo [Perl reported error %ERRORLEVEL%]
- SET result=1
+ taskkill /im svnserve.exe /f
)
-popd
exit /b %result%
Modified: subversion/branches/verify-keep-going/tools/buildbot/slaves/win32-SharpSvn/svntest-build-bindings.cmd
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/tools/buildbot/slaves/win32-SharpSvn/svntest-build-bindings.cmd?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/tools/buildbot/slaves/win32-SharpSvn/svntest-build-bindings.cmd (original)
+++ subversion/branches/verify-keep-going/tools/buildbot/slaves/win32-SharpSvn/svntest-build-bindings.cmd Wed Nov 27 11:52:35 2013
@@ -23,14 +23,26 @@ SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDE
CALL ..\svn-config.cmd
IF ERRORLEVEL 1 EXIT /B 1
-svnversion . /1.6.x | find "S" > nul:
-IF ERRORLEVEL 1 (
+IF "%SVN_BRANCH%" LEQ "1.6.x" (
ECHO --- Building 1.6.x: Skipping bindings ---
EXIT /B 0
)
-msbuild subversion_vcnet.sln /p:Configuration=Debug /p:Platform=win32 /t:__JAVAHL__ /t:__JAVAHL_TESTS__
+SET DEBUG_TARGETS=/t:__ALL_TESTS__
+SET RELEASE_TARGETS=/t:__SWIG_PYTHON__
+
+if "%SVN_BRANCH%" GTR "1.8." (
+ SET DEBUG_TARGETS=%DEBUG_TARGETS% /t:__SWIG_PERL__
+)
+
+if "%SVN_BRANCH%" GTR "1.9." (
+ SET DEBUG_TARGETS=%DEBUG_TARGETS% /t:__SWIG_RUBY__
+)
+
+msbuild subversion_vcnet.sln /m /v:m /p:Configuration=Debug /p:Platform=Win32 %DEBUG_TARGETS%
IF ERRORLEVEL 1 EXIT /B 1
-msbuild subversion_vcnet.sln /p:Configuration=Release /p:Platform=win32 /t:__SWIG_PYTHON__ /t:__SWIG_PERL__
+msbuild subversion_vcnet.sln /m /v:m /p:Configuration=Release /p:Platform=Win32 %RELEASE_TARGETS%
IF ERRORLEVEL 1 EXIT /B 1
+
+EXIT /B 0
Modified: subversion/branches/verify-keep-going/tools/buildbot/slaves/win32-SharpSvn/svntest-build.cmd
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/tools/buildbot/slaves/win32-SharpSvn/svntest-build.cmd?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/tools/buildbot/slaves/win32-SharpSvn/svntest-build.cmd (original)
+++ subversion/branches/verify-keep-going/tools/buildbot/slaves/win32-SharpSvn/svntest-build.cmd Wed Nov 27 11:52:35 2013
@@ -25,10 +25,12 @@ IF ERRORLEVEL 1 EXIT /B 1
PUSHD ..\deps
-nant gen-dev -D:wc=..\build -D:impBase=../deps/build/win32 -D:botBuild=true %NANTARGS%
+nant gen-dev -D:wc=..\build -D:impBase=../deps/build/win32 -D:botBuild=true %SVN_NANT_ARGS%
IF ERRORLEVEL 1 EXIT /B 1
POPD
-msbuild subversion_vcnet.sln /p:Configuration=Debug /p:Platform=win32 /t:__ALL_TESTS__
+msbuild subversion_vcnet.sln /m /v:m /p:Configuration=Debug /p:Platform=Win32 /t:__ALL_TESTS__ %SVN_MSBUILD_ARGS%
IF ERRORLEVEL 1 EXIT /B 1
+
+EXIT /B 0
Modified: subversion/branches/verify-keep-going/tools/buildbot/slaves/win32-SharpSvn/svntest-cleanup.cmd
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/tools/buildbot/slaves/win32-SharpSvn/svntest-cleanup.cmd?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/tools/buildbot/slaves/win32-SharpSvn/svntest-cleanup.cmd (original)
+++ subversion/branches/verify-keep-going/tools/buildbot/slaves/win32-SharpSvn/svntest-cleanup.cmd Wed Nov 27 11:52:35 2013
@@ -28,17 +28,17 @@ PUSHD ..\deps
ECHO Checking dependencies in %CD%
IF NOT EXIST "imports\" (
- svn co --username guest --password "" http://sharpsvn.open.collab.net/svn/sharpsvn/trunk/imports imports
+ svn co --username guest --password "" http://sharpsvn.open.collab.net/svn/sharpsvn/trunk/imports imports
)
IF NOT EXIST build\imports.done (
- svn up imports
- copy /y imports\dev-default.build default.build
- nant prep-dev %NANTARGS%
- IF ERRORLEVEL 1 (
- exit /B 1
- )
- del release\bin\*svn* release\bin\_*.* 2>nul:
- echo. > build\imports.done
+ svn up imports
+ copy /y imports\dev-default.build default.build
+ nant prep-dev %NANTARGS%
+ IF ERRORLEVEL 1 (
+ EXIT /B 1
+ )
+ del release\bin\*svn* release\bin\_*.* 2>nul:
+ ECHO. > build\imports.done
)
POPD
@@ -50,6 +50,7 @@ IF NOT ERRORLEVEL 1 (
POPD
+taskkill /im msbuild.exe /f 2> nul:
taskkill /im svn.exe /f 2> nul:
taskkill /im svnlook.exe /f 2> nul:
taskkill /im svnadmin.exe /f 2> nul:
@@ -57,20 +58,23 @@ taskkill /im svnserve.exe /f 2> nul:
taskkill /im svnrdump.exe /f 2> nul:
taskkill /im svnsync.exe /f 2> nul:
taskkill /im httpd.exe /f 2> nul:
+taskkill /im client-test.exe /f 2> nul:
taskkill /im fs-test.exe /f 2> nul:
taskkill /im op-depth-test.exe /f 2> nul:
taskkill /im atomic-ra-revprop-change.exe /f 2> nul:
taskkill /im java.exe /f 2> nul:
taskkill /im perl.exe /f 2> nul:
+taskkill /im ruby.exe /f 2> nul:
taskkill /im mspdbsrv.exe /f 2> nul:
-IF EXIST "%TESTDIR%\tests\subversion\tests\cmdline\httpd\" (
- rmdir /s /q "%TESTDIR%\tests\subversion\tests\cmdline\httpd"
-)
+
IF EXIST "%TESTDIR%\swig\" (
- rmdir /s /q "%TESTDIR%\swig"
+ rmdir /s /q "%TESTDIR%\swig"
)
-del "%TESTDIR%\tests\*.log" 2> nul:
-
+IF EXIST "%TESTDIR%\tests\" (
+ PUSHD "%TESTDIR%\tests\"
+ rmdir /s /q "%TESTDIR%\tests\" 2> nul:
+ POPD
+)
exit /B 0
Modified: subversion/branches/verify-keep-going/tools/buildbot/slaves/win32-SharpSvn/svntest-test.cmd
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/tools/buildbot/slaves/win32-SharpSvn/svntest-test.cmd?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/tools/buildbot/slaves/win32-SharpSvn/svntest-test.cmd (original)
+++ subversion/branches/verify-keep-going/tools/buildbot/slaves/win32-SharpSvn/svntest-test.cmd Wed Nov 27 11:52:35 2013
@@ -65,10 +65,12 @@ IF NOT "%1" == "" GOTO next
taskkill /im svnserve.exe httpd.exe /f 2> nul:
-IF NOT EXIST "%TESTDIR%\bin" MKDIR "%TESTDIR%\bin"
-xcopy /y /i ..\deps\release\bin\*.dll "%TESTDIR%\bin"
+IF "%SVN_BRANCH%" LSS "1.9." (
+ IF NOT EXIST "%TESTDIR%\bin" MKDIR "%TESTDIR%\bin"
+ xcopy /y /i ..\deps\release\bin\*.dll "%TESTDIR%\bin"
-PATH %TESTDIR%\bin;%PATH%
+ PATH %TESTDIR%\bin;!PATH!
+)
IF "%LOCAL%+%FSFS%" == "1+1" (
echo win-tests.py -c %PARALLEL% %MODE% -f fsfs %ARGS% "%TESTDIR%\tests"
Modified: subversion/branches/verify-keep-going/tools/client-side/svn-bench/cl.h
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/tools/client-side/svn-bench/cl.h?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/tools/client-side/svn-bench/cl.h (original)
+++ subversion/branches/verify-keep-going/tools/client-side/svn-bench/cl.h Wed Nov 27 11:52:35 2013
@@ -90,6 +90,7 @@ typedef struct svn_cl__opt_state_t
svn_boolean_t no_revprops; /* retrieve no revprops */
apr_hash_t *revprop_table; /* table of revision properties to get/set */
svn_boolean_t use_merge_history; /* use/display extra merge information */
+ svn_boolean_t auto_moves; /* interpret unique DEL/ADD pairs as moves */
svn_boolean_t trust_server_cert; /* trust server SSL certs that would
otherwise be rejected as "untrusted" */
} svn_cl__opt_state_t;
@@ -107,7 +108,8 @@ svn_opt_subcommand_t
svn_cl__help,
svn_cl__null_export,
svn_cl__null_list,
- svn_cl__null_log;
+ svn_cl__null_log,
+ svn_cl__null_info;
/* See definition in main.c for documentation. */
@@ -135,7 +137,7 @@ extern const apr_getopt_option_t svn_cl_
*
* Typically, error codes like SVN_ERR_UNVERSIONED_RESOURCE,
* SVN_ERR_ENTRY_NOT_FOUND, etc, are supplied in varargs. Don't
- * forget to terminate the argument list with SVN_NO_ERROR.
+ * forget to terminate the argument list with 0 (or APR_SUCCESS).
*/
svn_error_t *
svn_cl__try(svn_error_t *err,
Modified: subversion/branches/verify-keep-going/tools/client-side/svn-bench/notify.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/tools/client-side/svn-bench/notify.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/tools/client-side/svn-bench/notify.c (original)
+++ subversion/branches/verify-keep-going/tools/client-side/svn-bench/notify.c Wed Nov 27 11:52:35 2013
@@ -348,7 +348,7 @@ notify(void *baton, const svn_wc_notify_
apr_pstrcat(pool, s,
"%"APR_UINT64_T_FMT
" and fuzz %lu (%s)\n",
- (char *)NULL),
+ SVN_VA_NULL),
n->hunk_original_start,
n->hunk_original_length,
n->hunk_modified_start,
@@ -365,7 +365,7 @@ notify(void *baton, const svn_wc_notify_
apr_pstrcat(pool, s,
"%"APR_UINT64_T_FMT
" and fuzz %lu\n",
- (char *)NULL),
+ SVN_VA_NULL),
n->hunk_original_start,
n->hunk_original_length,
n->hunk_modified_start,
@@ -386,7 +386,7 @@ notify(void *baton, const svn_wc_notify_
err = svn_cmdline_printf(pool,
apr_pstrcat(pool, s,
"%"APR_UINT64_T_FMT" (%s)\n",
- (char *)NULL),
+ SVN_VA_NULL),
n->hunk_original_start,
n->hunk_original_length,
n->hunk_modified_start,
@@ -400,7 +400,7 @@ notify(void *baton, const svn_wc_notify_
err = svn_cmdline_printf(pool,
apr_pstrcat(pool, s,
"%"APR_UINT64_T_FMT"\n",
- (char *)NULL),
+ SVN_VA_NULL),
n->hunk_original_start,
n->hunk_original_length,
n->hunk_modified_start,
Modified: subversion/branches/verify-keep-going/tools/client-side/svn-bench/null-log-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/tools/client-side/svn-bench/null-log-cmd.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/tools/client-side/svn-bench/null-log-cmd.c (original)
+++ subversion/branches/verify-keep-going/tools/client-side/svn-bench/null-log-cmd.c Wed Nov 27 11:52:35 2013
@@ -140,6 +140,9 @@ svn_cl__null_log(apr_getopt_t *os,
apr_array_header_t *revprops;
svn_opt_revision_t target_peg_revision;
const char *target_path_or_url;
+ svn_move_behavior_t move_behavior = opt_state->auto_moves
+ ? svn_move_behavior_auto_moves
+ : svn_move_behavior_explicit_moves;
SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,
opt_state->targets,
@@ -202,13 +205,14 @@ svn_cl__null_log(apr_getopt_t *os,
APR_ARRAY_PUSH(revprops, const char *) = SVN_PROP_REVISION_DATE;
if (!opt_state->quiet)
APR_ARRAY_PUSH(revprops, const char *) = SVN_PROP_REVISION_LOG;
- SVN_ERR(svn_client_log5(targets,
+ SVN_ERR(svn_client_log6(targets,
&target_peg_revision,
opt_state->revision_ranges,
opt_state->limit,
opt_state->verbose,
opt_state->stop_on_copy,
opt_state->use_merge_history,
+ move_behavior,
revprops,
log_entry_receiver,
&lb,
Modified: subversion/branches/verify-keep-going/tools/client-side/svn-bench/svn-bench.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/tools/client-side/svn-bench/svn-bench.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/tools/client-side/svn-bench/svn-bench.c (original)
+++ subversion/branches/verify-keep-going/tools/client-side/svn-bench/svn-bench.c Wed Nov 27 11:52:35 2013
@@ -66,7 +66,9 @@ typedef enum svn_cl__longopt_t {
opt_with_revprop,
opt_with_all_revprops,
opt_with_no_revprops,
- opt_trust_server_cert
+ opt_auto_moves,
+ opt_trust_server_cert,
+ opt_changelist
} svn_cl__longopt_t;
@@ -147,6 +149,10 @@ const apr_getopt_option_t svn_cl__option
N_("set revision property ARG in new revision\n"
" "
"using the name[=value] format")},
+ {"auto-moves", opt_auto_moves, 0,
+ N_("attempt to interpret matching unique DEL+ADD\n"
+ " "
+ "pairs as moves")},
{"use-merge-history", 'g', 0,
N_("use/display additional information from merge\n"
" "
@@ -255,10 +261,20 @@ const svn_opt_subcommand_desc2_t svn_cl_
" behavior, which can be useful for determining branchpoints.\n"),
{'r', 'q', 'v', 'g', 'c', opt_targets, opt_stop_on_copy,
'l', opt_with_all_revprops, opt_with_no_revprops, opt_with_revprop,
- 'x',},
+ opt_auto_moves, 'x',},
{{opt_with_revprop, N_("retrieve revision property ARG")},
{'c', N_("the change made in revision ARG")}} },
+ { "null-info", svn_cl__null_info, {0}, N_
+ ("Display information about a local or remote item.\n"
+ "usage: info [TARGET[@REV]...]\n"
+ "\n"
+ " Print information about each TARGET (default: '.').\n"
+ " TARGET may be either a working-copy path or URL. If specified, REV\n"
+ " determines in which revision the target is first looked up.\n"),
+ {'r', 'R', opt_depth, opt_targets, opt_changelist}
+ },
+
{ NULL, NULL, {0}, NULL, {0} }
};
@@ -278,7 +294,7 @@ check_lib_versions(void)
};
SVN_VERSION_DEFINE(my_version);
- return svn_ver_check_list(&my_version, checklist);
+ return svn_ver_check_list2(&my_version, checklist, svn_ver_equal);
}
@@ -306,22 +322,13 @@ svn_cl__check_cancel(void *baton)
/*** Main. ***/
-/* Report and clear the error ERR, and return EXIT_FAILURE. */
-#define EXIT_ERROR(err) \
- svn_cmdline_handle_exit_error(err, NULL, "svn: ")
-
-/* A redefinition of the public SVN_INT_ERR macro, that suppresses the
- * error message if it is SVN_ERR_IO_PIPE_WRITE_ERROR. */
-#undef SVN_INT_ERR
-#define SVN_INT_ERR(expr) \
- do { \
- svn_error_t *svn_err__temp = (expr); \
- if (svn_err__temp) \
- return EXIT_ERROR(svn_err__temp); \
- } while (0)
-
-static int
-sub_main(int argc, const char *argv[], apr_pool_t *pool)
+/*
+ * On success, leave *EXIT_CODE untouched and return SVN_NO_ERROR. On error,
+ * either return an error to be displayed, or set *EXIT_CODE to non-zero and
+ * return SVN_NO_ERROR.
+ */
+static svn_error_t *
+sub_main(int *exit_code, int argc, const char *argv[], apr_pool_t *pool)
{
svn_error_t *err;
int opt_id;
@@ -340,18 +347,18 @@ sub_main(int argc, const char *argv[], a
received_opts = apr_array_make(pool, SVN_OPT_MAX_OPTIONS, sizeof(int));
/* Check library versions */
- SVN_INT_ERR(check_lib_versions());
+ SVN_ERR(check_lib_versions());
#if defined(WIN32) || defined(__CYGWIN__)
/* Set the working copy administrative directory name. */
if (getenv("SVN_ASP_DOT_NET_HACK"))
{
- SVN_INT_ERR(svn_wc_set_adm_dir("_svn", pool));
+ SVN_ERR(svn_wc_set_adm_dir("_svn", pool));
}
#endif
/* Initialize the RA library. */
- SVN_INT_ERR(svn_ra_initialize(pool));
+ SVN_ERR(svn_ra_initialize(pool));
/* Begin processing arguments. */
opt_state.start_revision.kind = svn_opt_revision_unspecified;
@@ -363,12 +370,13 @@ sub_main(int argc, const char *argv[], a
/* No args? Show usage. */
if (argc <= 1)
{
- SVN_INT_ERR(svn_cl__help(NULL, NULL, pool));
- return EXIT_FAILURE;
+ SVN_ERR(svn_cl__help(NULL, NULL, pool));
+ *exit_code = EXIT_FAILURE;
+ return SVN_NO_ERROR;
}
/* Else, parse options. */
- SVN_INT_ERR(svn_cmdline__getopt_init(&os, argc, argv, pool));
+ SVN_ERR(svn_cmdline__getopt_init(&os, argc, argv, pool));
os->interleave = 1;
while (1)
@@ -383,8 +391,9 @@ sub_main(int argc, const char *argv[], a
break;
else if (apr_err)
{
- SVN_INT_ERR(svn_cl__help(NULL, NULL, pool));
- return EXIT_FAILURE;
+ SVN_ERR(svn_cl__help(NULL, NULL, pool));
+ *exit_code = EXIT_FAILURE;
+ return SVN_NO_ERROR;
}
/* Stash the option code in an array before parsing it. */
@@ -396,15 +405,13 @@ sub_main(int argc, const char *argv[], a
err = svn_cstring_atoi(&opt_state.limit, opt_arg);
if (err)
{
- err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, err,
- _("Non-numeric limit argument given"));
- return EXIT_ERROR(err);
+ return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, err,
+ _("Non-numeric limit argument given"));
}
if (opt_state.limit <= 0)
{
- err = svn_error_create(SVN_ERR_INCORRECT_PARAMS, NULL,
- _("Argument to --limit must be positive"));
- return EXIT_ERROR(err);
+ return svn_error_create(SVN_ERR_INCORRECT_PARAMS, NULL,
+ _("Argument to --limit must be positive"));
}
}
break;
@@ -438,12 +445,11 @@ sub_main(int argc, const char *argv[], a
{
if (changeno < 0 || is_negative)
{
- err = svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR,
- NULL,
- _("Negative number in range (%s)"
- " not supported with -c"),
- change_str);
- return EXIT_ERROR(err);
+ return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR,
+ NULL,
+ _("Negative number in range (%s)"
+ " not supported with -c"),
+ change_str);
}
s = end + 1;
while (*s == 'r')
@@ -452,17 +458,15 @@ sub_main(int argc, const char *argv[], a
}
if (end == change_str || *end != '\0')
{
- err = svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
- _("Non-numeric change argument (%s) "
- "given to -c"), change_str);
- return EXIT_ERROR(err);
+ return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+ _("Non-numeric change argument (%s) "
+ "given to -c"), change_str);
}
if (changeno == 0)
{
- err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
- _("There is no change 0"));
- return EXIT_ERROR(err);
+ return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+ _("There is no change 0"));
}
if (is_negative)
@@ -501,12 +505,11 @@ sub_main(int argc, const char *argv[], a
if (svn_opt_parse_revision_to_range(opt_state.revision_ranges,
opt_arg, pool) != 0)
{
- SVN_INT_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
- err = svn_error_createf
+ SVN_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
+ return svn_error_createf
(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
_("Syntax error in revision argument '%s'"),
utf8_opt_arg);
- return EXIT_ERROR(err);
}
break;
case 'v':
@@ -527,44 +530,45 @@ sub_main(int argc, const char *argv[], a
the targets into an array, because otherwise we wouldn't
know what delimiter to use for svn_cstring_split(). */
- SVN_INT_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
- SVN_INT_ERR(svn_stringbuf_from_file2(&buffer, utf8_opt_arg, pool));
- SVN_INT_ERR(svn_utf_stringbuf_to_utf8(&buffer_utf8, buffer, pool));
+ SVN_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
+ SVN_ERR(svn_stringbuf_from_file2(&buffer, utf8_opt_arg, pool));
+ SVN_ERR(svn_utf_stringbuf_to_utf8(&buffer_utf8, buffer, pool));
opt_state.targets = svn_cstring_split(buffer_utf8->data, "\n\r",
TRUE, pool);
}
break;
+ case 'R':
+ opt_state.depth = svn_depth_infinity;
+ break;
case 'N':
descend = FALSE;
break;
case opt_depth:
err = svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool);
if (err)
- return EXIT_ERROR
- (svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, err,
- _("Error converting depth "
- "from locale to UTF-8")));
+ return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, err,
+ _("Error converting depth "
+ "from locale to UTF-8"));
opt_state.depth = svn_depth_from_word(utf8_opt_arg);
if (opt_state.depth == svn_depth_unknown
|| opt_state.depth == svn_depth_exclude)
{
- return EXIT_ERROR
- (svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
- _("'%s' is not a valid depth; try "
- "'empty', 'files', 'immediates', "
- "or 'infinity'"),
- utf8_opt_arg));
+ return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+ _("'%s' is not a valid depth; try "
+ "'empty', 'files', 'immediates', "
+ "or 'infinity'"),
+ utf8_opt_arg);
}
break;
case opt_version:
opt_state.version = TRUE;
break;
case opt_auth_username:
- SVN_INT_ERR(svn_utf_cstring_to_utf8(&opt_state.auth_username,
+ SVN_ERR(svn_utf_cstring_to_utf8(&opt_state.auth_username,
opt_arg, pool));
break;
case opt_auth_password:
- SVN_INT_ERR(svn_utf_cstring_to_utf8(&opt_state.auth_password,
+ SVN_ERR(svn_utf_cstring_to_utf8(&opt_state.auth_password,
opt_arg, pool));
break;
case opt_stop_on_copy:
@@ -583,13 +587,13 @@ sub_main(int argc, const char *argv[], a
opt_state.trust_server_cert = TRUE;
break;
case 'x':
- SVN_INT_ERR(svn_utf_cstring_to_utf8(&opt_state.extensions,
+ SVN_ERR(svn_utf_cstring_to_utf8(&opt_state.extensions,
opt_arg, pool));
break;
case opt_config_dir:
{
const char *path_utf8;
- SVN_INT_ERR(svn_utf_cstring_to_utf8(&path_utf8, opt_arg, pool));
+ SVN_ERR(svn_utf_cstring_to_utf8(&path_utf8, opt_arg, pool));
opt_state.config_dir = svn_dirent_internal_style(path_utf8, pool);
}
break;
@@ -599,8 +603,8 @@ sub_main(int argc, const char *argv[], a
apr_array_make(pool, 1,
sizeof(svn_cmdline__config_argument_t*));
- SVN_INT_ERR(svn_utf_cstring_to_utf8(&opt_arg, opt_arg, pool));
- SVN_INT_ERR(svn_cmdline__parse_config_option(opt_state.config_options,
+ SVN_ERR(svn_utf_cstring_to_utf8(&opt_arg, opt_arg, pool));
+ SVN_ERR(svn_cmdline__parse_config_option(opt_state.config_options,
opt_arg, pool));
break;
case opt_with_all_revprops:
@@ -612,12 +616,15 @@ sub_main(int argc, const char *argv[], a
opt_state.no_revprops = TRUE;
break;
case opt_with_revprop:
- SVN_INT_ERR(svn_opt_parse_revprop(&opt_state.revprop_table,
+ SVN_ERR(svn_opt_parse_revprop(&opt_state.revprop_table,
opt_arg, pool));
break;
case 'g':
opt_state.use_merge_history = TRUE;
break;
+ case opt_auto_moves:
+ opt_state.auto_moves = TRUE;
+ break;
default:
/* Hmmm. Perhaps this would be a good place to squirrel away
opts that commands like svn diff might need. Hmmm indeed. */
@@ -635,7 +642,7 @@ sub_main(int argc, const char *argv[], a
hand, the alternative is effectively to demand that they call
svn_config_ensure() instead, so maybe we should have a generic
init function anyway. Thoughts? */
- SVN_INT_ERR(svn_config_ensure(opt_state.config_dir, pool));
+ SVN_ERR(svn_config_ensure(opt_state.config_dir, pool));
/* If the user asked for help, then the rest of the arguments are
the names of subcommands to get help on (if any), or else they're
@@ -668,8 +675,9 @@ sub_main(int argc, const char *argv[], a
svn_error_clear
(svn_cmdline_fprintf(stderr, pool,
_("Subcommand argument required\n")));
- SVN_INT_ERR(svn_cl__help(NULL, NULL, pool));
- return EXIT_FAILURE;
+ SVN_ERR(svn_cl__help(NULL, NULL, pool));
+ *exit_code = EXIT_FAILURE;
+ return SVN_NO_ERROR;
}
}
else
@@ -680,14 +688,15 @@ sub_main(int argc, const char *argv[], a
if (subcommand == NULL)
{
const char *first_arg_utf8;
- SVN_INT_ERR(svn_utf_cstring_to_utf8(&first_arg_utf8,
+ SVN_ERR(svn_utf_cstring_to_utf8(&first_arg_utf8,
first_arg, pool));
svn_error_clear
(svn_cmdline_fprintf(stderr, pool,
_("Unknown subcommand: '%s'\n"),
first_arg_utf8));
- SVN_INT_ERR(svn_cl__help(NULL, NULL, pool));
- return EXIT_FAILURE;
+ SVN_ERR(svn_cl__help(NULL, NULL, pool));
+ *exit_code = EXIT_FAILURE;
+ return SVN_NO_ERROR;
}
}
}
@@ -713,14 +722,15 @@ sub_main(int argc, const char *argv[], a
subcommand, pool);
svn_opt_format_option(&optstr, badopt, FALSE, pool);
if (subcommand->name[0] == '-')
- SVN_INT_ERR(svn_cl__help(NULL, NULL, pool));
+ SVN_ERR(svn_cl__help(NULL, NULL, pool));
else
svn_error_clear
(svn_cmdline_fprintf
(stderr, pool, _("Subcommand '%s' doesn't accept option '%s'\n"
"Type 'svn-bench help %s' for usage.\n"),
subcommand->name, optstr, subcommand->name));
- return EXIT_FAILURE;
+ *exit_code = EXIT_FAILURE;
+ return SVN_NO_ERROR;
}
}
@@ -729,11 +739,10 @@ sub_main(int argc, const char *argv[], a
{
if (opt_state.revision_ranges->nelts > 1)
{
- err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
- _("Multiple revision arguments "
- "encountered; can't specify -c twice, "
- "or both -c and -r"));
- return EXIT_ERROR(err);
+ return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+ _("Multiple revision arguments "
+ "encountered; can't specify -c twice, "
+ "or both -c and -r"));
}
}
@@ -741,29 +750,26 @@ sub_main(int argc, const char *argv[], a
--with-no-revprops. */
if (opt_state.all_revprops && opt_state.no_revprops)
{
- err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
- _("--with-all-revprops and --with-no-revprops "
- "are mutually exclusive"));
- return EXIT_ERROR(err);
+ return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+ _("--with-all-revprops and --with-no-revprops "
+ "are mutually exclusive"));
}
/* Disallow simultaneous use of both --with-revprop and
--with-no-revprops. */
if (opt_state.revprop_table && opt_state.no_revprops)
{
- err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
- _("--with-revprop and --with-no-revprops "
- "are mutually exclusive"));
- return EXIT_ERROR(err);
+ return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+ _("--with-revprop and --with-no-revprops "
+ "are mutually exclusive"));
}
/* --trust-server-cert can only be used with --non-interactive */
if (opt_state.trust_server_cert && !opt_state.non_interactive)
{
- err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
- _("--trust-server-cert requires "
- "--non-interactive"));
- return EXIT_ERROR(err);
+ return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+ _("--trust-server-cert requires "
+ "--non-interactive"));
}
/* Ensure that 'revision_ranges' has at least one item, and make
@@ -783,7 +789,7 @@ sub_main(int argc, const char *argv[], a
/* Create a client context object. */
command_baton.opt_state = &opt_state;
- SVN_INT_ERR(svn_client_create_context2(&ctx, NULL, pool));
+ SVN_ERR(svn_client_create_context2(&ctx, NULL, pool));
command_baton.ctx = ctx;
/* Only a few commands can accept a revision range; the rest can take at
@@ -792,8 +798,7 @@ sub_main(int argc, const char *argv[], a
{
if (opt_state.end_revision.kind != svn_opt_revision_unspecified)
{
- err = svn_error_create(SVN_ERR_CLIENT_REVISION_RANGE, NULL, NULL);
- return EXIT_ERROR(err);
+ return svn_error_create(SVN_ERR_CLIENT_REVISION_RANGE, NULL, NULL);
}
}
@@ -814,7 +819,7 @@ sub_main(int argc, const char *argv[], a
svn_error_clear(err);
}
else
- return EXIT_ERROR(err);
+ return err;
}
cfg_config = apr_hash_get(ctx->config, SVN_CONFIG_CATEGORY_CONFIG,
@@ -839,7 +844,7 @@ sub_main(int argc, const char *argv[], a
use_notifier = FALSE;
if (use_notifier)
{
- SVN_INT_ERR(svn_cl__get_notifier(&ctx->notify_func2, &ctx->notify_baton2,
+ SVN_ERR(svn_cl__get_notifier(&ctx->notify_func2, &ctx->notify_baton2,
pool));
}
@@ -870,7 +875,7 @@ sub_main(int argc, const char *argv[], a
#endif
/* Set up Authentication stuff. */
- SVN_INT_ERR(svn_cmdline_create_auth_baton(&ab,
+ SVN_ERR(svn_cmdline_create_auth_baton(&ab,
opt_state.non_interactive,
opt_state.auth_username,
opt_state.auth_password,
@@ -920,26 +925,21 @@ sub_main(int argc, const char *argv[], a
"(type 'svn help cleanup' for details)"));
}
- return EXIT_ERROR(err);
+ return err;
}
- else
- {
- /* Ensure that stdout is flushed, so the user will see any write errors.
- This makes sure that output is not silently lost. */
- SVN_INT_ERR(svn_cmdline_fflush(stdout));
- return EXIT_SUCCESS;
- }
+ return SVN_NO_ERROR;
}
int
main(int argc, const char *argv[])
{
apr_pool_t *pool;
- int exit_code;
+ int exit_code = EXIT_SUCCESS;
+ svn_error_t *err;
/* Initialize the app. */
- if (svn_cmdline_init("svn", stderr) != EXIT_SUCCESS)
+ if (svn_cmdline_init("svn-bench", stderr) != EXIT_SUCCESS)
return EXIT_FAILURE;
/* Create our top-level pool. Use a separate mutexless allocator,
@@ -947,7 +947,17 @@ main(int argc, const char *argv[])
*/
pool = apr_allocator_owner_get(svn_pool_create_allocator(FALSE));
- exit_code = sub_main(argc, argv, pool);
+ err = sub_main(&exit_code, argc, argv, pool);
+
+ /* Flush stdout and report if it fails. It would be flushed on exit anyway
+ but this makes sure that output is not silently lost if it fails. */
+ err = svn_error_compose_create(err, svn_cmdline_fflush(stdout));
+
+ if (err)
+ {
+ exit_code = EXIT_FAILURE;
+ svn_cmdline_handle_exit_error(err, NULL, "svn-bench: ");
+ }
svn_pool_destroy(pool);
return exit_code;
Modified: subversion/branches/verify-keep-going/tools/dev/build-svn-deps-win.pl
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/tools/dev/build-svn-deps-win.pl?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/tools/dev/build-svn-deps-win.pl (original)
+++ subversion/branches/verify-keep-going/tools/dev/build-svn-deps-win.pl Wed Nov 27 11:52:35 2013
@@ -51,7 +51,6 @@
# Usage/help output from the usual flags/on error input.
# Make SQLITE_VER friendly since we're using no dots right now.
# Work out the fixes to the projects' sources and contribute them back.
-# Allow selection of Release/Debug builds.
# Allow selection of Arch (x86 and x64)
# ZLib support for OpenSSL (have to patch openssl)
# Use CMake zlib build instead.
@@ -135,7 +134,8 @@ our $SRCDIR; # directory where we store
# Some other options
our $VS_VER;
our $NEON;
-our $SVN_VER = '1.8.x';
+our $SVN_VER = '1.9.x';
+our $DEBUG = 0;
# Utility function to remove dots from a string
sub remove_dots {
@@ -351,6 +351,7 @@ sub clean_structure {
rmtree($INCDIR);
rmtree($LIBDIR);
rmtree("$INSTDIR\\serf");
+ rmtree("$INSTDIR\\neon");
rmtree("$INSTDIR\\sqlite-amalgamation");
# Dirs created indirectly by the install targets
@@ -422,7 +423,7 @@ sub download_dependencies {
download_file($PCRE_URL, "$SRCDIR\\pcre.zip", \$PCRE_FILE);
download_file($SQLITE_URL, "$SRCDIR\\sqlite-amalgamation.zip", \$SQLITE_FILE);
download_file($SERF_URL, "$SRCDIR\\serf.zip", \$SERF_FILE);
- download_file($NEON_URL, "$SRCDIR\\neon.tar.gz", \$NEON_FILE) if defined($NEON);
+ download_file($NEON_URL, "$SRCDIR\\neon.tar.gz", \$NEON_FILE) if $NEON;
}
##############
@@ -488,7 +489,7 @@ sub extract_dependencies {
extract_file($SERF_FILE, $INSTDIR,
"$INSTDIR\\serf-$SERF_VER", "$INSTDIR\\serf");
extract_file($NEON_FILE, $INSTDIR,
- "$INSTDIR\\neon-$NEON_VER", "$INSTDIR\\neon") if defined($NEON);
+ "$INSTDIR\\neon-$NEON_VER", "$INSTDIR\\neon") if $NEON;
}
#########
@@ -499,7 +500,7 @@ sub build_pcre {
chdir_or_die("$SRCLIB\\pcre");
my $pcre_generator = 'NMake Makefiles';
# Have to use RelWithDebInfo since httpd looks for the pdb files
- my $pcre_build_type = '-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo';
+ my $pcre_build_type = '-DCMAKE_BUILD_TYPE:STRING=' . ($DEBUG ? 'Debug' : 'RelWithDebInfo');
my $pcre_shared_libs = '-DBUILD_SHARED_LIBS:BOOL=ON';
my $pcre_install_prefix = "-DCMAKE_INSTALL_PREFIX:PATH=$INSTDIR";
my $cmake_cmd = qq("$CMAKE" -G "$pcre_generator" "$pcre_build_type" "$pcre_shared_libs" "$pcre_install_prefix" .);
@@ -514,7 +515,7 @@ sub build_pcre {
# build generates, it it doesn't match that then Subversion will fail to build.
sub build_zlib {
chdir_or_die("$SRCLIB\\zlib");
- $ENV{CC_OPTS} = '/MD /02 /Zi';
+ $ENV{CC_OPTS} = $DEBUG ? '/MDd /Gm /ZI /Od /GZ /D_DEBUG' : '/MD /02 /Zi';
$ENV{COMMON_CC_OPTS} = '/nologo /W3 /DWIN32 /D_WINDOWS';
system_or_die("Failure building zilb", qq("$NMAKE" /nologo -f win32\\Makefile.msc STATICLIB=zlibstat.lib all));
@@ -543,8 +544,9 @@ sub build_openssl {
# The apache build docs suggest no-rc5 no-idea enable-mdc2 on top of what
# is used below, the primary driver behind that is patents, but I believe
# the rc5 and idea patents have expired.
+ my $platform = $DEBUG ? 'debug-VC-WIN32' : 'VC-WIN32';
system_or_die("Failure configuring openssl",
- qq("$PERL" Configure no-asm "--prefix=$INSTDIR" VC-WIN32));
+ qq("$PERL" Configure no-asm "--prefix=$INSTDIR" $platform));
system_or_die("Failure building openssl (bat)", 'ms\do_ms.bat');
system_or_die("Failure building openssl (nmake)", qq("$NMAKE" /f ms\\ntdll.mak));
system_or_die("Failure testing openssl", qq("$NMAKE" /f ms\\ntdll.mak test));
@@ -601,6 +603,9 @@ sub httpd_fix_makefile {
modify_file_in_place($file, sub {
s/\.vcproj/.vcxproj/i;
+ # below fixes that installd breaks when trying to install pcre because
+ # dll is named pcred.dll when a Debug build.
+ s/^(\s*copy srclib\\pcre\\pcre\.\$\(src_dll\)\s+"\$\(inst_dll\)"\s+<\s*\.y\s*)$/!IF EXISTS("srclib\\pcre\\pcre\.\$(src_dll)")\n$1!ENDIF\n!IF EXISTS("srclib\\pcre\\pcred\.\$(src_dll)")\n\tcopy srclib\\pcre\\pcred.\$(src_dll)\t\t\t"\$(inst_dll)" <.y\n!ENDIF\n/;
});
}
@@ -650,8 +655,9 @@ sub get_output_file {
# Find the name of the bdb library we've installed in our LIBDIR.
sub find_bdb_lib {
my $result;
+ my $debug = $DEBUG ? 'd' : '';
find(sub {
- if (not defined($result) and /^libdb\d+\.lib$/) {
+ if (not defined($result) and /^libdb\d+$debug\.lib$/) {
$result = $_;
}
}, $LIBDIR);
@@ -688,12 +694,25 @@ sub httpd_enable_bdb {
insert_dependency_in_proj('support\htdbm.vcxproj', $bdb_lib, '.bdb');
}
+# Apply the same fix as found in r1486937 on httpd 2.4.x branch.
+sub httpd_fix_debug {
+ my ($httpd_major, $httpd_minor, $httpd_patch) = $HTTPD_VER =~ /^(\d+)\.(\d+)\.(.+)$/;
+ return unless ($httpd_major <= 2 && $httpd_minor <= 4 && $httpd_patch < 5);
+
+ modify_file_in_place('libhttpd.dsp', sub {
+ s/^(!MESSAGE "libhttpd - Win32 Debug" \(based on "Win32 \(x86\) Dynamic-Link Library"\))$/$1\n!MESSAGE "libhttpd - Win32 Lexical" (based on "Win32 (x86) Dynamic-Link Library")/;
+ s/^(# Begin Group "headers")$/# Name "libhttpd - Win32 Lexical"\n$1/;
+ }, '.lexical');
+}
+
sub build_httpd {
chdir_or_die($HTTPD);
my $vs_2012 = $VS_VER eq '2012';
my $vs_2010 = $VS_VER eq '2010';
+ httpd_fix_debug();
+
# I don't think cvtdsp.pl is necessary with Visual Studio 2012
# but it shouldn't hurt anything either. Including it allows
# for the possibility that this may work for older Visual Studio
@@ -763,8 +782,9 @@ sub build_httpd {
# configurations inside the project since we get them from the environment.
# Once all that is done the BuildBin project should be buildable for you to
# diagnose the problem.
+ my $target = $DEBUG ? "installd" : "installr";
system_or_die("Failed building/installing httpd/apr/apu/api",
- qq("$NMAKE" /f Makefile.win installr "DBM_LIST=db" "INSTDIR=$INSTDIR"));
+ qq("$NMAKE" /f Makefile.win $target "DBM_LIST=db" "INSTDIR=$INSTDIR"));
chdir_or_die($TOPDIR);
}
@@ -776,13 +796,15 @@ sub build_bdb {
my $sln = 'build_windows\Berkeley_DB_vs2010.sln';
upgrade_solution($sln);
+ my $platform = $DEBUG ? 'Debug|Win32' : 'Release|Win32';
+
# Build the db Project first since the full solution fails due to a broken
# dependency with the current version of BDB if we don't.
system_or_die("Failed building DBD (Project db)",
- qq("$DEVENV" "$sln" /Build "Release|Win32" /Project db));
+ qq("$DEVENV" "$sln" /Build "$platform" /Project db));
system_or_die("Failed building DBD",
- qq("$DEVENV" "$sln" /Build "Release|Win32"));
+ qq("$DEVENV" "$sln" /Build "$platform"));
# BDB doesn't seem to have it's own install routines so we'll do it ourselves
copy_or_die('build_windows\db.h', $INCDIR);
@@ -792,16 +814,31 @@ sub build_bdb {
} elsif (/\.lib$/) {
copy_or_die($_, $LIBDIR);
}
- }, 'build_windows\Win32\Release');
+ }, 'build_windows\\Win32\\' . ($DEBUG ? 'Debug' : 'Release'));
chdir_or_die($TOPDIR);
}
+# Right now this doesn't actually build serf but just patches it so that it
+# can build against a debug build of OpenSSL.
+sub build_serf {
+ chdir_or_die("$TOPDIR\\serf");
+
+ modify_file_in_place('serf.mak', sub {
+ s/^(INTDIR = Release)$/$1\nOPENSSL_OUT_SUFFIX =/;
+ s/^(INTDIR = Debug)$/$1\nOPENSSL_OUT_SUFFIX = .dbg/;
+ s/(\$\(OPENSSL_SRC\)\\out32(?:dll)?)/$1\$(OPENSSL_OUT_SUFFIX)/g;
+ }, '.debug');
+
+ chdir_or_die($TOPDIR);
+}
+
sub build_dependencies {
build_bdb();
build_zlib();
build_pcre();
build_openssl();
+ build_serf();
build_httpd();
}
Modified: subversion/branches/verify-keep-going/tools/dev/fsfs-access-map.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/tools/dev/fsfs-access-map.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/tools/dev/fsfs-access-map.c (original)
+++ subversion/branches/verify-keep-going/tools/dev/fsfs-access-map.c Wed Nov 27 11:52:35 2013
@@ -52,9 +52,15 @@ typedef struct file_stats_t
/* number of lseek calls to clusters not previously read */
apr_int64_t uncached_seek_count;
+ /* number of lseek counts not followed by a read */
+ apr_int64_t unnecessary_seeks;
+
/* number of read() calls */
apr_int64_t read_count;
+ /* number of read() calls that returned 0 bytes */
+ apr_int64_t empty_reads;
+
/* total number of bytes returned by those reads */
apr_int64_t read_size;
@@ -86,12 +92,17 @@ typedef struct handle_info_t
/* bytes read so far in the current series of reads started (default: 0) */
apr_int64_t last_read_size;
+ /* number of read() calls in this series */
+ apr_int64_t read_count;
} handle_info_t;
/* useful typedef */
typedef unsigned char byte;
typedef unsigned short word;
+/* an RGB color */
+typedef byte color_t[3];
+
/* global const char * file name -> *file_info_t map */
static apr_hash_t *files = NULL;
@@ -136,6 +147,11 @@ store_read_info(handle_info_t *handle_in
++*count;
}
}
+ else if (handle_info->read_count == 0)
+ {
+ /* two consecutive seeks */
+ handle_info->file->unnecessary_seeks++;
+ }
}
/* Handle a open() call. Ensures that a file_info_t for the given NAME
@@ -188,6 +204,14 @@ open_file(const char *name, int handle)
else
file->rev_num = -1;
+ /* filter out log/phys index files */
+ if (file->rev_num >= 0)
+ {
+ const char *suffix = name + strlen(name) - 4;
+ if (strcmp(suffix, ".l2p") == 0 || strcmp(suffix, ".p2l") == 0)
+ file->rev_num = -1;
+ }
+
apr_hash_set(files, file->name, APR_HASH_KEY_STRING, file);
}
@@ -220,9 +244,13 @@ read_file(int handle, apr_int64_t count)
{
/* known file handle -> expand current read sequence */
+ handle_info->read_count++;
handle_info->last_read_size += count;
handle_info->file->read_count++;
handle_info->file->read_size += count;
+
+ if (count == 0)
+ handle_info->file->empty_reads++;
}
}
@@ -242,6 +270,7 @@ seek_file(int handle, apr_int64_t locati
handle_info->last_read_size = 0;
handle_info->last_read_start = location;
+ handle_info->read_count = 0;
handle_info->file->seek_count++;
/* if we seek to a location that had not been read from before,
@@ -275,10 +304,17 @@ parse_line(svn_stringbuf_t *line)
char *return_value = strrchr(line->data, ' ');
char *first_param_end;
apr_int64_t func_return = 0;
+ char *func_start = strchr(line->data, ' ');
if (func_end == NULL || return_value == NULL)
return;
+ if (func_start == NULL || func_start > func_end)
+ func_start = line->data;
+ else
+ while(*func_start == ' ')
+ func_start++;
+
first_param_end = strchr(func_end, ',');
if (first_param_end == NULL)
first_param_end = strchr(func_end, ')');
@@ -295,7 +331,7 @@ parse_line(svn_stringbuf_t *line)
svn_error_clear(svn_cstring_atoi64(&func_return, return_value));
/* process those operations that we care about */
- if (strcmp(line->data, "open") == 0)
+ if (strcmp(func_start, "open") == 0)
{
/* remove double quotes from file name parameter */
*func_end++ = 0;
@@ -303,11 +339,11 @@ parse_line(svn_stringbuf_t *line)
open_file(func_end, (int)func_return);
}
- else if (strcmp(line->data, "read") == 0)
+ else if (strcmp(func_start, "read") == 0)
read_file(atoi(func_end), func_return);
- else if (strcmp(line->data, "lseek") == 0)
+ else if (strcmp(func_start, "lseek") == 0)
seek_file(atoi(func_end), func_return);
- else if (strcmp(line->data, "close") == 0)
+ else if (strcmp(func_start, "close") == 0)
close_file(atoi(func_end));
}
@@ -494,17 +530,82 @@ write_bitmap_header(apr_file_t *file, in
apr_file_write(file, header, &written);
}
-/* write the cluster read map for all files in INFO as BMP image to FILE.
+/* To COLOR, add the fractional value of SOURCE from fractional indexes
+ * SOURCE_START to SOURCE_END and apply the SCALING_FACTOR.
+ */
+static void
+add_sample(color_t color,
+ color_t *source,
+ double source_start,
+ double source_end,
+ double scaling_factor)
+{
+ double factor = (source_end - source_start) / scaling_factor;
+
+ apr_size_t i;
+ for (i = 0; i < sizeof(color_t) / sizeof(*color); ++i)
+ color[i] += (source_end - source_start < 0.5) && source_start > 1.0
+ ? factor * source[(apr_size_t)source_start - 1][i]
+ : factor * source[(apr_size_t)source_start][i];
+}
+
+/* Scale the IN_LEN RGB values from IN to OUT_LEN RGB values in OUT.
+ */
+static void
+scale_line(color_t* out,
+ apr_size_t out_len,
+ color_t *in,
+ apr_size_t in_len)
+{
+ double scaling_factor = (double)(in_len) / (double)(out_len);
+
+ apr_size_t i;
+ memset(out, 0, out_len * sizeof(color_t));
+ for (i = 0; i < out_len; ++i)
+ {
+ color_t color = { 0 };
+
+ double source_start = i * scaling_factor;
+ double source_end = (i + 1) * scaling_factor;
+
+ if ((apr_size_t)source_start == (apr_size_t)source_end)
+ {
+ add_sample(color, in, source_start, source_end, scaling_factor);
+ }
+ else
+ {
+ apr_size_t k;
+ apr_size_t first_sample_end = (apr_size_t)source_start + 1;
+ apr_size_t last_sample_start = (apr_size_t)source_end;
+
+ add_sample(color, in, source_start, first_sample_end, scaling_factor);
+ for (k = first_sample_end; k < last_sample_start; ++k)
+ add_sample(color, in, k, k + 1, scaling_factor);
+
+ add_sample(color, in, last_sample_start, source_end, scaling_factor);
+ }
+
+ memcpy(out[i], color, sizeof(color));
+ }
+}
+
+/* Write the cluster read map for all files in INFO as BMP image to FILE.
+ * If MAX_X is not 0, scale all lines to MAX_X pixels. Use POOL for
+ * allocations.
*/
static void
-write_bitmap(apr_array_header_t *info, apr_file_t *file)
+write_bitmap(apr_array_header_t *info,
+ apr_size_t max_x,
+ apr_file_t *file,
+ apr_pool_t *pool)
{
int ysize = info->nelts;
int xsize = 0;
int x, y;
int row_size;
- int padding;
apr_size_t written;
+ color_t *line, *scaled_line;
+ svn_boolean_t do_scale = max_x > 0;
/* xsize = max cluster number */
for (y = 0; y < ysize; ++y)
@@ -516,37 +617,40 @@ write_bitmap(apr_array_header_t *info, a
xsize = 0x3fff;
if (ysize >= 0x4000)
ysize = 0x3fff;
+ if (max_x == 0)
+ max_x = xsize;
/* rows in BMP files must be aligned to 4 bytes */
- row_size = APR_ALIGN(xsize * 3, 4);
- padding = row_size - xsize * 3;
+ row_size = APR_ALIGN(max_x * sizeof(color_t), 4);
+ /**/
+ line = apr_pcalloc(pool, xsize * sizeof(color_t));
+ scaled_line = apr_pcalloc(pool, row_size);
+
/* write header to file */
- write_bitmap_header(file, xsize, ysize);
+ write_bitmap_header(file, max_x, ysize);
/* write all rows */
for (y = 0; y < ysize; ++y)
{
file_stats_t *file_info = APR_ARRAY_IDX(info, y, file_stats_t *);
+ int block_count = file_info->read_map->nelts;
for (x = 0; x < xsize; ++x)
{
- byte color[3] = { 128, 128, 128 };
- if (x < file_info->read_map->nelts)
+ color_t color = { 128, 128, 128 };
+ if (x < block_count)
{
word count = APR_ARRAY_IDX(file_info->read_map, x, word);
select_color(color, count);
}
- written = sizeof(color);
- apr_file_write(file, color, &written);
+ memcpy(line[x], color, sizeof(color));
}
- if (padding)
- {
- char pad[3] = { 0 };
- written = padding;
- apr_file_write(file, pad, &written);
- }
+ scale_line(scaled_line, max_x, line, block_count ? block_count : 1);
+
+ written = row_size;
+ apr_file_write(file, do_scale ? scaled_line : line, &written);
}
}
@@ -592,6 +696,8 @@ print_stats(apr_pool_t *pool)
apr_int64_t clusters_read = 0;
apr_int64_t unique_clusters_read = 0;
apr_int64_t uncached_seek_count = 0;
+ apr_int64_t unnecessary_seek_count = 0;
+ apr_int64_t empty_read_count = 0;
apr_hash_index_t *hi;
for (hi = apr_hash_first(pool, files); hi; hi = apr_hash_next(hi))
@@ -609,13 +715,17 @@ print_stats(apr_pool_t *pool)
clusters_read += file->clusters_read;
unique_clusters_read += file->unique_clusters_read;
uncached_seek_count += file->uncached_seek_count;
+ unnecessary_seek_count += file->unnecessary_seeks;
+ empty_read_count += file->empty_reads;
}
printf("%20s files\n", svn__i64toa_sep(apr_hash_count(files), ',', pool));
printf("%20s files opened\n", svn__i64toa_sep(open_count, ',', pool));
printf("%20s seeks\n", svn__i64toa_sep(seek_count, ',', pool));
+ printf("%20s unnecessary seeks\n", svn__i64toa_sep(unnecessary_seek_count, ',', pool));
printf("%20s uncached seeks\n", svn__i64toa_sep(uncached_seek_count, ',', pool));
printf("%20s reads\n", svn__i64toa_sep(read_count, ',', pool));
+ printf("%20s empty reads\n", svn__i64toa_sep(empty_read_count, ',', pool));
printf("%20s unique clusters read\n", svn__i64toa_sep(unique_clusters_read, ',', pool));
printf("%20s clusters read\n", svn__i64toa_sep(clusters_read, ',', pool));
printf("%20s bytes read\n", svn__i64toa_sep(read_size, ',', pool));
@@ -665,7 +775,13 @@ int main(int argc, const char *argv[])
apr_file_open(&file, "access.bmp",
APR_WRITE | APR_CREATE | APR_TRUNCATE | APR_BUFFERED,
APR_OS_DEFAULT, pool);
- write_bitmap(get_rev_files(pool), file);
+ write_bitmap(get_rev_files(pool), 0, file, pool);
+ apr_file_close(file);
+
+ apr_file_open(&file, "access_scaled.bmp",
+ APR_WRITE | APR_CREATE | APR_TRUNCATE | APR_BUFFERED,
+ APR_OS_DEFAULT, pool);
+ write_bitmap(get_rev_files(pool), 1024, file, pool);
apr_file_close(file);
apr_file_open(&file, "scale.bmp",
@@ -675,4 +791,4 @@ int main(int argc, const char *argv[])
apr_file_close(file);
return 0;
-}
\ No newline at end of file
+}
Modified: subversion/branches/verify-keep-going/tools/dev/fsfs-reorg.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/tools/dev/fsfs-reorg.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/tools/dev/fsfs-reorg.c (original)
+++ subversion/branches/verify-keep-going/tools/dev/fsfs-reorg.c Wed Nov 27 11:52:35 2013
@@ -29,6 +29,7 @@
#include <apr_file_io.h>
#include <apr_poll.h>
+#include "svn_private_config.h"
#include "svn_pools.h"
#include "svn_diff.h"
#include "svn_io.h"
@@ -1390,8 +1391,8 @@ get_combined_window(svn_stringbuf_t **co
apr_array_header_t *windows;
svn_stringbuf_t *base_content, *result;
const char *source;
- apr_pool_t *sub_pool;
- apr_pool_t *iter_pool;
+ apr_pool_t *subpool;
+ apr_pool_t *iterpool;
/* special case: no un-deltification necessary */
if (representation->is_plain)
@@ -1403,16 +1404,16 @@ get_combined_window(svn_stringbuf_t **co
return SVN_NO_ERROR;
/* read the delta windows for this representation */
- sub_pool = svn_pool_create(pool);
- iter_pool = svn_pool_create(pool);
- SVN_ERR(read_windows(&windows, fs, representation, sub_pool));
+ subpool = svn_pool_create(pool);
+ iterpool = svn_pool_create(pool);
+ SVN_ERR(read_windows(&windows, fs, representation, subpool));
/* fetch the / create a base content */
if (representation->delta_base && representation->delta_base->revision)
SVN_ERR(get_combined_window(&base_content, fs,
- representation->delta_base, sub_pool));
+ representation->delta_base, subpool));
else
- base_content = svn_stringbuf_create_empty(sub_pool);
+ base_content = svn_stringbuf_create_empty(subpool);
/* apply deltas */
result = svn_stringbuf_create_empty(pool);
@@ -1423,7 +1424,7 @@ get_combined_window(svn_stringbuf_t **co
svn_txdelta_window_t *window
= APR_ARRAY_IDX(windows, i, svn_txdelta_window_t *);
svn_stringbuf_t *buf
- = svn_stringbuf_create_ensure(window->tview_len, iter_pool);
+ = svn_stringbuf_create_ensure(window->tview_len, iterpool);
buf->len = window->tview_len;
svn_txdelta_apply_instructions(window, window->src_ops ? source : NULL,
@@ -1432,11 +1433,11 @@ get_combined_window(svn_stringbuf_t **co
svn_stringbuf_appendbytes(result, buf->data, buf->len);
source += window->sview_len;
- svn_pool_clear(iter_pool);
+ svn_pool_clear(iterpool);
}
- svn_pool_destroy(iter_pool);
- svn_pool_destroy(sub_pool);
+ svn_pool_destroy(iterpool);
+ svn_pool_destroy(subpool);
/* cache result and return it */
set_cached_window(fs, representation, result);
Modified: subversion/branches/verify-keep-going/tools/dev/svnraisetreeconflict/svnraisetreeconflict.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/tools/dev/svnraisetreeconflict/svnraisetreeconflict.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/tools/dev/svnraisetreeconflict/svnraisetreeconflict.c (original)
+++ subversion/branches/verify-keep-going/tools/dev/svnraisetreeconflict/svnraisetreeconflict.c Wed Nov 27 11:52:35 2013
@@ -49,22 +49,6 @@
#define OPT_VERSION SVN_OPT_FIRST_LONGOPT_ID
-/** A statement macro, similar to @c SVN_INT_ERR, but issues a
- * message saying "svnraisetreeconflict:" instead of "svn:".
- *
- * Evaluate @a expr. If it yields an error, handle that error and
- * return @c EXIT_FAILURE.
- */
-#define SVNRAISETC_INT_ERR(expr) \
- do { \
- svn_error_t *svn_err__temp = (expr); \
- if (svn_err__temp) { \
- svn_handle_error2(svn_err__temp, stderr, FALSE, \
- "svnraisetreeconflict: "); \
- svn_error_clear(svn_err__temp); \
- return EXIT_FAILURE; } \
- } while (0)
-
static svn_error_t *
version(apr_pool_t *pool)
{
@@ -78,7 +62,6 @@ usage(apr_pool_t *pool)
svn_error_clear(svn_cmdline_fprintf
(stderr, pool,
_("Type 'svnraisetreeconflict --help' for usage.\n")));
- exit(1);
}
/***************************************************************************
@@ -295,7 +278,6 @@ help(const apr_getopt_option_t *options,
get_enum_str(node_kind_map, svn_node_file),
get_enum_str(node_kind_map, svn_node_none)
));
- exit(0);
}
@@ -311,14 +293,17 @@ check_lib_versions(void)
};
SVN_VERSION_DEFINE(my_version);
- return svn_ver_check_list(&my_version, checklist);
+ return svn_ver_check_list2(&my_version, checklist, svn_ver_equal);
}
-int
-main(int argc, const char *argv[])
+/*
+ * On success, leave *EXIT_CODE untouched and return SVN_NO_ERROR. On error,
+ * either return an error to be displayed, or set *EXIT_CODE to non-zero and
+ * return SVN_NO_ERROR.
+ */
+static svn_error_t *
+sub_main(int *exit_code, int argc, const char *argv[], apr_pool_t *pool)
{
- apr_pool_t *pool;
- svn_error_t *err;
apr_getopt_t *os;
const apr_getopt_option_t options[] =
{
@@ -329,33 +314,18 @@ main(int argc, const char *argv[])
};
apr_array_header_t *remaining_argv;
- /* Initialize the app. */
- if (svn_cmdline_init("svnraisetreeconflict", stderr) != EXIT_SUCCESS)
- return EXIT_FAILURE;
-
- /* Create our top-level pool. Use a separate mutexless allocator,
- * given this application is single threaded.
- */
- pool = apr_allocator_owner_get(svn_pool_create_allocator(FALSE));
-
/* Check library versions */
- err = check_lib_versions();
- if (err)
- return svn_cmdline_handle_exit_error(err, pool, "svnraisetreeconflict: ");
+ SVN_ERR(check_lib_versions());
#if defined(WIN32) || defined(__CYGWIN__)
/* Set the working copy administrative directory name. */
if (getenv("SVN_ASP_DOT_NET_HACK"))
{
- err = svn_wc_set_adm_dir("_svn", pool);
- if (err)
- return svn_cmdline_handle_exit_error(err, pool, "svnraisetreeconflict: ");
+ SVN_ERR(svn_wc_set_adm_dir("_svn", pool));
}
#endif
- err = svn_cmdline__getopt_init(&os, argc, argv, pool);
- if (err)
- return svn_cmdline_handle_exit_error(err, pool, "svnraisetreeconflict: ");
+ SVN_ERR(svn_cmdline__getopt_init(&os, argc, argv, pool));
os->interleave = 1;
while (1)
@@ -366,19 +336,24 @@ main(int argc, const char *argv[])
if (APR_STATUS_IS_EOF(status))
break;
if (status != APR_SUCCESS)
- usage(pool); /* this will exit() */
+ {
+ usage(pool);
+ *exit_code = EXIT_FAILURE;
+ return SVN_NO_ERROR;
+ }
switch (opt)
{
case 'h':
help(options, pool);
- break;
+ return SVN_NO_ERROR;
case OPT_VERSION:
- SVNRAISETC_INT_ERR(version(pool));
- exit(0);
- break;
+ SVN_ERR(version(pool));
+ return SVN_NO_ERROR;
default:
- usage(pool); /* this will exit() */
+ usage(pool);
+ *exit_code = EXIT_FAILURE;
+ return SVN_NO_ERROR;
}
}
@@ -388,23 +363,53 @@ main(int argc, const char *argv[])
{
const char *s;
- SVNRAISETC_INT_ERR(svn_utf_cstring_to_utf8(&s, os->argv[os->ind++],
- pool));
+ SVN_ERR(svn_utf_cstring_to_utf8(&s, os->argv[os->ind++], pool));
APR_ARRAY_PUSH(remaining_argv, const char *) = s;
}
if (remaining_argv->nelts < 1)
- usage(pool); /* this will exit() */
+ {
+ usage(pool);
+ *exit_code = EXIT_FAILURE;
+ return SVN_NO_ERROR;
+ }
/* Do the main task */
- SVNRAISETC_INT_ERR(raise_tree_conflict(remaining_argv->nelts,
- (const char **)remaining_argv->elts,
- pool));
+ SVN_ERR(raise_tree_conflict(remaining_argv->nelts,
+ (const char **)remaining_argv->elts,
+ pool));
- svn_pool_destroy(pool);
+ return SVN_NO_ERROR;
+}
+
+int
+main(int argc, const char *argv[])
+{
+ apr_pool_t *pool;
+ int exit_code = EXIT_SUCCESS;
+ svn_error_t *err;
- /* Flush stdout to make sure that the user will see any printing errors. */
- SVNRAISETC_INT_ERR(svn_cmdline_fflush(stdout));
+ /* Initialize the app. */
+ if (svn_cmdline_init("svnraisetreeconflict", stderr) != EXIT_SUCCESS)
+ return EXIT_FAILURE;
- return EXIT_SUCCESS;
+ /* Create our top-level pool. Use a separate mutexless allocator,
+ * given this application is single threaded.
+ */
+ pool = apr_allocator_owner_get(svn_pool_create_allocator(FALSE));
+
+ err = sub_main(&exit_code, argc, argv, pool);
+
+ /* Flush stdout and report if it fails. It would be flushed on exit anyway
+ but this makes sure that output is not silently lost if it fails. */
+ err = svn_error_compose_create(err, svn_cmdline_fflush(stdout));
+
+ if (err)
+ {
+ exit_code = EXIT_FAILURE;
+ svn_cmdline_handle_exit_error(err, NULL, "svnraisetreeconflict: ");
+ }
+
+ svn_pool_destroy(pool);
+ return exit_code;
}