Checkout Tools
  • last updated 1 hour 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.
Non-logic changes only.

* subversion/tests/libsvn_subr/crypto-test.c

(): Clearly separate helper and test funcs.

(test_passphrase_check): Move (and expand) a comment to the

appropriate location.

Implement the bit of the MasterPassphrase design plan which involves

generating and storing validation bits for master passphrases.

* subversion/libsvn_subr/crypto.h,

* subversion/libsvn_subr/crypto.c

(svn_crypto__generate_secret_checktext, svn_crypto__verify_secret):

New functions. (These are most copy-and-pastes of other functions.

I'll made a second pass at abstracting out the common bits out soon.)

* subversion/tests/libsvn_subr/crypto-test.c

(test_passphrase_check): New test function.

(test_funcs): Add reference to new test.

  1. … 2 more files in changeset.
* subversion/tests/libsvn_subr/crypto-test.c

(test_encrypt_decrypt_password): Lose #define'd code blocks, and use

svn_crypto__is_available() for condition test skipping.

Introduce a single #define to govern the availability of Subversion's

cryptographic support (instead of relying on multiple APR/APRUtil

defines), and rework the use thereof such that exported symbols are

always available.

* subversion/libsvn_subr/crypto.h

(): Remove conditional wrapping around function and structure

definitions. These things will always be available, just perhaps

non-functional where the underlying support is lacking.

(SVN_HAVE_CRYPTO): New #define, defined only when both

APU_HAVE_CRYPTO and APR_HAS_RANDOM are defined and true.

* subversion/libsvn_subr/crypto.c

Rejigger preprocessor conditionals such that symbols exposed outside

this source file are always available (regardless of preprocessor

macro evaluations). Use SVN_HAVE_CRYPTO rather than APU_HAVE_CRYPTO

throughout.

* subversion/tests/libsvn_subr/crypto-test.c

Lose unnecessary preprocessor conditions, and update necessary ones

to use SVN_HAVE_CRYPTO rather than APU_HAVE_CRYPTO.

Suggested by: gstein

  1. … 2 more files in changeset.
Revert r1308543 as it broke the !APU_HAVE_CRYPTO build. Not sure of the

long-term fix yet (to enable skipping/running the test when APU_HAVE_CRYPTO

is/isn't defined).

Improve upon r1308503.

* subversion/tests/libsvn_subr/crypto-test.c

(test_encrypt_decrypt_password): Use SVN_TEST_SKIP2().

[ Reverted in r1308572. ]

Skip a test by skipping it, rather than by not-compiling it.

* subversion/tests/libsvn_subr/crypto-test.c

(test_encrypt_decrypt_password): Rejigger ifdef's to make the test

run and skip itself when !APU_HAVE_CRYPTO.

Fix autogen warning.

* subversion/tests/libsvn_subr/crypto-test.c:

svn_pools.h is not a system header (despite our hubris to the contrary).

Finish up the initial password encryption and decryption routines, and

stare in amazement as the tests now pass. For me. On my box.

* subversion/libsvn_subr/crypto.c

(svn_crypto__encrypt_password): Per our plan, prepend the prefix to

the password and pad up to the specified block size before

encrypting. Lose a seemingly unfounded assertion (that the size

of the input will match that of the output).

(svn_crypto__decrypt_password): Implement this function.

* subversion/tests/libsvn_subr/crypto-test.c

(encrypt_decrypt): New function, abstracted out of ...

(test_encrypt_decrypt_password): ...this, which now calls the helper

function in a loop so different password lengths can be tested.

(test_funcs): Now expect test_encrypt_decrypt_password() to pass.

  1. … 1 more file in changeset.
* subversion/tests/libsvn_subr/crypto-test.c

Use a more appropriate #if statement.

* subversion/tests/libsvn_subr/crypto-test.c

Abuse my commit privileges to permanently record my self-irritation

in a fiery testament to my children and my children's children that

Old Man Pilato was not just flawed, but outright busted.

or...

Make a silly commit as a detour towards some eventual manifestation

of correctness.

Your call.

* subversion/tests/libsvn_subr/crypto-test.c

Use "#if APU_HAVE_CRYPTO" instead of "#ifdef APU_HAVE_CRYPTO".

* subversion/tests/libsvn_subr/crypto-test.c

(test_encrypt_decrypt_password): Was test_encrypt_decrypt(); now has

actual content.

(test_funcs): Update reference to the sole test, and mark it XFAIL

for now.

For issue #4145 ("Master passphrase and encrypted credentials cache"),

begin adding support for some cryptographic routines in Subversion.

NOTE: The code thus far is no where near complete, but I want to get

this into version control sooner rather than later.

* subversion/libsvn_subr/crypto.h,

* subversion/libsvn_subr/crypto.c

New files, with incomplete and as-yet-unused functions in them.

* subversion/svn/main.c

(crypto_init): New function.

(main): Call crypto_init().

* build.conf

(crypto-test): New section (for a new test binary, also added to

other relevant bits of this configuration file.

* subversion/tests/libsvn_subr

Add 'crypto-test' to svn:ignores.

* subversion/tests/libsvn_subr/crypto-test.c

New skeletal test file.

[reverted main.c changes in r1307903]

  1. … 5 more files in changeset.