Checkout Tools
  • last updated 3 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Make the C tests work with the --enable-optimize configure option.

Because the main() function used to be defined in libsvn_test,

the -flto option (which performs rather aggressive link-time

optimizations) would cause the linker to remove all "unreferenced"

static functions ... which includes all the actual tests.

Which this change, main() is now defined in each test driver.

* subversion/tests/svn_test.h

(test_funcs, svn_test_max_threads): Remove external declarations.

(svn_test_main): New prototype for the (existing-but-renamed) test driver.

(SVN_TEST_MAIN): Bolierplate macro that generates a main() implementation.

* subversion/tests/svn_test_main.c

(svn_test_main): Renamed from 'main', and takes two extra parameters,

'max_threads' and 'test_funcs'. Propagates test_funcs to get_array_size,

do_test_num and do_tests_concurrently.

(get_array_size, do_test_num,

test_params_t, test_thread, do_tests_concurrently): Require a test_funcs

parameter. All uses updated.

* subversion/tests/libsvn_client/client-test.c,

subversion/tests/libsvn_client/mtcc-test.c,

subversion/tests/libsvn_delta/random-test.c,

subversion/tests/libsvn_delta/window-test.c,

subversion/tests/libsvn_diff/diff-diff3-test.c,

subversion/tests/libsvn_diff/parse-diff-test.c,

subversion/tests/libsvn_fs/fs-test.c,

subversion/tests/libsvn_fs/locks-test.c,

subversion/tests/libsvn_fs_base/

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_x/fs-x-pack-test.c,

subversion/tests/libsvn_fs_x/string-table-test.c,

subversion/tests/libsvn_ra/ra-test.c,

subversion/tests/libsvn_ra_local/ra-local-test.c,

subversion/tests/libsvn_repos/repos-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/io-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/translate-test.c,

subversion/tests/libsvn_subr/utf-test.c,

subversion/tests/libsvn_wc/conflict-data-test.c,

subversion/tests/libsvn_wc/db-test.c,

subversion/tests/libsvn_wc/entries-compat.c,

subversion/tests/libsvn_wc/op-depth-test.c,

subversion/tests/libsvn_wc/pristine-store-test.c,

subversion/tests/libsvn_wc/wc-queries-test.c,

subversion/tests/libsvn_wc/wc-test.c:

(max_threads): Renamed from svn_test_max_threads and made static.

(test_funcs): Made static.

(SVN_TEST_MAIN): Expanded boilerplate main() function.

  1. … 54 more files in changeset.
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".

  1. … 54 more files in changeset.
When handing out node contents, the delta streams don't need

to calculate MD5 checksums as the result will not be used and the

check would be redundant even if it were made.

Thus, rev the svn_txdelta API to calculate the checksum only

upon specific request and update all callers to use the new API.

* subversion/include/svn_delta.h

(svn_txdelta2): declare new, extended API

(svn_txdelta): deprecate the old one

* subversion/libsvn_delta/text_delta.c

(txdelta_baton): extend docstring

(txdelta_md5_digest): handle the no-checksum-requested case

(svn_txdelta2): implement

(svn_txdelta): re-implement in terms of svn_txdelta2

* subversion/libsvn_fs_fs/fs_fs.c

(svn_fs_fs__get_file_delta_stream): eliminate duplicate MD5 calculation

* subversion/libsvn_ra/compat.c

(svn_ra__file_revs_from_log): switch to reved API, MD5 not used / required

* subversion/tests/libsvn_delta/random-test.c

(random_test): ditto

* subversion/tests/libsvn_delta/svndiff-test.c

(main): same here

* subversion/tests/libsvn_delta/vdelta-test.c

(do_one_diff, main): and here

* subversion/tests/libsvn_delta/window-test.c

(stream_window_test): switch to reved API, request MD5

  1. … 7 more files in changeset.
Add and use svn_checksum__from_digest_md5().

This replaces svn_checksum__from_digest() taking a svn_checksum_md5

argument with a new svn_checksum_t constructor function.

* subversion/include/private/svn_subr_private.h,

* subversion/libsvn_subr/checksum.c

(svn_checksum__from_digest_md5):

New private function.

* subversion/libsvn_client/commit.c,

* subversion/libsvn_client/export.c,

* subversion/libsvn_client/repos_diff.c,

* subversion/libsvn_fs_base/util/fs_skels.c,

* subversion/libsvn_subr/base64.c,

* subversion/libsvn_wc/deprecated.c,

* subversion/libsvn_wc/diff_editor.c,

* subversion/libsvn_wc/update_editor.c,

* subversion/tests/libsvn_delta/window-test.c

(various):

Replace all calls to

svn_checksum__from_digest(digest, svn_checksum_md5, pool);

with

svn_checksum__from_digest_md5(digest, pool);

  1. … 10 more files in changeset.
Move svn_checksum__from_digest() declaration to svn_subr_private.h.

Suggested by: gstein

* subversion/include/svn_checksum.h

(svn_checksum__from_digest):

Move from here...

* subversion/include/private/svn_subr_private.h

(svn_checksum__from_digest):

...to here.

* subversion/libsvn_client/commit.c,

* subversion/libsvn_client/export.c,

* subversion/libsvn_client/repos_diff.c,

* subversion/libsvn_subr/base64.c,

* subversion/libsvn_subr/checksum.c,

* subversion/libsvn_wc/deprecated.c,

* subversion/libsvn_wc/diff_editor.c,

* subversion/libsvn_wc/update_editor.c,

* subversion/tests/libsvn_delta/window-test.c:

Include "private/svn_subr_private.h" to declare

svn_checksum__from_digest().

  1. … 10 more files in changeset.
Test out my new and fancy ASF commit priviledges by changing the copyright

wording in our license headers to reflect ownership by the ASF.

* NOTICE:

Change terminology to ASF, and update a link.

* subversion/libsvn_subr/opt.c

(svn_opt__print_version_info): Note that the product as a whole is

copyrighted by the ASF, and update the project website.

* everywhere:

Change license text to reflect ASF ownership.

  1. … 891 more files in changeset.
* subversion/bindings/javahl/native/SVNAdmin.cpp,

* subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c,

* subversion/libsvn_client/mergeinfo.c,

* subversion/libsvn_client/status.c,

* subversion/libsvn_subr/dirent_uri.c,

* subversion/libsvn_wc/ambient_depth_filter_editor.c,

* subversion/libsvn_wc/context.c,

* subversion/tests/libsvn_delta/window-test.c:

Remove an extra semicolon.

Patch by: Kannan R <kannanr@collab.net>

me

  1. … 7 more files in changeset.
Relicense Subversion under the Apache License, Version 2.0.

* NOTICE: New.

* LICENSE: New.

* COPYING,

subversion/LICENSE: Remove.

* subversion/libsvn_subr/opt.c

(svn_opt__print_version_info): Note that the product as a whole is

copyrighted by the SVN Corp, and that it contains contributions from

many people, as referenced in NOTICE.

* subversion/bindings/swig/python/LICENSE_FOR_PYTHON_BINDINGS:

Relicense the SVN parts under Apache 2.0.

* everywhere:

Change copyright notices in file headers to reflect the Apache 2.0 license.

  1. … 882 more files in changeset.
Replace deprecated test func macros in the C tests. This eliminates the need

to do the following dance in every test function:

*msg = "foo";

if (msg_only)

return SVN_NO_ERROR;

This does not remove the deprecated symbols from svn_test.h; I plan to do it

in a follow up commit.

[ in subversion/tests ]

* libsvn_client/client-test.c,

libsvn_delta/random-test.c,

libsvn_delta/range-index-test.h,

libsvn_delta/window-test.c,

libsvn_diff/diff-diff3-test.c,

libsvn_diff/parse-diff-test.c,

libsvn_fs/fs-test.c,

libsvn_fs/locks-test.c,

libsvn_fs_base/changes-test.c,

libsvn_fs_base/fs-base-test.c,

libsvn_fs_base/key-test.c,

libsvn_fs_base/strings-reps-test.c,

libsvn_fs_fs/fs-pack-test.c,

libsvn_ra_local/ra-local-test.c,

libsvn_repos/repos-test.c,

libsvn_subr/auth-test.c,

libsvn_subr/cache-test.c,

libsvn_subr/checksum-test.c,

libsvn_subr/compat-test.c,

libsvn_subr/config-test.c,

libsvn_subr/dirent_uri-test.c,

libsvn_subr/error-test.c,

libsvn_subr/hashdump-test.c,

libsvn_subr/mergeinfo-test.c,

libsvn_subr/opt-test.c,

libsvn_subr/path-test.c,

libsvn_subr/revision-test.c,

libsvn_subr/skel-test.c,

libsvn_subr/stream-test.c,

libsvn_subr/string-test.c,

libsvn_subr/target-test.c,

libsvn_subr/time-test.c,

libsvn_subr/translate-test.c,

libsvn_subr/utf-test.c,

libsvn_wc/tree-conflict-data-test.c:

Do the above described transformation.

  1. … 34 more files in changeset.
Simplify slightly by using svn_checksum__from_digest().

* subversion/libsvn_subr/checksum.c

(svn_checksum_empty_checksum): Simplify, thus avoiding casting away "const".

* subversion/libsvn_subr/svn_base64.c

(svn_base64_from_md5): Simplify.

* subversion/tests/libsvn_delta/window-test.c

(stream_window_test): Simplify.

  1. … 2 more files in changeset.
More svn:eol-style fun.

* subversion/libsvn_subr/sqlite.c,

subversion/libsvn_subr/sqlite3_c.h,

subversion/libsvn_auth_gnome_keyring/version.c,

subversion/bindings/ctypes-python/setup.py,

subversion/bindings/ctypes-python/csvn/repos.py,

subversion/bindings/ctypes-python/csvn/ext/__init__.py,

subversion/bindings/ctypes-python/csvn/ext/callback_receiver.py,

subversion/bindings/ctypes-python/csvn/ext/listmixin.py,

subversion/bindings/ctypes-python/csvn/txn.py,

subversion/bindings/ctypes-python/csvn/__init__.py,

subversion/bindings/ctypes-python/csvn/core/__init__.py,

subversion/bindings/ctypes-python/csvn/auth.py,

subversion/bindings/ctypes-python/examples/example.py,

subversion/bindings/ctypes-python/examples/trunkify.py,

subversion/bindings/ctypes-python/examples/log.py,

subversion/bindings/ctypes-python/examples/mucc.py,

subversion/bindings/swig/ruby/svn/synchronizer.rb,

subversion/bindings/swig/ruby/svn/commit-mailer.rb,

subversion/bindings/swig/svn_diff.i,

subversion/tests/libsvn_wc/tree-conflict-data-test.c,

subversion/tests/libsvn_subr/auth-test.c,

subversion/tests/libsvn_delta/window-test.c,

subversion/tests/cmdline/resolved_tests.py,

subversion/svn/tree-conflicts.c,

subversion/svn/tree-conflicts.h,

subversion/include/private/svn_sqlite.h,

subversion/libsvn_wc/crop.c,

subversion/libsvn_wc/tree_conflicts.c,

subversion/libsvn_wc/tree_conflicts.h,

subversion/libsvn_wc/wc_db.c,

subversion/libsvn_auth_kwallet/version.c:

All of these textual types should have the svn:eol-style properties set to

'native', so do it.

  1. … 30 more files in changeset.
Revert r35103 because making the svn_checksum_t type opaque was unnecessary

obstruction, as suggested by gstein in the email thread

<http://svn.haxx.se/dev/archive-2009-01/0226.shtml>.

The log message of r35103 was:

In the "checksums" API, make the svn_checksum_t type opaque to help make

future extensions easier, and introduce accessor functions [...]

Make the constructor "svn_checksum__from_digest()" public [...]

  1. … 23 more files in changeset.
In the "checksums" API, make the svn_checksum_t type opaque to help make

future extensions easier, and introduce accessor functions:

svn_checksum_get_kind()

svn_checksum_get_size() (replacing svn_checksum_size())

svn_checksum_get_digest()

to replace direct access.

Make the constructor "svn_checksum__from_digest()" public as well by

renaming it to "svn_checksum_from_digest()", because it is the logical

complement of the "get" accessors.

* subversion/include/svn_checksum.h,

subversion/libsvn_subr/checksum.c

(svn_checksum_t): Move the definition from the header to the source file,

leaving just a declaration in the header. Make the "digest" field

non-const and remove all the type casts that were used to write to it

throughout the rest of this source file.

(svn_checksum_size): Rename to ...

(svn_checksum_get_size): ... this and add "const" on the input parameter.

(svn _checksum_get_kind, svn_checksum_get_digest): New functions.

(svn_checksum__from_digest): Rename to ...

(svn_checksum_from_digest): ... this.

* subversion/libsvn_client/commit.c,

subversion/libsvn_client/commit_util.c,

subversion/libsvn_client/export.c,

subversion/libsvn_delta/text_delta.c,

subversion/libsvn_fs_base/bdb/checksum-reps-table.c,

subversion/libsvn_fs_base/bdb/dbt.c,

subversion/libsvn_fs_base/dag.c,

subversion/libsvn_fs_base/reps-strings.c,

subversion/libsvn_fs_base/tree.c,

subversion/libsvn_fs_base/util/fs_skels.c,

subversion/libsvn_fs_fs/dag.c,

subversion/libsvn_fs_fs/fs_fs.c,

subversion/libsvn_fs/fs-loader.c,

subversion/libsvn_fs_fs/rep-cache.c,

subversion/libsvn_fs_fs/tree.c,

subversion/libsvn_subr/io.c,

subversion/libsvn_subr/stream.c,

subversion/libsvn_wc/adm_crawler.c,

subversion/libsvn_wc/adm_ops.c,

subversion/libsvn_wc/update_editor.c

Adjust for the renaming of svn_checksum__from_digest().

Use the accessor functions instead of direct access.

* subversion/libsvn_subr/svn_base64.c

(svn_base64_from_checksum):

Use the accessor functions instead of direct access.

(svn_base64_from_md5): Use svn_checksum__from_digest to simplify and avoid

direct write access to a checksum.

* subversion/tests/libsvn_delta/window-test.c

(stream_window_test): Use svn_checksum_from_digest() to simplify and avoid

direct write access to a checksum.

  1. … 23 more files in changeset.
Fix up the new window-test.

* subversion/tests/libsvn_delta/window-test.c:

(stream_window_test): replicate the first 109 bytes only 999 times, not

1000 (to avoid a stack smash). add an svn_checksum_match() test to

actually fail in case of a problem. add an SVN_ERR just in case a

cosmic ray causes svn_checksum() to fail.

Add a new test, based on an email from Joe Swatosh <joe.swatosh@gmail.com>

In the Ruby bindings, a digest was coming out wrong, so we now have a test

to ensure that a txdelta stream is producing the target digest properly.

TODO: test some invariants of the windows that are generated.

* build.conf:

(window-test): new test target

* subversion/tests/libsvn_delta:

(svn:ignore): ignore the new window-test executable

* subversion/tests/libsvn_delta/window-test.c: new file

  1. … 2 more files in changeset.