Checkout
Branko ─îibej
committed
on 06 Mar 14
Make the C tests work with the --enable-optimize configure option.

Because the main() function used to be defined in libsvn_test,
the -flto… Show more
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.

Show less