Commit 24624f6b authored by Ferenc Wagner's avatar Ferenc Wagner Committed by Alexandre Julliard

- Resource script restructuring.

- Build info et al. is given by files instead of env. vars. - Store that information in resources. - Make the main windows not resizeable. - Insist on creating a fresh log file. - Introduce the make dist target.
parent c3193925
Makefile Makefile
gui.res dist.res
tests.rc
wine.ico wine.ico
winetest.exe.dbg.c winetest.exe.dbg.c
winetest.rc
winetest.res winetest.res
...@@ -13,9 +13,9 @@ C_SRCS = \ ...@@ -13,9 +13,9 @@ C_SRCS = \
util.c util.c
RC_SRCS = \ RC_SRCS = \
gui.rc winetest.rc
RC_BINSRC = gui.rc RC_BINSRC = winetest.rc
RC_BINARIES = wine.ico RC_BINARIES = wine.ico
TESTS = \ TESTS = \
...@@ -44,17 +44,34 @@ TESTS = \ ...@@ -44,17 +44,34 @@ TESTS = \
TESTBINS = $(TESTS:%=%_test.exe$(DLLEXT)) TESTBINS = $(TESTS:%=%_test.exe$(DLLEXT))
winetest.rc: maketest Makefile.in tests.rc: maketest Makefile.in
$(SRCDIR)/maketest $(TOPSRCDIR) $(TESTBINS) > $@ || ( $(RM) $@ && exit 1 ) $(SRCDIR)/maketest $(TOPSRCDIR) $(TESTBINS) > $@ || ( $(RM) $@ && exit 1 )
gui.res: winetest.rc $(TESTBINS) winetest.res: $(TESTBINS)
clean:: clean::
$(RM) winetest.rc $(TESTBINS) $(RM) tests.rc dist.res winetest-dist winetest-dist.exe $(TESTBINS)
depend: winetest.rc depend: tests.rc
# rules for stripping the test executables # Rules for building distributable executable
.PHONY: dist
dist: winetest-dist.exe$(DLLEXT) winetest-dist$(EXEEXT)
winetest-dist.exe.so: $(ALL_OBJS) dist.res Makefile.in
$(WINEGCC) -B$(TOOLSDIR)/tools/winebuild $(APPMODE) $(ALL_OBJS) dist.res -o $@ -L$(DLLDIR) $(DELAYIMPORTS:%=-Wb,-d%) $(ALL_LIBS)
winetest-dist: $(WINEWRAPPER)
$(RM) $@ && $(LN_S) $(WINEWRAPPER) $@
winetest-dist.exe: $(ALL_OBJS) dist.res.o Makefile.in
$(CC) $(APPMODE) $(ALL_OBJS) dist.res.o -o $@ $(DELAYIMPORTS:%=-l%) $(ALL_LIBS)
dist.res: winetest.rc tests.rc build.id build.nfo tests.url $(TESTBINS) $(RC_BINARIES)
# Rules for stripping the test executables
advapi32_test.exe$(DLLEXT): $(DLLDIR)/advapi32/tests/advapi32_test.exe$(DLLEXT) advapi32_test.exe$(DLLEXT): $(DLLDIR)/advapi32/tests/advapi32_test.exe$(DLLEXT)
cp $(DLLDIR)/advapi32/tests/advapi32_test.exe$(DLLEXT) $@ && $(STRIP) $@ cp $(DLLDIR)/advapi32/tests/advapi32_test.exe$(DLLEXT) $@ && $(STRIP) $@
......
Wine Test Shell
~~~~~~~~~~~~~~~
Winetest is a single-executable version of all the DLL conformance
test programs suitable for unattended testing and report submission.
People assigned to build winetest must take care of the following
files, which are only used by 'make dist':
* build.id
Contains a single (either CR or CR-LF) terminated line providing the
build identification. The accepted characters are [-.0-9a-zA-Z].
* tests.url
Also contains a single terminated line providing the archive URL of
the testing suite being built.
* build.nfo
Contains a block of terminated lines providing miscellaneous
information about the build, like eg. the tools being used.
/*
* Resources for the binary we distribute to testers
*
* Copyright 2004 Ferenc Wagner
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "winetest.rc"
WINE_BUILD STRINGRES "build.id"
BUILD_INFO STRINGRES "build.nfo"
TESTS_URL STRINGRES "tests.url"
...@@ -15,13 +15,13 @@ ...@@ -15,13 +15,13 @@
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include <windows.h> #include <windows.h>
#include <commctrl.h> #include <commctrl.h>
#include "guires.h" #include "resource.h"
#include "winetest.h" #include "winetest.h"
/* Event object to signal successful window creation to main thread. /* Event object to signal successful window creation to main thread.
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* *
* This program is dedicated to Anna Lindh, * This program is dedicated to Anna Lindh,
* Swedish Minister of Foreign Affairs. * Swedish Minister of Foreign Affairs.
...@@ -36,8 +37,7 @@ ...@@ -36,8 +37,7 @@
#include <windows.h> #include <windows.h>
#include "winetest.h" #include "winetest.h"
#include "resource.h"
#define TESTRESOURCE "USERDATA"
struct wine_test struct wine_test
{ {
...@@ -174,7 +174,7 @@ void extract_rev_infos () ...@@ -174,7 +174,7 @@ void extract_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, REV_INFO+i, revinfo, sizeof(revinfo));
if (len == 0) break; /* end of revision info */ if (len == 0) break; /* end of revision info */
if (len >= sizeof(revinfo) - 1) if (len >= sizeof(revinfo) - 1)
report (R_FATAL, "Revision info too long."); report (R_FATAL, "Revision info too long.");
...@@ -186,18 +186,17 @@ void extract_rev_infos () ...@@ -186,18 +186,17 @@ void extract_rev_infos ()
} }
} }
void* extract_rcdata (int id, DWORD* size) void* extract_rcdata (int id, int type, DWORD* size)
{ {
HRSRC rsrc; HRSRC rsrc;
HGLOBAL hdl; HGLOBAL hdl;
LPVOID addr = NULL; LPVOID addr;
if (!(rsrc = FindResource (0, (LPTSTR)id, TESTRESOURCE)) || if (!(rsrc = FindResource (NULL, (LPTSTR)id, MAKEINTRESOURCE(type))) ||
!(*size = SizeofResource (0, rsrc)) || !(*size = SizeofResource (0, rsrc)) ||
!(hdl = LoadResource (0, rsrc)) || !(hdl = LoadResource (0, rsrc)) ||
!(addr = LockResource (hdl))) !(addr = LockResource (hdl)))
report (R_FATAL, "Can't extract test file of id %d: %d", return NULL;
id, GetLastError ());
return addr; return addr;
} }
...@@ -211,7 +210,9 @@ extract_test (struct wine_test *test, const char *dir, int id) ...@@ -211,7 +210,9 @@ extract_test (struct wine_test *test, const char *dir, int id)
int strlen, bufflen = 128; int strlen, bufflen = 128;
char *exepos; char *exepos;
code = extract_rcdata (id, &size); code = extract_rcdata (id, TESTRES, &size);
if (!code) report (R_FATAL, "Can't find test resource %d: %d",
id, GetLastError ());
test->name = xmalloc (bufflen); test->name = xmalloc (bufflen);
while ((strlen = LoadStringA (NULL, id, test->name, bufflen)) while ((strlen = LoadStringA (NULL, id, test->name, bufflen))
== bufflen - 1) { == bufflen - 1) {
...@@ -406,47 +407,67 @@ run_tests (char *logname, const char *tag, const char *url) ...@@ -406,47 +407,67 @@ run_tests (char *logname, const char *tag, const char *url)
{ {
int nr_of_files = 0, nr_of_tests = 0, i; int nr_of_files = 0, nr_of_tests = 0, i;
char *tempdir; char *tempdir;
FILE *logfile; int logfile;
char build_tag[128]; char *strres, *eol, *nextline;
DWORD strsize;
SetErrorMode (SEM_NOGPFAULTERRORBOX); SetErrorMode (SEM_NOGPFAULTERRORBOX);
tempdir = tempnam (0, "wct");
if (!tempdir)
report (R_FATAL, "Can't name temporary dir (check %%TEMP%%).");
report (R_DIR, tempdir);
if (!CreateDirectory (tempdir, NULL))
report (R_FATAL, "Could not create directory: %s", tempdir);
if (!logname) { if (!logname) {
logname = tempnam (0, "res"); logname = tempnam (0, "res");
if (!logname) report (R_FATAL, "Can't name logfile."); if (!logname) report (R_FATAL, "Can't name logfile.");
} }
report (R_OUT, logname); report (R_OUT, logname);
logfile = fopen (logname, "a"); logfile = open (logname, O_WRONLY | O_CREAT | O_EXCL | O_APPEND,
if (!logfile) report (R_FATAL, "Could not open logfile."); 0666);
if (-1 == dup2 (fileno (logfile), 1)) if (-1 == logfile) {
report (R_FATAL, "Can't redirect stdout."); if (EEXIST == errno)
fclose (logfile); report (R_FATAL, "File %s already exists.");
else report (R_FATAL, "Could not open logfile: %d", errno);
}
if (-1 == dup2 (logfile, 1))
report (R_FATAL, "Can't redirect stdout: %d", errno);
close (logfile);
tempdir = tempnam (0, "wct");
if (!tempdir)
report (R_FATAL, "Can't name temporary dir (check %%TEMP%%).");
report (R_DIR, tempdir);
if (!CreateDirectory (tempdir, NULL))
report (R_FATAL, "Could not create directory: %s", tempdir);
xprintf ("Version 3\n"); xprintf ("Version 3\n");
i = LoadStringA (GetModuleHandle (NULL), 0, strres = extract_rcdata (WINE_BUILD, STRINGRES, &strsize);
build_tag, sizeof build_tag); xprintf ("Tests from build ");
if (i == 0) report (R_FATAL, "Build descriptor not found: %d", if (strres) xprintf ("%.*s", strsize, strres);
GetLastError ()); else xprintf ("-\n");
if (i >= sizeof build_tag) strres = extract_rcdata (TESTS_URL, STRINGRES, &strsize);
report (R_FATAL, "Build descriptor too long."); xprintf ("Archive: ");
xprintf ("Tests from build %s\n", build_tag); if (strres) xprintf ("%.*s", strsize, strres);
xprintf ("Archive: %s\n", url?url:""); else xprintf ("-\n");
xprintf ("Tag: %s\n", tag?tag:""); xprintf ("Tag: %s\n", tag?tag:"");
xprintf ("Build info:\n"); xprintf ("Build info:\n");
strres = extract_rcdata (BUILD_INFO, STRINGRES, &strsize);
while (strres) {
eol = memchr (strres, '\n', strsize);
if (!eol) {
nextline = NULL;
eol = strres + strsize;
} else {
strsize -= eol - strres + 1;
nextline = strsize?eol+1:NULL;
if (eol > strres && *(eol-1) == '\r') eol--;
}
xprintf (" %.*s\n", eol-strres, strres);
strres = nextline;
}
xprintf ("Operating system version:\n"); xprintf ("Operating system version:\n");
print_version (); print_version ();
xprintf ("Test output:\n" ); xprintf ("Test output:\n" );
report (R_STATUS, "Counting tests"); report (R_STATUS, "Counting tests");
if (!EnumResourceNames (NULL, TESTRESOURCE, if (!EnumResourceNames (NULL, MAKEINTRESOURCE(TESTRES),
EnumTestFileProc, (LPARAM)&nr_of_files)) EnumTestFileProc, (LPARAM)&nr_of_files))
report (R_FATAL, "Can't enumerate test files: %d", report (R_FATAL, "Can't enumerate test files: %d",
GetLastError ()); GetLastError ());
...@@ -455,7 +476,7 @@ run_tests (char *logname, const char *tag, const char *url) ...@@ -455,7 +476,7 @@ run_tests (char *logname, const char *tag, const char *url)
report (R_STATUS, "Extracting tests"); report (R_STATUS, "Extracting tests");
report (R_PROGRESS, 0, nr_of_files); report (R_PROGRESS, 0, nr_of_files);
for (i = 0; i < nr_of_files; i++) { for (i = 0; i < nr_of_files; i++) {
get_subtests (tempdir, wine_tests+i, i+1); get_subtests (tempdir, wine_tests+i, i);
nr_of_tests += wine_tests[i].subtest_count; nr_of_tests += wine_tests[i].subtest_count;
} }
report (R_DELTA, 0, "Extracting: Done"); report (R_DELTA, 0, "Extracting: Done");
......
#!/bin/sh #!/bin/sh
if [ -z "$WINE_BUILD" ]; then
WINE_BUILD="`date +%Y%m%d.%H%M-auto`"
echo "warning: using automatically generated BUILD tag: $WINE_BUILD" 1>&2
fi
TOPSRCDIR="$1" TOPSRCDIR="$1"
shift shift
echo "/* Automatically generated -- do not edit! */" echo "/* Automatically generated -- do not edit! */"
echo "#include \"resource.h\""
echo "STRINGTABLE {" echo "STRINGTABLE {"
echo "0 \"$WINE_BUILD\""
i=0 i=0
for test for test
do do
i=`expr $i + 1`
echo "$i \"$test\"" echo "$i \"$test\""
i=`expr $i + 1`
done done
i=30000 i=0
cd $TOPSRCDIR cd $TOPSRCDIR
for dir in dlls/*/tests; do for dir in dlls/*/tests; do
sed -ne "s|^/\([^.]*.c\)/\([^/]*\).*|$dir/\1:\2|p" $dir/CVS/Entries 2>/dev/null sed -ne "s|^/\([^.]*.c\)/\([^/]*\).*|$dir/\1:\2|p" $dir/CVS/Entries 2>/dev/null
done |\ done |\
while read; do while read; do
echo "$i \"$REPLY\"" echo "REV_INFO+$i \"$REPLY\""
i=`expr $i + 1` i=`expr $i + 1`
done done
...@@ -34,6 +29,6 @@ echo "}" ...@@ -34,6 +29,6 @@ echo "}"
i=0 i=0
for test for test
do do
echo "$i TESTRES \"$test\""
i=`expr $i + 1` i=`expr $i + 1`
echo "$i USERDATA \"$test\""
done done
/* /*
* GUI resource definitions * Resource definitions
* *
* Copyright 2004 Ferenc Wagner * Copyright 2004 Ferenc Wagner
* *
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#define IDI_WINE 1 #define IDI_WINE 1
...@@ -37,3 +37,17 @@ ...@@ -37,3 +37,17 @@
#define IDC_EDIT 4000 #define IDC_EDIT 4000
#define IDC_ABOUT 4001 #define IDC_ABOUT 4001
/* Resource types */
#define TESTRES 1000
#define STRINGRES 1001
/* String resources */
#define WINE_BUILD 10000
#define BUILD_INFO 10001
#define TESTS_URL 10002
/* Revision info strings start from this index: */
#define REV_INFO 30000
...@@ -15,8 +15,9 @@ ...@@ -15,8 +15,9 @@
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include <winsock.h> #include <winsock.h>
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
......
...@@ -16,8 +16,9 @@ ...@@ -16,8 +16,9 @@
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifndef __WINETESTS_H #ifndef __WINETESTS_H
......
/* /*
* GUI resources * Winetest resources
* *
* Copyright 2004 Ferenc Wagner * Copyright 2004 Ferenc Wagner
* *
...@@ -15,16 +15,16 @@ ...@@ -15,16 +15,16 @@
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include <windows.h> #include <windows.h>
#include <winres.h> #include <winres.h>
#include "guires.h" #include "resource.h"
#include "winetest.rc" /* for the MinGW cross-compiler */ #include "tests.rc"
IDD_STATUS DIALOG 0, 0, 160, 140 IDD_STATUS DIALOG 0, 0, 160, 140
STYLE WS_OVERLAPPEDWINDOW STYLE WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX
CAPTION "Wine Test Shell" CAPTION "Wine Test Shell"
BEGIN BEGIN
LTEXT "Extracting:", IDC_ST0, 10, 5, 140, 10 LTEXT "Extracting:", IDC_ST0, 10, 5, 140, 10
......
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