This patch goes somewhat against Dimi's. Instead of invoking cvs, it extracts the working revision info from the CVS/Entries files resulting in speedy operation. Thus I incorporated all the stuff into maketest, executing unconditionally. Hope it is still portable.
ChangeLog: - Extract revision info from CVS/Entries. - #include "winetest.rc" into gui.rc. MinGW can't link in more than one resource files. - Enlarge chunk size of network transfer.
Index: Makefile.in =================================================================== RCS file: /home/wine/wine/programs/winetest/Makefile.in,v retrieving revision 1.23 diff -u -r1.23 Makefile.in --- Makefile.in 20 Mar 2004 19:21:39 -0000 1.23 +++ Makefile.in 22 Mar 2004 23:03:43 -0000 @@ -1,4 +1,5 @@ TOPSRCDIR = @top_srcdir@ +export TOPSRCDIR TOPOBJDIR = ../.. SRCDIR = @srcdir@ VPATH = @srcdir@ @@ -13,8 +14,7 @@ util.c
RC_SRCS = \ - gui.rc \ - winetest.rc + gui.rc
RC_BINSRC = gui.rc RC_BINARIES = wine.ico @@ -46,9 +46,6 @@
winetest.rc: maketest Makefile.in $(SRCDIR)/maketest $(TESTBINS) > $@ || ( $(RM) $@ && exit 1 ) - -revision.info: - (cd $(TOPSRCDIR); for file in dlls/*/tests/*.c; do rev=`cvs stat "$$file" | grep "Working" | awk '{print $$3}'`; echo "$$file:$$rev"; done) > $@ || ( $(RM) $@ && exit 1 )
winetest.res: $(TESTBINS)
Index: gui.rc =================================================================== RCS file: /home/wine/wine/programs/winetest/gui.rc,v retrieving revision 1.2 diff -u -r1.2 gui.rc --- gui.rc 2 Mar 2004 20:56:35 -0000 1.2 +++ gui.rc 22 Mar 2004 23:03:43 -0000 @@ -21,6 +21,7 @@ #include <windows.h> #include <winres.h> #include "guires.h" +#include "winetest.rc" /* for the MinGW cross-compiler */
IDD_STATUS DIALOG 0, 0, 160, 140 STYLE WS_OVERLAPPEDWINDOW Index: main.c =================================================================== RCS file: /home/wine/wine/programs/winetest/main.c,v retrieving revision 1.7 diff -u -r1.7 main.c --- main.c 20 Mar 2004 19:21:39 -0000 1.7 +++ main.c 22 Mar 2004 23:03:43 -0000 @@ -140,7 +140,6 @@ }
snprintf(buffer, sizeof(buffer), "dlls/%s/tests/%s.c", test, subtest); - fprintf(stderr, "file=%s\n", buffer); return buffer; }
@@ -149,36 +148,35 @@ const struct rev_info* rev;
for(rev = rev_infos; rev->file; rev++) { - fprintf(stderr, " ?{%s:%s)\n", rev->file, rev->rev); if (strcmp(rev->file, file) == 0) return rev->rev; }
- return ""; + return "-"; }
void extract_rev_infos () { char revinfo[256], *p; - int size = 0, i = 0, len; + int size = 0, i, len; HMODULE module = GetModuleHandle (NULL);
for (i = 0; TRUE; i++) { if (i >= size) { size += 100; - rev_infos = xrealloc(rev_infos, size); + rev_infos = xrealloc (rev_infos, size * sizeof (*rev_infos)); } memset(rev_infos + i, 0, sizeof(rev_infos[i]));
len = LoadStringA (module, i + 30000, revinfo, sizeof(revinfo)); if (len == 0) break; /* end of revision info */ - if (len >= sizeof(revinfo)) + if (len >= sizeof(revinfo) - 1) report (R_FATAL, "Revision info too long."); if(!(p = strrchr(revinfo, ':'))) report (R_FATAL, "Revision info malformed (i=%d)", i); *p = 0; rev_infos[i].file = strdup(revinfo); rev_infos[i].rev = strdup(p + 1); - } while(1); + } }
void* extract_rcdata (int id, DWORD* size) @@ -196,7 +194,7 @@ return addr; }
-/* Fills out the name, is_elf and exename fields */ +/* Fills in the name, is_elf and exename fields */ void extract_test (struct wine_test *test, const char *dir, int id) { @@ -459,48 +457,45 @@
cmdLine = mystrtok (cmdLine); while (cmdLine) { - if (*cmdLine == '-') - if (cmdLine[2]) { - report (R_ERROR, "Not a single letter option: %s", - cmdLine); - usage (); - exit (2); - } - cmdLine++; - switch (*cmdLine) { - case 'c': - report (R_TEXTMODE); - break; - case 'h': - usage (); - exit (0); - case 'q': - report (R_QUIET); - break; - case 's': - submit = mystrtok (NULL); - if (tag) - report (R_WARNING, "ignoring tag for submit"); - send_file (submit); - break; - case 'o': - logname = mystrtok (NULL); - run_tests (logname, tag); - break; - case 't': - tag = mystrtok (NULL); - cp = badtagchar (tag); - if (cp) { - report (R_ERROR, "invalid char in tag: %c", *cp); - usage (); - exit (2); - } - break; - default: - report (R_ERROR, "invalid option: -%c", *cmdLine); + if (cmdLine[0] != '-' || cmdLine[2]) { + report (R_ERROR, "Not a single letter option: %s", cmdLine); + usage (); + exit (2); + } + switch (cmdLine[1]) { + case 'c': + report (R_TEXTMODE); + break; + case 'h': + usage (); + exit (0); + case 'q': + report (R_QUIET); + break; + case 's': + submit = mystrtok (NULL); + if (tag) + report (R_WARNING, "ignoring tag for submit"); + send_file (submit); + break; + case 'o': + logname = mystrtok (NULL); + run_tests (logname, tag); + break; + case 't': + tag = mystrtok (NULL); + cp = badtagchar (tag); + if (cp) { + report (R_ERROR, "invalid char in tag: %c", *cp); usage (); exit (2); } + break; + default: + report (R_ERROR, "invalid option: -%c", cmdLine[1]); + usage (); + exit (2); + } cmdLine = mystrtok (NULL); } if (!logname && !submit) { Index: maketest =================================================================== RCS file: /home/wine/wine/programs/winetest/maketest,v retrieving revision 1.4 diff -u -r1.4 maketest --- maketest 20 Mar 2004 19:21:39 -0000 1.4 +++ maketest 22 Mar 2004 23:03:43 -0000 @@ -16,13 +16,15 @@ echo "$i "$test"" done
-if [ -f revision.info ]; then - i=0 - for line in `cat revision.info`; do - i=`expr $i + 1` - echo "$i+30000 "$line"" - done -fi +i=30000 +cd $TOPSRCDIR +for dir in dlls/*/tests; do + sed -ne "s|^/([^.]*.c)/([^/]*).*|$dir/\1:\2|p" $dir/CVS/Entries 2>/dev/null +done |\ +while read; do + echo "$i "$REPLY"" + i=`expr $i + 1` +done
echo "}"
Index: send.c =================================================================== RCS file: /home/wine/wine/programs/winetest/send.c,v retrieving revision 1.7 diff -u -r1.7 send.c --- send.c 19 Mar 2004 19:15:23 -0000 1.7 +++ send.c 22 Mar 2004 23:03:43 -0000 @@ -158,7 +158,7 @@
report (R_STATUS, "Sending %u bytes of data", filesize); report (R_PROGRESS, 2, filesize); - while ((bytes_read = fread (buffer, 1, BUFLEN / 8, f))) { + while ((bytes_read = fread (buffer, 1, BUFLEN / 2, f))) { if (send_buf (s, buffer, bytes_read)) { report (R_WARNING, "Error sending body: %d, %d", errno, WSAGetLastError ());
Ferenc Wagner wferi@afavant.elte.hu writes:
This patch goes somewhat against Dimi's. Instead of invoking cvs, it extracts the working revision info from the CVS/Entries files resulting in speedy operation. Thus I incorporated all the stuff into maketest, executing unconditionally. Hope it is still portable.
ChangeLog:
- Extract revision info from CVS/Entries.
- #include "winetest.rc" into gui.rc. MinGW can't link in more than one resource files.
- Enlarge chunk size of network transfer.
Any problem with this patch? It's keeping me from submitting the patch of patches, which actually makes it possible to run a cross compiled winetest.exe! :)
Ferenc Wagner wferi@afavant.elte.hu writes:
Any problem with this patch? It's keeping me from submitting the patch of patches, which actually makes it possible to run a cross compiled winetest.exe! :)
If you want me to apply a patch you have to send it to wine-patches, otherwise I assume it's here just for discussion. Anyway, I don't think reading CVS/Entries is better than running cvs directly, you still can't do it unconditionally since not everybody is building from CVS.
Alexandre Julliard julliard@winehq.org writes:
Ferenc Wagner wferi@afavant.elte.hu writes:
Any problem with this patch? It's keeping me from submitting the patch of patches, which actually makes it possible to run a cross compiled winetest.exe! :)
If you want me to apply a patch you have to send it to wine-patches, otherwise I assume it's here just for discussion.
I think I also sent it wine-patches. The first post really was a mistake, sorry for raising confusion.
Anyway, I don't think reading CVS/Entries is better than running cvs directly, you still can't do it unconditionally since not everybody is building from CVS.
Yes, functionally it's the same, but reading CVS/Entries is much faster (Dimi's reason for making it conditional was the enormous amount of time it required), and if those files are not present an empty file it will be created silently, which is the expected behaviour.
Ferenc Wagner wferi@afavant.elte.hu writes:
I think I also sent it wine-patches. The first post really was a mistake, sorry for raising confusion.
If you did then it got lost somewhere, please resumit.
Yes, functionally it's the same, but reading CVS/Entries is much faster (Dimi's reason for making it conditional was the enormous amount of time it required), and if those files are not present an empty file it will be created silently, which is the expected behaviour.
OK, as long as it fails gracefully that's fine.