test/wsgidav.c

branch
dav-2
changeset 903
457faa53fd7e
parent 902
06fa328989ee
--- a/test/wsgidav.c	Sat Jan 24 13:56:19 2026 +0100
+++ b/test/wsgidav.c	Sun Jan 25 17:53:31 2026 +0100
@@ -243,7 +243,7 @@
     }
     
     // delete previous testrepo directory
-    char *args1[] = { "rm", "-Rf", "testrepo", NULL };
+    char *args1[] = { "rm", "-Rf", "testrepo", "wsgidav.yaml", NULL };
     Process p_rm = process_spawn("/bin/rm", args1);
     cxmutstr err = process_err_read_string(&p_rm);
     if(process_close(&p_rm) != 0) {
@@ -264,9 +264,20 @@
     }
     free(err.ptr);
     
+    // copy the config file to the build directory
+    char *args3[] = { "cp", "../test/wsgidav/wsgidav.yaml", "wsgidav.yaml", NULL };
+    Process p_cp2 = process_spawn("/bin/cp", args3);
+    err = process_err_read_string(&p_cp2);
+    if(process_close(&p_cp2) != 0) {
+        cxmutstr s = cx_strtrim(err);
+        fprintf(stderr, "cp failed: %.*s\n", (int)s.length, s.ptr);
+        return 1;
+    }
+    free(err.ptr);
+    
     // start wsgidav
-    char *args3[] = { "wsgidav", "-c", "../test/wsgidav/wsgidav.yaml", NULL };
-    wsgidav_process = process_spawn(wsgidav_exec_path, args3);
+    char *args4[] = { "wsgidav", "-c", "wsgidav.yaml", NULL };
+    wsgidav_process = process_spawn(wsgidav_exec_path, args4);
     
     // TODO: parse log or try to connect to localhost
     sleep(1);

mercurial