[winetest] Pass correct working directory to the tests

Paul Vriens paul.vriens.wine at gmail.com
Thu Jan 4 14:35:23 CST 2007


Hi,

while looking at the kernel32-process tests I found that although the winetest
gui shows a working directory, this was not passed to the tests.

This fixes at least some of the process tests and at first glance doesn't have
a negative result on the other tests.

Changelog
  Pass correct working directory to the tests

Cheers,

Paul.
---
 programs/winetest/main.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/programs/winetest/main.c b/programs/winetest/main.c
index 62dda0d..c2f6881 100644
--- a/programs/winetest/main.c
+++ b/programs/winetest/main.c
@@ -266,7 +266,7 @@ extract_test (struct wine_test *test, const char *dir, LPTSTR res_name)
    value of WaitForSingleObject.
  */
 static int
-run_ex (char *cmd, const char *out, DWORD ms)
+run_ex (char *cmd, const char *out, const char *tempdir, DWORD ms)
 {
     STARTUPINFO si;
     PROCESS_INFORMATION pi;
@@ -289,7 +289,7 @@ run_ex (char *cmd, const char *out, DWORD ms)
     }
 
     if (!CreateProcessA (NULL, cmd, NULL, NULL, TRUE, 0,
-                         NULL, NULL, &si, &pi)) {
+                         NULL, tempdir, &si, &pi)) {
         status = -2;
     } else {
         CloseHandle (pi.hThread);
@@ -358,7 +358,7 @@ get_subtests (const char *tempdir, struct wine_test *test, LPTSTR res_name)
 
     extract_test (test, tempdir, res_name);
     cmd = strmake (NULL, "%s --list", test->exename);
-    run_ex (cmd, subname, 5000);
+    run_ex (cmd, subname, tempdir, 5000);
     free (cmd);
 
     subfile = fopen (subname, "r");
@@ -407,7 +407,7 @@ get_subtests (const char *tempdir, struct wine_test *test, LPTSTR res_name)
 }
 
 static void
-run_test (struct wine_test* test, const char* subtest)
+run_test (struct wine_test* test, const char* subtest, const char *tempdir)
 {
     int status;
     const char* file = get_test_source_file(test->name, subtest);
@@ -415,7 +415,7 @@ run_test (struct wine_test* test, const char* subtest)
     char *cmd = strmake (NULL, "%s %s", test->exename, subtest);
 
     xprintf ("%s:%s start %s %s\n", test->name, subtest, file, rev);
-    status = run_ex (cmd, NULL, 120000);
+    status = run_ex (cmd, NULL, tempdir, 120000);
     free (cmd);
     xprintf ("%s:%s done (%d)\n", test->name, subtest, status);
 }
@@ -538,7 +538,7 @@ run_tests (char *logname)
 	for (j = 0; j < test->subtest_count; j++) {
             report (R_STEP, "Running: %s:%s", test->name,
                     test->subtests[j]);
-	    run_test (test, test->subtests[j]);
+	    run_test (test, test->subtests[j], tempdir);
         }
     }
     report (R_DELTA, 0, "Running: Done");
-- 
1.4.4.3




More information about the wine-patches mailing list