Index: test/Makefile.in
===================================================================
--- test/Makefile.in	(revisjon 472307)
+++ test/Makefile.in	(arbeidskopi)
@@ -39,6 +39,8 @@
 INCDIR=../include
 INCLUDES=-I$(INCDIR) -I$(srcdir)/../include
 
+DEFS += -DAPR_SRCDIR='"$(srcdir)"'
+
 # link programs using -no-install to get real executables not
 # libtool wrapper scripts which link an executable when first run.
 LINK_PROG = $(LIBTOOL) $(LTFLAGS) --mode=link $(LT_LDFLAGS) $(COMPILE) @LT_NO_INSTALL@ $(ALL_LDFLAGS) -o $@
Index: test/testfileinfo.c
===================================================================
--- test/testfileinfo.c	(revisjon 472307)
+++ test/testfileinfo.c	(arbeidskopi)
@@ -23,7 +23,7 @@
 #include "apr_lib.h"
 #include "testutil.h"
 
-#define FILENAME "data/file_datafile.txt"
+#define FILENAME APR_SRCDIR "/data/file_datafile.txt"
 #define NEWFILENAME "data/new_datafile.txt"
 #define NEWFILEDATA "This is new text in a new file."
 
Index: test/testfilecopy.c
===================================================================
--- test/testfilecopy.c	(revisjon 472307)
+++ test/testfilecopy.c	(arbeidskopi)
@@ -62,8 +62,8 @@
     /* make absolutely sure that the dest file doesn't exist. */
     apr_file_remove("data/file_copy.txt", p);
     
-    copy_helper(tc, "data/file_datafile.txt", "data/file_copy.txt", 
-                APR_FILE_SOURCE_PERMS, 0, p);
+    copy_helper(tc, APR_SRCDIR "/data/file_datafile.txt", 
+		"data/file_copy.txt", APR_FILE_SOURCE_PERMS, 0, p);
     rv = apr_file_remove("data/file_copy.txt", p);
     APR_ASSERT_SUCCESS(tc, "Couldn't remove copy file", rv);
 }
@@ -79,11 +79,11 @@
      * one file, then I copy another.  If the second copy succeeds, then
      * this works.
      */
-    copy_helper(tc, "data/file_datafile.txt", "data/file_copy.txt", 
-                APR_FILE_SOURCE_PERMS, 0, p);
+    copy_helper(tc, APR_SRCDIR "/data/file_datafile.txt", 
+		"data/file_copy.txt", APR_FPROT_OS_DEFAULT, 0, p);
     
-    copy_helper(tc, "data/mmap_datafile.txt", "data/file_copy.txt", 
-                APR_FILE_SOURCE_PERMS, 0, p);
+    copy_helper(tc, APR_SRCDIR "/data/mmap_datafile.txt", 
+		"data/file_copy.txt", APR_FPROT_OS_DEFAULT, 0, p);
   
     rv = apr_file_remove("data/file_copy.txt", p);
     APR_ASSERT_SUCCESS(tc, "Couldn't remove copy file", rv);
@@ -96,8 +96,8 @@
     /* make absolutely sure that the dest file doesn't exist. */
     apr_file_remove("data/file_copy.txt", p);
 
-    copy_helper(tc, "data/file_datafile.txt", "data/file_copy.txt", 
-                APR_FILE_SOURCE_PERMS, 0, p);
+    copy_helper(tc, APR_SRCDIR "/data/file_datafile.txt", 
+		"data/file_copy.txt", APR_FILE_SOURCE_PERMS, 0, p);
     rv = apr_file_remove("data/file_copy.txt", p);
     APR_ASSERT_SUCCESS(tc, "Couldn't remove copy file", rv);
 }
@@ -113,11 +113,11 @@
      * one file, then I copy another.  If the second copy succeeds, then
      * this works.
      */
-    copy_helper(tc, "data/file_datafile.txt", "data/file_copy.txt", 
-                APR_FILE_SOURCE_PERMS, 0, p);
+    copy_helper(tc, APR_SRCDIR "/data/file_datafile.txt", 
+		"data/file_copy.txt", APR_FPROT_OS_DEFAULT, 0, p);
     
-    copy_helper(tc, "data/mmap_datafile.txt", "data/file_copy.txt", 
-                APR_FILE_SOURCE_PERMS, 1, p);
+    copy_helper(tc, APR_SRCDIR "/data/mmap_datafile.txt", 
+		"data/file_copy.txt", APR_FPROT_OS_DEFAULT, 1, p);
   
     rv = apr_file_remove("data/file_copy.txt", p);
     APR_ASSERT_SUCCESS(tc, "Couldn't remove copy file", rv);
Index: test/testfile.c
===================================================================
--- test/testfile.c	(revisjon 472307)
+++ test/testfile.c	(arbeidskopi)
@@ -863,19 +863,18 @@
 {
     suite = ADD_SUITE(suite)
 
+    abts_run_test(suite, test_open_write, NULL);
+    abts_run_test(suite, test_open_writecreate, NULL);
     abts_run_test(suite, test_open_noreadwrite, NULL);
     abts_run_test(suite, test_open_excl, NULL);
     abts_run_test(suite, test_open_read, NULL);
     abts_run_test(suite, test_open_readwrite, NULL);
+    abts_run_test(suite, test_write, NULL);
     abts_run_test(suite, test_read, NULL); 
     abts_run_test(suite, test_readzero, NULL); 
     abts_run_test(suite, test_seek, NULL);
     abts_run_test(suite, test_filename, NULL);
     abts_run_test(suite, test_fileclose, NULL);
-    abts_run_test(suite, test_file_remove, NULL);
-    abts_run_test(suite, test_open_write, NULL);
-    abts_run_test(suite, test_open_writecreate, NULL);
-    abts_run_test(suite, test_write, NULL);
     abts_run_test(suite, test_userdata_set, NULL);
     abts_run_test(suite, test_userdata_get, NULL);
     abts_run_test(suite, test_userdata_getnokey, NULL);
@@ -893,6 +892,7 @@
     abts_run_test(suite, test_fail_read_flush, NULL);
     abts_run_test(suite, test_buffer_set_get, NULL);
     abts_run_test(suite, test_xthread, NULL);
+    abts_run_test(suite, test_file_remove, NULL);
 
     return suite;
 }
Index: test/testfnmatch.c
===================================================================
--- test/testfnmatch.c	(revisjon 472307)
+++ test/testfnmatch.c	(arbeidskopi)
@@ -23,7 +23,7 @@
  * .txt extension in the data directory at the time testfnmatch
  * happens to be run (!?!). */
 
-#define NUM_FILES (5)
+#define NUM_FILES (2)
 
 static void test_glob(abts_case *tc, void *data)
 {
@@ -32,8 +32,7 @@
     apr_array_header_t *result;
     
     APR_ASSERT_SUCCESS(tc, "glob match against data/*.txt",
-                       apr_match_glob("data\\*.txt", &result, p));
-
+                       apr_match_glob(APR_SRCDIR "/data/*.txt", &result, p));
     ABTS_INT_EQUAL(tc, NUM_FILES, result->nelts);
 
     list = (char **)result->elts;
@@ -48,7 +47,11 @@
     int i;
     char **list;
     apr_array_header_t *result;
-    apr_filepath_set("data", p);
+    char *cwd;
+
+    apr_filepath_get(&cwd, 0, p);
+
+    apr_filepath_set(APR_SRCDIR "/data", p);
     
     APR_ASSERT_SUCCESS(tc, "glob match against *.txt with data as current",
                        apr_match_glob("*.txt", &result, p));
@@ -61,7 +64,7 @@
         char *dot = strrchr(list[i], '.');
         ABTS_STR_EQUAL(tc, dot, ".txt");
     }
-    apr_filepath_set("..", p);
+    apr_filepath_set(cwd, p);
 }
 
 abts_suite *testfnmatch(abts_suite *suite)
Index: test/testmmap.c
===================================================================
--- test/testmmap.c	(revisjon 472307)
+++ test/testmmap.c	(arbeidskopi)
@@ -57,10 +57,27 @@
     ABTS_TRUE(tc, file1[strlen(file1) - 1] != '/');
 
     oldfileptr = file1;
-    file1 = apr_pstrcat(p, file1,"/data/mmap_datafile.txt" ,NULL);
+    file1 = apr_pstrcat(p, file1, "/data/mmap_datafile.txt" ,NULL);
     ABTS_TRUE(tc, oldfileptr != file1);
 }
 
+static void create_file(abts_case *tc, void *data)
+{
+    apr_status_t rv;
+    apr_size_t bytes = strlen(TEST_STRING);
+
+    rv = apr_file_open(&thefile, file1, 
+		  APR_WRITE | APR_CREATE, 
+		  APR_UREAD | APR_UWRITE | APR_GREAD, p);
+    ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
+
+    rv = apr_file_write(thefile, TEST_STRING, &bytes);
+    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+
+    rv = apr_file_close(thefile);
+    ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
+}    
+
 static void test_file_close(abts_case *tc, void *data)
 {
     apr_status_t rv;
@@ -138,6 +155,7 @@
     fsize = strlen(TEST_STRING);
 
     abts_run_test(suite, create_filename, NULL);
+    abts_run_test(suite, create_file, NULL);
     abts_run_test(suite, test_file_open, NULL);
     abts_run_test(suite, test_get_filesize, NULL);
     abts_run_test(suite, test_mmap_create, NULL);
Index: configure.in
===================================================================
--- configure.in	(revisjon 472307)
+++ configure.in	(arbeidskopi)
@@ -2164,6 +2164,7 @@
 
 if test -d $srcdir/test; then
    AC_CONFIG_FILES([test/Makefile test/internal/Makefile])
+   $MKDIR $apr_builddir
 fi
 
 dir=include/arch/unix
