- 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.
This commit is contained in:
parent
c3193925d8
commit
24624f6b5d
|
@ -1,6 +1,6 @@
|
|||
Makefile
|
||||
gui.res
|
||||
dist.res
|
||||
tests.rc
|
||||
wine.ico
|
||||
winetest.exe.dbg.c
|
||||
winetest.rc
|
||||
winetest.res
|
||||
|
|
|
@ -13,9 +13,9 @@ C_SRCS = \
|
|||
util.c
|
||||
|
||||
RC_SRCS = \
|
||||
gui.rc
|
||||
winetest.rc
|
||||
|
||||
RC_BINSRC = gui.rc
|
||||
RC_BINSRC = winetest.rc
|
||||
RC_BINARIES = wine.ico
|
||||
|
||||
TESTS = \
|
||||
|
@ -44,17 +44,34 @@ TESTS = \
|
|||
|
||||
TESTBINS = $(TESTS:%=%_test.exe$(DLLEXT))
|
||||
|
||||
winetest.rc: maketest Makefile.in
|
||||
tests.rc: maketest Makefile.in
|
||||
$(SRCDIR)/maketest $(TOPSRCDIR) $(TESTBINS) > $@ || ( $(RM) $@ && exit 1 )
|
||||
|
||||
gui.res: winetest.rc $(TESTBINS)
|
||||
winetest.res: $(TESTBINS)
|
||||
|
||||
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)
|
||||
cp $(DLLDIR)/advapi32/tests/advapi32_test.exe$(DLLEXT) $@ && $(STRIP) $@
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
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.
|
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* 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 @@
|
|||
*
|
||||
* 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 <windows.h>
|
||||
#include <commctrl.h>
|
||||
|
||||
#include "guires.h"
|
||||
#include "resource.h"
|
||||
#include "winetest.h"
|
||||
|
||||
/* Event object to signal successful window creation to main thread.
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
*
|
||||
* 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
|
||||
*
|
||||
* This program is dedicated to Anna Lindh,
|
||||
* Swedish Minister of Foreign Affairs.
|
||||
|
@ -36,8 +37,7 @@
|
|||
#include <windows.h>
|
||||
|
||||
#include "winetest.h"
|
||||
|
||||
#define TESTRESOURCE "USERDATA"
|
||||
#include "resource.h"
|
||||
|
||||
struct wine_test
|
||||
{
|
||||
|
@ -174,7 +174,7 @@ void extract_rev_infos ()
|
|||
}
|
||||
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 >= sizeof(revinfo) - 1)
|
||||
report (R_FATAL, "Revision info too long.");
|
||||
|
@ -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;
|
||||
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)) ||
|
||||
!(hdl = LoadResource (0, rsrc)) ||
|
||||
!(addr = LockResource (hdl)))
|
||||
report (R_FATAL, "Can't extract test file of id %d: %d",
|
||||
id, GetLastError ());
|
||||
return NULL;
|
||||
return addr;
|
||||
}
|
||||
|
||||
|
@ -211,7 +210,9 @@ extract_test (struct wine_test *test, const char *dir, int id)
|
|||
int strlen, bufflen = 128;
|
||||
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);
|
||||
while ((strlen = LoadStringA (NULL, id, test->name, bufflen))
|
||||
== bufflen - 1) {
|
||||
|
@ -406,11 +407,29 @@ run_tests (char *logname, const char *tag, const char *url)
|
|||
{
|
||||
int nr_of_files = 0, nr_of_tests = 0, i;
|
||||
char *tempdir;
|
||||
FILE *logfile;
|
||||
char build_tag[128];
|
||||
int logfile;
|
||||
char *strres, *eol, *nextline;
|
||||
DWORD strsize;
|
||||
|
||||
SetErrorMode (SEM_NOGPFAULTERRORBOX);
|
||||
|
||||
if (!logname) {
|
||||
logname = tempnam (0, "res");
|
||||
if (!logname) report (R_FATAL, "Can't name logfile.");
|
||||
}
|
||||
report (R_OUT, logname);
|
||||
|
||||
logfile = open (logname, O_WRONLY | O_CREAT | O_EXCL | O_APPEND,
|
||||
0666);
|
||||
if (-1 == logfile) {
|
||||
if (EEXIST == errno)
|
||||
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%%).");
|
||||
|
@ -418,35 +437,37 @@ run_tests (char *logname, const char *tag, const char *url)
|
|||
if (!CreateDirectory (tempdir, NULL))
|
||||
report (R_FATAL, "Could not create directory: %s", tempdir);
|
||||
|
||||
if (!logname) {
|
||||
logname = tempnam (0, "res");
|
||||
if (!logname) report (R_FATAL, "Can't name logfile.");
|
||||
}
|
||||
report (R_OUT, logname);
|
||||
|
||||
logfile = fopen (logname, "a");
|
||||
if (!logfile) report (R_FATAL, "Could not open logfile.");
|
||||
if (-1 == dup2 (fileno (logfile), 1))
|
||||
report (R_FATAL, "Can't redirect stdout.");
|
||||
fclose (logfile);
|
||||
|
||||
xprintf ("Version 3\n");
|
||||
i = LoadStringA (GetModuleHandle (NULL), 0,
|
||||
build_tag, sizeof build_tag);
|
||||
if (i == 0) report (R_FATAL, "Build descriptor not found: %d",
|
||||
GetLastError ());
|
||||
if (i >= sizeof build_tag)
|
||||
report (R_FATAL, "Build descriptor too long.");
|
||||
xprintf ("Tests from build %s\n", build_tag);
|
||||
xprintf ("Archive: %s\n", url?url:"");
|
||||
strres = extract_rcdata (WINE_BUILD, STRINGRES, &strsize);
|
||||
xprintf ("Tests from build ");
|
||||
if (strres) xprintf ("%.*s", strsize, strres);
|
||||
else xprintf ("-\n");
|
||||
strres = extract_rcdata (TESTS_URL, STRINGRES, &strsize);
|
||||
xprintf ("Archive: ");
|
||||
if (strres) xprintf ("%.*s", strsize, strres);
|
||||
else xprintf ("-\n");
|
||||
xprintf ("Tag: %s\n", tag?tag:"");
|
||||
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");
|
||||
print_version ();
|
||||
xprintf ("Test output:\n" );
|
||||
|
||||
report (R_STATUS, "Counting tests");
|
||||
if (!EnumResourceNames (NULL, TESTRESOURCE,
|
||||
if (!EnumResourceNames (NULL, MAKEINTRESOURCE(TESTRES),
|
||||
EnumTestFileProc, (LPARAM)&nr_of_files))
|
||||
report (R_FATAL, "Can't enumerate test files: %d",
|
||||
GetLastError ());
|
||||
|
@ -455,7 +476,7 @@ run_tests (char *logname, const char *tag, const char *url)
|
|||
report (R_STATUS, "Extracting tests");
|
||||
report (R_PROGRESS, 0, nr_of_files);
|
||||
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;
|
||||
}
|
||||
report (R_DELTA, 0, "Extracting: Done");
|
||||
|
|
|
@ -1,31 +1,26 @@
|
|||
#!/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"
|
||||
shift
|
||||
|
||||
echo "/* Automatically generated -- do not edit! */"
|
||||
echo "#include \"resource.h\""
|
||||
echo "STRINGTABLE {"
|
||||
echo "0 \"$WINE_BUILD\""
|
||||
|
||||
i=0
|
||||
for test
|
||||
do
|
||||
i=`expr $i + 1`
|
||||
echo "$i \"$test\""
|
||||
i=`expr $i + 1`
|
||||
done
|
||||
|
||||
i=30000
|
||||
i=0
|
||||
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\""
|
||||
echo "REV_INFO+$i \"$REPLY\""
|
||||
i=`expr $i + 1`
|
||||
done
|
||||
|
||||
|
@ -34,6 +29,6 @@ echo "}"
|
|||
i=0
|
||||
for test
|
||||
do
|
||||
echo "$i TESTRES \"$test\""
|
||||
i=`expr $i + 1`
|
||||
echo "$i USERDATA \"$test\""
|
||||
done
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* GUI resource definitions
|
||||
* Resource definitions
|
||||
*
|
||||
* Copyright 2004 Ferenc Wagner
|
||||
*
|
||||
|
@ -15,7 +15,7 @@
|
|||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#define IDI_WINE 1
|
||||
|
@ -37,3 +37,17 @@
|
|||
|
||||
#define IDC_EDIT 4000
|
||||
#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 @@
|
|||
*
|
||||
* 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 <winsock.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
|
|
@ -16,8 +16,9 @@
|
|||
*
|
||||
* 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 <unistd.h>
|
||||
#include <errno.h>
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#ifndef __WINETESTS_H
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* GUI resources
|
||||
* Winetest resources
|
||||
*
|
||||
* Copyright 2004 Ferenc Wagner
|
||||
*
|
||||
|
@ -15,16 +15,16 @@
|
|||
*
|
||||
* 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 <windows.h>
|
||||
#include <winres.h>
|
||||
#include "guires.h"
|
||||
#include "winetest.rc" /* for the MinGW cross-compiler */
|
||||
#include "resource.h"
|
||||
#include "tests.rc"
|
||||
|
||||
IDD_STATUS DIALOG 0, 0, 160, 140
|
||||
STYLE WS_OVERLAPPEDWINDOW
|
||||
STYLE WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX
|
||||
CAPTION "Wine Test Shell"
|
||||
BEGIN
|
||||
LTEXT "Extracting:", IDC_ST0, 10, 5, 140, 10
|
Loading…
Reference in New Issue