You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2012/05/24 10:11:26 UTC
svn commit: r1342167 - in /subversion/trunk: build.conf
subversion/tests/libsvn_wc/wc-queries-test.c
Author: rhuijben
Date: Thu May 24 08:11:26 2012
New Revision: 1342167
URL: http://svn.apache.org/viewvc?rev=1342167&view=rev
Log:
Wc-queries-test: Remove dependency on libsvn_wc itself. Add version check
as a separate test, to provide a bit more information.
* build.conf
(wc-queries-test): Remove dependency.
* subversion/tests/libsvn_wc/wc-queries-test.c
(includes): Add private/svn_dep_compat.h.
(test_sqlite_version): New function.
(test_parsable): Remove printf, that is now part of test_sqlite_version.
Modified:
subversion/trunk/build.conf
subversion/trunk/subversion/tests/libsvn_wc/wc-queries-test.c
Modified: subversion/trunk/build.conf
URL: http://svn.apache.org/viewvc/subversion/trunk/build.conf?rev=1342167&r1=1342166&r2=1342167&view=diff
==============================================================================
--- subversion/trunk/build.conf (original)
+++ subversion/trunk/build.conf Thu May 24 08:11:26 2012
@@ -1014,7 +1014,7 @@ type = exe
path = subversion/tests/libsvn_wc
sources = wc-queries-test.c
install = test
-libs = libsvn_test libsvn_wc libsvn_subr apriconv apr sqlite
+libs = libsvn_test libsvn_subr apriconv apr sqlite
# ----------------------------------------------------------------------------
# These are not unit tests at all, they are small programs that exercise
Modified: subversion/trunk/subversion/tests/libsvn_wc/wc-queries-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/wc-queries-test.c?rev=1342167&r1=1342166&r2=1342167&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/wc-queries-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/wc-queries-test.c Thu May 24 08:11:26 2012
@@ -23,6 +23,7 @@
#include "svn_pools.h"
#include "svn_ctype.h"
+#include "private/svn_dep_compat.h"
#include "svn_private_config.h"
@@ -170,6 +171,40 @@ create_memory_db(sqlite3 **db,
return SVN_NO_ERROR;
}
+/* Verify sqlite3 runtime version */
+static svn_error_t *
+test_sqlite_version(apr_pool_t *scratch_pool)
+{
+ printf("DBG: Using Sqlite %s\n", sqlite3_version);
+
+ if (sqlite3_libversion_number() != SQLITE_VERSION_NUMBER)
+ printf("DBG: Compiled against Sqlite %s", SQLITE_VERSION);
+
+ if (sqlite3_libversion_number() < SQLITE_VERSION_NUMBER)
+ return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
+ "Compiled against Sqlite %s (at runtime we have Sqlite %s)",
+ SQLITE_VERSION, sqlite3_version);
+
+ if (! SQLITE_VERSION_AT_LEAST(3, 7, 9))
+ return svn_error_create(SVN_ERR_TEST_FAILED, NULL,
+ "Sqlite upgrade recommended:\n"
+ "****************************************************************\n"
+ "* Subversion needs at least Sqlite 3.7.9 to work optimal *\n"
+ "* *\n"
+ "* With older versions, at least some queries that are expected *\n"
+ "* to be using an index are not. This makes some operations use *\n"
+ "* every node in the working copy instead of just one. *\n"
+ "* *\n"
+ "* While Subversion works correctly in this case, you may see *\n"
+ "* slowdowns of WELL MORE THAN 1000* in some cases! *\n"
+ "* *\n"
+ "* *\n"
+ "* SQLITE UPGRADE RECOMMENDED *\n"
+ "****************************************************************\n");
+
+ return SVN_NO_ERROR;
+}
+
/* Parse all normal queries */
static svn_error_t *
test_parsable(apr_pool_t *scratch_pool)
@@ -177,8 +212,6 @@ test_parsable(apr_pool_t *scratch_pool)
sqlite3 *sdb;
int i;
- printf("DBG: Testing on Sqlite %s\n", sqlite3_version);
-
SVN_ERR(create_memory_db(&sdb, scratch_pool));
for (i=0; i < STMT_SCHEMA_FIRST; i++)
@@ -658,6 +691,8 @@ test_query_expectations(apr_pool_t *scra
struct svn_test_descriptor_t test_funcs[] =
{
SVN_TEST_NULL,
+ SVN_TEST_PASS2(test_sqlite_version,
+ "sqlite up-to-date"),
SVN_TEST_PASS2(test_parsable,
"queries are parsable"),
SVN_TEST_PASS2(test_query_expectations,