[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] Fix javahl tests when builddir!=srcdir

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Wed, 02 Dec 2009 17:10:59 +0000

Philip Martin <philip.martin_at_wandisco.com> writes:

> There was 1 error:
> 1) testLoadRepo(org.tigris.subversion.javahl.SVNAdminTests)java.io.FileNotFoundException: /home/pm/sw/subversion/obj/subversion/bindings/javahl/tests/data/issue2979.dump (No such file or directory)

I'm not really a Java person. Any objections to this:

Make the javahl test for issue 2979 work when builddir!=srcdir.

* Makefile.in:
  Add javahl_test_srcdir and pass when invoking the tests.

[in subversion/bindings/javahl]

* tests/org/tigris/subversion/javahl/SVNAdminTests.java
  (testLoadRepo): Use srcdir.
  
Index: Makefile.in
===================================================================
--- Makefile.in (revision 886136)
+++ Makefile.in (working copy)
@@ -94,6 +94,7 @@
 javahl_javahdir = @libdir@/svn-javahl/include
 javahl_libdir = @libdir@
 javahl_test_rootdir=$(abs_builddir)/subversion/bindings/javahl/test-work
+javahl_test_srcdir=$(abs_srcdir)/subversion/bindings/javahl
 
 MSGFMT = @MSGFMT@
 MSGFMTFLAGS = @MSGFMTFLAGS@
@@ -431,7 +432,7 @@
 
 check-javahl: javahl
         @FIX_JAVAHL_LIB@
- $(JAVA) "-Dtest.rootdir=$(javahl_test_rootdir)" "-Dtest.rooturl=$(BASE_URL)" "-Dtest.fstype=$(FS_TYPE)" -Djava.library.path=@JAVAHL_OBJDIR@:$(libdir) -classpath $(javahl_tests_PATH):$(javahl_tests_CLASSPATH) "-Dtest.tests=$(JAVAHL_TESTS)" org.tigris.subversion.javahl.RunTests
+ $(JAVA) "-Dtest.rootdir=$(javahl_test_rootdir)" "-Dtest.srcdir=$(javahl_test_srcdir)" "-Dtest.rooturl=$(BASE_URL)" "-Dtest.fstype=$(FS_TYPE)" -Djava.library.path=@JAVAHL_OBJDIR@:$(libdir) -classpath $(javahl_tests_PATH):$(javahl_tests_CLASSPATH) "-Dtest.tests=$(JAVAHL_TESTS)" org.tigris.subversion.javahl.RunTests
 
 # "make check CLEANUP=true" will clean up directories for successful tests.
 # "make check TESTS=subversion/tests/cmdline/basic_tests.py"
Index: subversion/bindings/javahl/tests/org/tigris/subversion/javahl/SVNAdminTests.java
===================================================================
--- subversion/bindings/javahl/tests/org/tigris/subversion/javahl/SVNAdminTests.java (revision 886136)
+++ subversion/bindings/javahl/tests/org/tigris/subversion/javahl/SVNAdminTests.java (working copy)
@@ -102,10 +102,9 @@
                 0L, infoHolder[0].getLastChangedRev());
 
         // locate dump file in test environment
- String testRoot = System.getProperty("test.rootdir",
- "subversion/bindings/javahl/test-work");
- File javahlRoot = new File(testRoot).getParentFile();
- File dump = new File(javahlRoot, "tests/data/issue2979.dump");
+ String testSrcdir = System.getProperty("test.srcdir",
+ "subversion/bindings/javahl");
+ File dump = new File(testSrcdir, "tests/data/issue2979.dump");
         InputInterface input = new FileInputer(dump);
         OutputInterface loadLog = new IgnoreOutputer();
         admin.load(thisTest.getRepositoryPath(),

-- 
Philip
Received on 2009-12-02 18:11:32 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.