Commit a122499a authored by Ferenc Wagner's avatar Ferenc Wagner Committed by Alexandre Julliard

- 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.
parent 77c9dd86
...@@ -13,8 +13,7 @@ C_SRCS = \ ...@@ -13,8 +13,7 @@ C_SRCS = \
util.c util.c
RC_SRCS = \ RC_SRCS = \
gui.rc \ gui.rc
winetest.rc
RC_BINSRC = gui.rc RC_BINSRC = gui.rc
RC_BINARIES = wine.ico RC_BINARIES = wine.ico
...@@ -45,12 +44,9 @@ TESTS = \ ...@@ -45,12 +44,9 @@ TESTS = \
TESTBINS = $(TESTS:%=%_test.exe$(DLLEXT)) TESTBINS = $(TESTS:%=%_test.exe$(DLLEXT))
winetest.rc: maketest Makefile.in winetest.rc: maketest Makefile.in
$(SRCDIR)/maketest $(TESTBINS) > $@ || ( $(RM) $@ && exit 1 ) $(SRCDIR)/maketest $(TOPSRCDIR) $(TESTBINS) > $@ || ( $(RM) $@ && exit 1 )
revision.info: gui.res: winetest.rc $(TESTBINS)
(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)
clean:: clean::
$(RM) winetest.rc $(TESTBINS) $(RM) winetest.rc $(TESTBINS)
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <windows.h> #include <windows.h>
#include <winres.h> #include <winres.h>
#include "guires.h" #include "guires.h"
#include "winetest.rc" /* for the MinGW cross-compiler */
IDD_STATUS DIALOG 0, 0, 160, 140 IDD_STATUS DIALOG 0, 0, 160, 140
STYLE WS_OVERLAPPEDWINDOW STYLE WS_OVERLAPPEDWINDOW
......
...@@ -140,7 +140,6 @@ const char* get_test_source_file(const char* test, const char* subtest) ...@@ -140,7 +140,6 @@ const char* get_test_source_file(const char* test, const char* subtest)
} }
snprintf(buffer, sizeof(buffer), "dlls/%s/tests/%s.c", test, subtest); snprintf(buffer, sizeof(buffer), "dlls/%s/tests/%s.c", test, subtest);
fprintf(stderr, "file=%s\n", buffer);
return buffer; return buffer;
} }
...@@ -149,36 +148,35 @@ const char* get_file_rev(const char* file) ...@@ -149,36 +148,35 @@ const char* get_file_rev(const char* file)
const struct rev_info* rev; const struct rev_info* rev;
for(rev = rev_infos; rev->file; 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; if (strcmp(rev->file, file) == 0) return rev->rev;
} }
return ""; return "-";
} }
void extract_rev_infos () void extract_rev_infos ()
{ {
char revinfo[256], *p; char revinfo[256], *p;
int size = 0, i = 0, len; int size = 0, i, len;
HMODULE module = GetModuleHandle (NULL); HMODULE module = GetModuleHandle (NULL);
for (i = 0; TRUE; i++) { for (i = 0; TRUE; i++) {
if (i >= size) { if (i >= size) {
size += 100; 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])); memset(rev_infos + i, 0, sizeof(rev_infos[i]));
len = LoadStringA (module, i + 30000, revinfo, sizeof(revinfo)); len = LoadStringA (module, i + 30000, revinfo, sizeof(revinfo));
if (len == 0) break; /* end of revision info */ if (len == 0) break; /* end of revision info */
if (len >= sizeof(revinfo)) if (len >= sizeof(revinfo) - 1)
report (R_FATAL, "Revision info too long."); report (R_FATAL, "Revision info too long.");
if(!(p = strrchr(revinfo, ':'))) if(!(p = strrchr(revinfo, ':')))
report (R_FATAL, "Revision info malformed (i=%d)", i); report (R_FATAL, "Revision info malformed (i=%d)", i);
*p = 0; *p = 0;
rev_infos[i].file = strdup(revinfo); rev_infos[i].file = strdup(revinfo);
rev_infos[i].rev = strdup(p + 1); rev_infos[i].rev = strdup(p + 1);
} while(1); }
} }
void* extract_rcdata (int id, DWORD* size) void* extract_rcdata (int id, DWORD* size)
...@@ -196,7 +194,7 @@ void* extract_rcdata (int id, DWORD* size) ...@@ -196,7 +194,7 @@ void* extract_rcdata (int id, DWORD* size)
return addr; return addr;
} }
/* Fills out the name, is_elf and exename fields */ /* Fills in the name, is_elf and exename fields */
void void
extract_test (struct wine_test *test, const char *dir, int id) extract_test (struct wine_test *test, const char *dir, int id)
{ {
...@@ -459,15 +457,12 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst, ...@@ -459,15 +457,12 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
cmdLine = mystrtok (cmdLine); cmdLine = mystrtok (cmdLine);
while (cmdLine) { while (cmdLine) {
if (*cmdLine == '-') if (cmdLine[0] != '-' || cmdLine[2]) {
if (cmdLine[2]) { report (R_ERROR, "Not a single letter option: %s", cmdLine);
report (R_ERROR, "Not a single letter option: %s",
cmdLine);
usage (); usage ();
exit (2); exit (2);
} }
cmdLine++; switch (cmdLine[1]) {
switch (*cmdLine) {
case 'c': case 'c':
report (R_TEXTMODE); report (R_TEXTMODE);
break; break;
...@@ -497,7 +492,7 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst, ...@@ -497,7 +492,7 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
} }
break; break;
default: default:
report (R_ERROR, "invalid option: -%c", *cmdLine); report (R_ERROR, "invalid option: -%c", cmdLine[1]);
usage (); usage ();
exit (2); exit (2);
} }
......
...@@ -5,6 +5,9 @@ if [ -z "$WINE_BUILD" ]; then ...@@ -5,6 +5,9 @@ if [ -z "$WINE_BUILD" ]; then
echo "warning: using automatically generated BUILD tag: $WINE_BUILD" 1>&2 echo "warning: using automatically generated BUILD tag: $WINE_BUILD" 1>&2
fi fi
TOPSRCDIR="$1"
shift
echo "/* Automatically generated -- do not edit! */" echo "/* Automatically generated -- do not edit! */"
echo "STRINGTABLE {" echo "STRINGTABLE {"
echo "0 \"$WINE_BUILD\"" echo "0 \"$WINE_BUILD\""
...@@ -16,13 +19,15 @@ do ...@@ -16,13 +19,15 @@ do
echo "$i \"$test\"" echo "$i \"$test\""
done done
if [ -f revision.info ]; then i=30000
i=0 cd $TOPSRCDIR
for line in `cat revision.info`; do 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` i=`expr $i + 1`
echo "$i+30000 \"$line\"" done
done
fi
echo "}" echo "}"
......
...@@ -158,7 +158,7 @@ send_file (const char *name) ...@@ -158,7 +158,7 @@ send_file (const char *name)
report (R_STATUS, "Sending %u bytes of data", filesize); report (R_STATUS, "Sending %u bytes of data", filesize);
report (R_PROGRESS, 2, 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)) { if (send_buf (s, buffer, bytes_read)) {
report (R_WARNING, "Error sending body: %d, %d", report (R_WARNING, "Error sending body: %d, %d",
errno, WSAGetLastError ()); errno, WSAGetLastError ());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment