-make rbuild files XML compliant by adding the XInclude namespace

-sync winetest to WINE-rc1
-add a rbuild file for winetest (not added to build yet)
note: minor winetest modifications should be made like loading tests from a folder at startup

svn path=/trunk/; revision=33556
This commit is contained in:
Marc Piulachs 2008-05-17 15:44:47 +00:00
parent 95b8c49444
commit 107c3d29cb
20 changed files with 407 additions and 205 deletions

View file

@ -1,6 +1,6 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!DOCTYPE project SYSTEM "tools/rbuild/project.dtd"> <!DOCTYPE project SYSTEM "tools/rbuild/project.dtd">
<group> <group xmlns:xi="http://www.w3.org/2001/XInclude">
<directory name="queuetest"> <directory name="queuetest">
<xi:include href="queuetest/queuetest.rbuild" /> <xi:include href="queuetest/queuetest.rbuild" />
</directory> </directory>

View file

@ -1,3 +1,6 @@
<?xml version="1.0"?>
<!DOCTYPE project SYSTEM "tools/rbuild/project.dtd">
<group xmlns:xi="http://www.w3.org/2001/XInclude">
<module name="kernel32_test" type="test"> <module name="kernel32_test" type="test">
<include base="rtshared">.</include> <include base="rtshared">.</include>
<include base="kernel32">.</include> <include base="kernel32">.</include>
@ -20,3 +23,4 @@
<file>CreateFile.c</file> <file>CreateFile.c</file>
<xi:include href="stubs.rbuild" /> <xi:include href="stubs.rbuild" />
</module> </module>
</group>

View file

@ -1,6 +1,6 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!DOCTYPE project SYSTEM "tools/rbuild/project.dtd"> <!DOCTYPE project SYSTEM "tools/rbuild/project.dtd">
<group> <group xmlns:xi="http://www.w3.org/2001/XInclude">
<directory name="movefile"> <directory name="movefile">
<xi:include href="movefile/movefile.rbuild" /> <xi:include href="movefile/movefile.rbuild" />
</directory> </directory>

View file

@ -1,6 +1,6 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!DOCTYPE project SYSTEM "tools/rbuild/project.dtd"> <!DOCTYPE project SYSTEM "tools/rbuild/project.dtd">
<group> <group xmlns:xi="http://www.w3.org/2001/XInclude">
<directory name="kernel32"> <directory name="kernel32">
<xi:include href="kernel32/directory.rbuild" /> <xi:include href="kernel32/directory.rbuild" />
</directory> </directory>

View file

@ -1,3 +1,6 @@
<?xml version="1.0"?>
<!DOCTYPE project SYSTEM "tools/rbuild/project.dtd">
<group>
<module name="drawcap" type="win32cui" installbase="system32" installname="drawcap.exe"> <module name="drawcap" type="win32cui" installbase="system32" installname="drawcap.exe">
<include base="drawcap">.</include> <include base="drawcap">.</include>
<define name="__USE_W32API" /> <define name="__USE_W32API" />
@ -27,3 +30,4 @@
<file>capicon.c</file> <file>capicon.c</file>
<file>capicon.rc</file> <file>capicon.rc</file>
</module> </module>
</group>

View file

@ -1,6 +1,6 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!DOCTYPE project SYSTEM "tools/rbuild/project.dtd"> <!DOCTYPE project SYSTEM "tools/rbuild/project.dtd">
<group> <group xmlns:xi="http://www.w3.org/2001/XInclude">
<directory name="drawcaption"> <directory name="drawcaption">
<xi:include href="drawcaption/drawcaption.rbuild" /> <xi:include href="drawcaption/drawcaption.rbuild" />
</directory> </directory>

View file

@ -124,4 +124,9 @@
<directory name="wininet"> <directory name="wininet">
<xi:include href="wininet/wininet.rbuild" /> <xi:include href="wininet/wininet.rbuild" />
</directory> </directory>
<!--
<directory name="winetest">
<xi:include href="winetest/winetest.rbuild" />
</directory>
-->
</group> </group>

View file

@ -1,3 +1,6 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<group>
<module name="rpcrt4_winetest_server" type="rpcserver" allowwarnings="true"> <module name="rpcrt4_winetest_server" type="rpcserver" allowwarnings="true">
<file>server.idl</file> <file>server.idl</file>
</module> </module>
@ -25,3 +28,4 @@
<file>server.c</file> <file>server.c</file>
<file>testlist.c</file> <file>testlist.c</file>
</module> </module>
</group>

View file

@ -15,11 +15,17 @@
* *
* 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 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "winetest.rc" #include "winetest.rc"
#include "tests.rc"
WINE_BUILD STRINGRES "build.id" /* @makedep: build.id */
BUILD_INFO STRINGRES "build.nfo" //WINE_BUILD STRINGRES "build.id"
TESTS_URL STRINGRES "tests.url"
/* @makedep: build.nfo */
//BUILD_INFO STRINGRES "build.nfo"
/* @makedep: tests.url */
//TESTS_URL STRINGRES "tests.url"

View file

@ -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 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include <windows.h> #include <windows.h>
@ -323,7 +323,7 @@ EditTagProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
return CallWindowProcA (DefEditProc, hwnd, msg, wParam, lParam); return CallWindowProcA (DefEditProc, hwnd, msg, wParam, lParam);
} }
static BOOL CALLBACK static INT_PTR CALLBACK
AskTagProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) AskTagProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{ {
int len; int len;
@ -376,7 +376,7 @@ qAsk (va_list ap)
return MBdefault (va_arg (ap, int)); return MBdefault (va_arg (ap, int));
} }
static BOOL CALLBACK static INT_PTR CALLBACK
AboutProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) AboutProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{ {
switch (msg) { switch (msg) {
@ -390,7 +390,7 @@ AboutProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
return FALSE; return FALSE;
} }
static BOOL CALLBACK static INT_PTR CALLBACK
DlgProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) DlgProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{ {
switch (msg) { switch (msg) {

View file

@ -17,7 +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 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, 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.
@ -39,6 +39,7 @@
#include "winetest.h" #include "winetest.h"
#include "resource.h" #include "resource.h"
#include <reason.h>
struct wine_test struct wine_test
{ {
@ -57,8 +58,43 @@ struct rev_info
char *tag = NULL; char *tag = NULL;
static struct wine_test *wine_tests; static struct wine_test *wine_tests;
static int nr_of_files, nr_of_tests;
static struct rev_info *rev_infos = NULL; static struct rev_info *rev_infos = NULL;
static const char whitespace[] = " \t\r\n"; static const char whitespace[] = " \t\r\n";
static const char testexe[] = "_test.exe";
static char * get_file_version(char * file_name)
{
static char version[32];
DWORD size;
DWORD handle;
size = GetFileVersionInfoSizeA(file_name, &handle);
if (size) {
char * data = xmalloc(size);
if (data) {
if (GetFileVersionInfoA(file_name, handle, size, data)) {
static char backslash[] = "\\";
VS_FIXEDFILEINFO *pFixedVersionInfo;
UINT len;
if (VerQueryValueA(data, backslash, (LPVOID *)&pFixedVersionInfo, &len)) {
sprintf(version, "%d.%d.%d.%d",
pFixedVersionInfo->dwFileVersionMS >> 16,
pFixedVersionInfo->dwFileVersionMS & 0xffff,
pFixedVersionInfo->dwFileVersionLS >> 16,
pFixedVersionInfo->dwFileVersionLS & 0xffff);
} else
sprintf(version, "version not available");
} else
sprintf(version, "unknown");
free(data);
} else
sprintf(version, "failed");
} else
sprintf(version, "version not available");
return version;
}
static int running_under_wine (void) static int running_under_wine (void)
{ {
@ -96,6 +132,8 @@ static void print_version (void)
{ {
OSVERSIONINFOEX ver; OSVERSIONINFOEX ver;
BOOL ext; BOOL ext;
int is_win2k3_r2;
const char *(*wine_get_build_id)(void);
ver.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); ver.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
if (!(ext = GetVersionEx ((OSVERSIONINFO *) &ver))) if (!(ext = GetVersionEx ((OSVERSIONINFO *) &ver)))
@ -112,6 +150,13 @@ static void print_version (void)
ver.dwMajorVersion, ver.dwMinorVersion, ver.dwBuildNumber, ver.dwMajorVersion, ver.dwMinorVersion, ver.dwBuildNumber,
ver.dwPlatformId, ver.szCSDVersion); ver.dwPlatformId, ver.szCSDVersion);
wine_get_build_id = (void *)GetProcAddress(GetModuleHandleA("ntdll.dll"), "wine_get_build_id");
if (wine_get_build_id) xprintf( " WineBuild=%s\n", wine_get_build_id() );
is_win2k3_r2 = GetSystemMetrics(SM_SERVERR2);
if(is_win2k3_r2)
xprintf(" R2 build number=%d\n", is_win2k3_r2);
if (!ext) return; if (!ext) return;
xprintf (" wServicePackMajor=%d\n wServicePackMinor=%d\n" xprintf (" wServicePackMajor=%d\n wServicePackMinor=%d\n"
@ -159,10 +204,7 @@ static void remove_dir (const char *dir)
static const char* get_test_source_file(const char* test, const char* subtest) static const char* get_test_source_file(const char* test, const char* subtest)
{ {
static const char* special_dirs[][2] = { static const char* special_dirs[][2] = {
{ "gdi32", "gdi"}, { "kernel32", "kernel" }, { 0, 0 }
{ "msacm32", "msacm" },
{ "user32", "user" }, { "winspool.drv", "winspool" },
{ "ws2_32", "winsock" }, { 0, 0 }
}; };
static char buffer[MAX_PATH]; static char buffer[MAX_PATH];
int i; int i;
@ -215,13 +257,13 @@ static void extract_rev_infos (void)
} }
} }
static void* extract_rcdata (int id, int type, DWORD* size) static void* extract_rcdata (LPTSTR name, int type, DWORD* size)
{ {
HRSRC rsrc; HRSRC rsrc;
HGLOBAL hdl; HGLOBAL hdl;
LPVOID addr; LPVOID addr;
if (!(rsrc = FindResource (NULL, (LPTSTR)id, MAKEINTRESOURCE(type))) || if (!(rsrc = FindResource (NULL, name, MAKEINTRESOURCE(type))) ||
!(*size = SizeofResource (0, rsrc)) || !(*size = SizeofResource (0, rsrc)) ||
!(hdl = LoadResource (0, rsrc)) || !(hdl = LoadResource (0, rsrc)) ||
!(addr = LockResource (hdl))) !(addr = LockResource (hdl)))
@ -231,26 +273,19 @@ static void* extract_rcdata (int id, int type, DWORD* size)
/* Fills in the name and exename fields */ /* Fills in the name and exename fields */
static void static void
extract_test (struct wine_test *test, const char *dir, int id) extract_test (struct wine_test *test, const char *dir, LPTSTR res_name)
{ {
BYTE* code; BYTE* code;
DWORD size; DWORD size;
FILE* fout; FILE* fout;
int strlen, bufflen = 128;
char *exepos; char *exepos;
code = extract_rcdata (id, TESTRES, &size); code = extract_rcdata (res_name, TESTRES, &size);
if (!code) report (R_FATAL, "Can't find test resource %d: %d", if (!code) report (R_FATAL, "Can't find test resource %s: %d",
id, GetLastError ()); res_name, GetLastError ());
test->name = xmalloc (bufflen); test->name = xstrdup( res_name );
while ((strlen = LoadStringA (NULL, id, test->name, bufflen))
== bufflen - 1) {
bufflen *= 2;
test->name = xrealloc (test->name, bufflen);
}
if (!strlen) report (R_FATAL, "Can't read name of test %d.", id);
test->exename = strmake (NULL, "%s/%s", dir, test->name); test->exename = strmake (NULL, "%s/%s", dir, test->name);
exepos = strstr (test->name, "_test.exe"); exepos = strstr (test->name, testexe);
if (!exepos) report (R_FATAL, "Not an .exe file: %s", test->name); if (!exepos) report (R_FATAL, "Not an .exe file: %s", test->name);
*exepos = 0; *exepos = 0;
test->name = xrealloc (test->name, exepos - test->name + 1); test->name = xrealloc (test->name, exepos - test->name + 1);
@ -269,7 +304,7 @@ extract_test (struct wine_test *test, const char *dir, int id)
value of WaitForSingleObject. value of WaitForSingleObject.
*/ */
static int 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; STARTUPINFO si;
PROCESS_INFORMATION pi; PROCESS_INFORMATION pi;
@ -277,8 +312,7 @@ run_ex (char *cmd, const char *out, DWORD ms)
DWORD wait, status; DWORD wait, status;
GetStartupInfo (&si); GetStartupInfo (&si);
si.wShowWindow = SW_HIDE; si.dwFlags = 0;
si.dwFlags = STARTF_USESHOWWINDOW;
if (out) { if (out) {
fd = open (out, O_WRONLY | O_CREAT, 0666); fd = open (out, O_WRONLY | O_CREAT, 0666);
@ -292,8 +326,8 @@ run_ex (char *cmd, const char *out, DWORD ms)
close (fd); close (fd);
} }
if (!CreateProcessA (NULL, cmd, NULL, NULL, TRUE, 0, if (!CreateProcessA (NULL, cmd, NULL, NULL, TRUE, CREATE_DEFAULT_ERROR_MODE,
NULL, NULL, &si, &pi)) { NULL, tempdir, &si, &pi)) {
status = -2; status = -2;
} else { } else {
CloseHandle (pi.hThread); CloseHandle (pi.hThread);
@ -346,7 +380,7 @@ run_ex (char *cmd, const char *out, DWORD ms)
} }
static void static void
get_subtests (const char *tempdir, struct wine_test *test, int id) get_subtests (const char *tempdir, struct wine_test *test, LPTSTR res_name)
{ {
char *subname, *cmd; char *subname, *cmd;
FILE *subfile; FILE *subfile;
@ -360,9 +394,9 @@ get_subtests (const char *tempdir, struct wine_test *test, int id)
subname = tempnam (0, "sub"); subname = tempnam (0, "sub");
if (!subname) report (R_FATAL, "Can't name subtests file."); if (!subname) report (R_FATAL, "Can't name subtests file.");
extract_test (test, tempdir, id); extract_test (test, tempdir, res_name);
cmd = strmake (NULL, "%s --list", test->exename); cmd = strmake (NULL, "%s --list", test->exename);
run_ex (cmd, subname, 5000); run_ex (cmd, subname, tempdir, 5000);
free (cmd); free (cmd);
subfile = fopen (subname, "r"); subfile = fopen (subname, "r");
@ -411,7 +445,7 @@ get_subtests (const char *tempdir, struct wine_test *test, int id)
} }
static void 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; int status;
const char* file = get_test_source_file(test->name, subtest); const char* file = get_test_source_file(test->name, subtest);
@ -419,7 +453,7 @@ run_test (struct wine_test* test, const char* subtest)
char *cmd = strmake (NULL, "%s %s", test->exename, subtest); char *cmd = strmake (NULL, "%s %s", test->exename, subtest);
xprintf ("%s:%s start %s %s\n", test->name, subtest, file, rev); 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); free (cmd);
xprintf ("%s:%s done (%d)\n", test->name, subtest, status); xprintf ("%s:%s done (%d)\n", test->name, subtest, status);
} }
@ -432,14 +466,43 @@ EnumTestFileProc (HMODULE hModule, LPCTSTR lpszType,
return TRUE; return TRUE;
} }
static BOOL CALLBACK
extract_test_proc (HMODULE hModule, LPCTSTR lpszType,
LPTSTR lpszName, LONG_PTR lParam)
{
const char *tempdir = (const char *)lParam;
char dllname[MAX_PATH];
HMODULE dll;
/* Check if the main dll is present on this system */
CharLowerA(lpszName);
strcpy(dllname, lpszName);
*strstr(dllname, testexe) = 0;
dll = LoadLibraryExA(dllname, NULL, LOAD_LIBRARY_AS_DATAFILE);
if (!dll) {
xprintf (" %s=dll is missing\n", dllname);
return TRUE;
}
FreeLibrary(dll);
xprintf (" %s=%s\n", dllname, get_file_version(dllname));
get_subtests( tempdir, &wine_tests[nr_of_files], lpszName );
nr_of_tests += wine_tests[nr_of_files].subtest_count;
nr_of_files++;
return TRUE;
}
static char * static char *
run_tests (char *logname) run_tests (char *logname)
{ {
int nr_of_files = 0, nr_of_tests = 0, i; int i;
char *tempdir, *shorttempdir; char *tempdir, *shorttempdir;
int logfile; int logfile;
char *strres, *eol, *nextline; char *strres, *eol, *nextline;
DWORD strsize; DWORD strsize;
char build[64];
SetErrorMode (SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX); SetErrorMode (SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX);
@ -475,18 +538,19 @@ run_tests (char *logname)
report (R_FATAL, "Could not create directory: %s", tempdir); report (R_FATAL, "Could not create directory: %s", tempdir);
report (R_DIR, tempdir); report (R_DIR, tempdir);
xprintf ("Version 3\n"); xprintf ("Version 4\n");
strres = extract_rcdata (WINE_BUILD, STRINGRES, &strsize); strres = extract_rcdata (MAKEINTRESOURCE(WINE_BUILD), STRINGRES, &strsize);
xprintf ("Tests from build "); xprintf ("Tests from build ");
if (strres) xprintf ("%.*s", strsize, strres); if (LoadStringA( 0, IDS_BUILD_ID, build, sizeof(build) )) xprintf( "%s\n", build );
else if (strres) xprintf ("%.*s", strsize, strres);
else xprintf ("-\n"); else xprintf ("-\n");
strres = extract_rcdata (TESTS_URL, STRINGRES, &strsize); strres = extract_rcdata (MAKEINTRESOURCE(TESTS_URL), STRINGRES, &strsize);
xprintf ("Archive: "); xprintf ("Archive: ");
if (strres) xprintf ("%.*s", strsize, strres); if (strres) xprintf ("%.*s", strsize, strres);
else xprintf ("-\n"); else xprintf ("-\n");
xprintf ("Tag: %s\n", tag); xprintf ("Tag: %s\n", tag);
xprintf ("Build info:\n"); xprintf ("Build info:\n");
strres = extract_rcdata (BUILD_INFO, STRINGRES, &strsize); strres = extract_rcdata (MAKEINTRESOURCE(BUILD_INFO), STRINGRES, &strsize);
while (strres) { while (strres) {
eol = memchr (strres, '\n', strsize); eol = memchr (strres, '\n', strsize);
if (!eol) { if (!eol) {
@ -502,7 +566,7 @@ run_tests (char *logname)
} }
xprintf ("Operating system version:\n"); xprintf ("Operating system version:\n");
print_version (); print_version ();
xprintf ("Test output:\n" ); xprintf ("Dll info:\n" );
report (R_STATUS, "Counting tests"); report (R_STATUS, "Counting tests");
if (!EnumResourceNames (NULL, MAKEINTRESOURCE(TESTRES), if (!EnumResourceNames (NULL, MAKEINTRESOURCE(TESTRES),
@ -513,10 +577,15 @@ run_tests (char *logname)
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++) { nr_of_files = 0;
get_subtests (tempdir, wine_tests+i, i); nr_of_tests = 0;
nr_of_tests += wine_tests[i].subtest_count; if (!EnumResourceNames (NULL, MAKEINTRESOURCE(TESTRES),
} extract_test_proc, (LPARAM)tempdir))
report (R_FATAL, "Can't enumerate test files: %d",
GetLastError ());
xprintf ("Test output:\n" );
report (R_DELTA, 0, "Extracting: Done"); report (R_DELTA, 0, "Extracting: Done");
report (R_STATUS, "Running tests"); report (R_STATUS, "Running tests");
@ -528,7 +597,7 @@ run_tests (char *logname)
for (j = 0; j < test->subtest_count; j++) { for (j = 0; j < test->subtest_count; j++) {
report (R_STEP, "Running: %s:%s", test->name, report (R_STEP, "Running: %s:%s", test->name,
test->subtests[j]); test->subtests[j]);
run_test (test, test->subtests[j]); run_test (test, test->subtests[j], tempdir);
} }
} }
report (R_DELTA, 0, "Running: Done"); report (R_DELTA, 0, "Running: Done");
@ -545,15 +614,16 @@ run_tests (char *logname)
static void static void
usage (void) usage (void)
{ {
fprintf (stderr, "\ fprintf (stderr,
Usage: winetest [OPTION]...\n\n\ "Usage: winetest [OPTION]...\n\n"
-c console mode, no GUI\n\ " -c console mode, no GUI\n"
-e preserve the environment\n\ " -e preserve the environment\n"
-h print this message and exit\n\ " -h print this message and exit\n"
-q quiet mode, no output at all\n\ " -p shutdown when the tests are done\n"
-o FILE put report into FILE, do not submit\n\ " -q quiet mode, no output at all\n"
-s FILE submit FILE, do not run tests\n\ " -o FILE put report into FILE, do not submit\n"
-t TAG include TAG of characters [-.0-9a-zA-Z] in the report\n"); " -s FILE submit FILE, do not run tests\n"
" -t TAG include TAG of characters [-.0-9a-zA-Z] in the report\n");
} }
int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst, int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
@ -562,6 +632,7 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
char *logname = NULL; char *logname = NULL;
const char *cp, *submit = NULL; const char *cp, *submit = NULL;
int reset_env = 1; int reset_env = 1;
int poweroff = 0;
int interactive = 1; int interactive = 1;
/* initialize the revision information first */ /* initialize the revision information first */
@ -583,8 +654,12 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
reset_env = 0; reset_env = 0;
break; break;
case 'h': case 'h':
case '?':
usage (); usage ();
exit (0); exit (0);
case 'p':
poweroff = 1;
break;
case 'q': case 'q':
report (R_QUIET); report (R_QUIET);
interactive = 0; interactive = 0;
@ -618,15 +693,24 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
cmdLine = strtok (NULL, whitespace); cmdLine = strtok (NULL, whitespace);
} }
if (!submit) { if (!submit) {
static CHAR platform_windows[] = "WINETEST_PLATFORM=windows",
platform_wine[] = "WINETEST_PLATFORM=wine",
debug_yes[] = "WINETEST_DEBUG=1",
interactive_no[] = "WINETEST_INTERACTIVE=0",
report_success_no[] = "WINETEST_REPORT_SUCCESS=0";
CHAR *platform;
report (R_STATUS, "Starting up"); report (R_STATUS, "Starting up");
if (!running_on_visible_desktop ()) if (!running_on_visible_desktop ())
report (R_FATAL, "Tests must be run on a visible desktop"); report (R_FATAL, "Tests must be run on a visible desktop");
if (reset_env && (putenv ("WINETEST_PLATFORM=windows") || platform = running_under_wine () ? platform_wine : platform_windows;
putenv ("WINETEST_DEBUG=1") ||
putenv ("WINETEST_INTERACTIVE=0") || if (reset_env && (putenv (platform) ||
putenv ("WINETEST_REPORT_SUCCESS=0"))) putenv (debug_yes) ||
putenv (interactive_no) ||
putenv (report_success_no)))
report (R_FATAL, "Could not reset environment: %d", errno); report (R_FATAL, "Could not reset environment: %d", errno);
if (!tag) { if (!tag) {
@ -647,5 +731,21 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
} else run_tests (logname); } else run_tests (logname);
report (R_STATUS, "Finished"); report (R_STATUS, "Finished");
} }
if (poweroff)
{
HANDLE hToken;
TOKEN_PRIVILEGES npr;
/* enable the shutdown privilege for the current process */
if (OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &hToken))
{
LookupPrivilegeValueA(0, SE_SHUTDOWN_NAME, &npr.Privileges[0].Luid);
npr.PrivilegeCount = 1;
npr.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
AdjustTokenPrivileges(hToken, FALSE, &npr, 0, 0, 0);
CloseHandle(hToken);
}
ExitWindowsEx(EWX_SHUTDOWN | EWX_POWEROFF | EWX_FORCEIFHUNG, SHTDN_REASON_MAJOR_OTHER | SHTDN_REASON_MINOR_OTHER);
}
exit (0); exit (0);
} }

View file

@ -0,0 +1,25 @@
#!/bin/sh
TOPSRCDIR="$1"
shift
echo "/* Automatically generated -- do not edit! */"
echo "STRINGTABLE {"
i=0
cd $TOPSRCDIR
if [ -d .git ]
then
git-ls-files -c -s --abbrev=10 -- "dlls/*/tests/*.c" |\
sed -ne "s|^[0-7]* \([0-9a-f]*\) [0-9] \(.*\)$|\2:\1|p"
else
for dir in dlls/*/tests; do
sed -ne "s|^/\([^.]*.c\)/\([^/]*\).*|$dir/\1:\2|p" $dir/CVS/Entries 2>/dev/null
done
fi |\
while read line; do
echo "REV_INFO+$i \"$line\""
i=`expr $i + 1`
done
echo "}"

View file

@ -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 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#define IDI_WINE 1 #define IDI_WINE 1
@ -24,6 +24,8 @@
#define IDD_ABOUT 101 #define IDD_ABOUT 101
#define IDD_TAG 102 #define IDD_TAG 102
#define IDC_STATIC -1
#define IDC_ST0 1000 #define IDC_ST0 1000
#define IDC_PB0 1001 #define IDC_PB0 1001
#define IDC_ST1 1002 #define IDC_ST1 1002
@ -40,6 +42,8 @@
#define IDC_EDIT 4000 #define IDC_EDIT 4000
#define IDC_ABOUT 4001 #define IDC_ABOUT 4001
#define IDS_BUILD_ID 1
/* Resource types */ /* Resource types */
#define TESTRES 1000 #define TESTRES 1000

View file

@ -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 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include <winsock.h> #include <winsock.h>
@ -107,7 +107,7 @@ send_file (const char *name)
SOCKET s; SOCKET s;
FILE *f; FILE *f;
#define BUFLEN 8192 #define BUFLEN 8192
unsigned char buffer[BUFLEN+1]; char buffer[BUFLEN+1];
size_t bytes_read, total, filesize; size_t bytes_read, total, filesize;
char *str; char *str;
int ret; int ret;
@ -137,11 +137,11 @@ send_file (const char *name)
} }
fseek (f, 0, SEEK_END); fseek (f, 0, SEEK_END);
filesize = ftell (f); filesize = ftell (f);
if (filesize > 1024*1024) { if (filesize > 1.5*1024*1024) {
report (R_WARNING, report (R_WARNING,
"File too big (%.1f MB > 1 MB); submitting partial report.", "File too big (%.1f MB > 1.5 MB); submitting partial report.",
filesize/1024.0/1024); filesize/1024.0/1024);
filesize = 1024*1024; filesize = 1.5*1024*1024;
} }
fseek (f, 0, SEEK_SET); fseek (f, 0, SEEK_SET);
@ -178,7 +178,7 @@ send_file (const char *name)
if (send_buf (s, body2, sizeof body2 - 1)) { if (send_buf (s, body2, sizeof body2 - 1)) {
report (R_WARNING, "Error sending trailer: %d, %d", report (R_WARNING, "Error sending trailer: %d, %d",
errno, WSAGetLastError ()); errno, WSAGetLastError ());
goto abort2; goto abort1;
} }
report (R_DELTA, 0, "Network transfer: Done"); report (R_DELTA, 0, "Network transfer: Done");

View file

@ -1,8 +1,8 @@
/* Automatically generated -- do not edit! */ /* Automatically generated -- do not edit! */
#include "resource.h" #include "resource.h"
STRINGTABLE { STRINGTABLE {
0 "advapi32_test.exe" 0 "advapi32_winetest.exe"
1 "comctl32_test.exe" 1 "comctl32_winetest.exe"
} }
0 TESTRES "../../../../../output-i386/regtests/winetest/advapi32/advapi32_test.exe" 0 TESTRES "output-i386/modules/rostests/winetests/advapi32/advapi32_winetest.exe"
1 TESTRES "output-i386/regtests/winetest/comctl32/comctl32_test.exe" 1 TESTRES "output-i386/modules/rostests/winetests/comctl32/comctl32_winetest.exe"

View file

@ -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 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include <unistd.h> #include <unistd.h>
@ -40,6 +40,13 @@ void *xrealloc (void *op, size_t len)
return p; return p;
} }
char *xstrdup( const char *str )
{
char *res = strdup( str );
if (!res) report (R_FATAL, "Out of memory.");
return res;
}
static char *vstrfmtmake (size_t *lenp, const char *fmt, va_list ap) static char *vstrfmtmake (size_t *lenp, const char *fmt, va_list ap)
{ {
size_t size = 1000; size_t size = 1000;

View file

@ -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 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#ifndef __WINETESTS_H #ifndef __WINETESTS_H
@ -30,6 +30,7 @@ void fatal (const char* msg);
void warning (const char* msg); void warning (const char* msg);
void *xmalloc (size_t len); void *xmalloc (size_t len);
void *xrealloc (void *op, size_t len); void *xrealloc (void *op, size_t len);
char *xstrdup( const char *str );
void xprintf (const char *fmt, ...); void xprintf (const char *fmt, ...);
char *vstrmake (size_t *lenp, va_list ap); char *vstrmake (size_t *lenp, va_list ap);
char *strmake (size_t *lenp, ...); char *strmake (size_t *lenp, ...);

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View file

@ -0,0 +1,19 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<module name="winetest" type="win32gui" installbase="system32" allowwarnings="true">
<include base="winetest">.</include>
<define name="_WIN32_IE">0x600</define>
<define name="_WIN32_WINNT">0x501</define>
<library>comctl32</library>
<library>version</library>
<library>user32</library>
<library>gdi32</library>
<library>advapi32</library>
<library>ws2_32</library>
<library>kernel32</library>
<file>gui.c</file>
<file>main.c</file>
<file>send.c</file>
<file>util.c</file>
<file>dist.rc</file>
</module>

View file

@ -15,16 +15,24 @@
* *
* 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 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include <windows.h> #include <windef.h>
#include <winres.h> #include <winuser.h>
#include <commctrl.h>
#include "resource.h" #include "resource.h"
#include "tests.rc"
#ifdef BUILD_SHA1
STRINGTABLE
BEGIN
IDS_BUILD_ID BUILD_SHA1
END
#endif
IDD_TAG DIALOG 0, 0, 150, 65 IDD_TAG DIALOG 0, 0, 150, 65
STYLE WS_POPUP STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "No tag supplied" CAPTION "No tag supplied"
BEGIN BEGIN
CTEXT "Please supply a tag for your report. You can use letters, digits, dashes and periods." CTEXT "Please supply a tag for your report. You can use letters, digits, dashes and periods."
@ -72,75 +80,90 @@ BEGIN
DEFPUSHBUTTON "Close", IDCANCEL, 55, 40, 40, 14 DEFPUSHBUTTON "Close", IDCANCEL, 55, 40, 40, 14
END END
/* BINRES wine.ico */ /* @makedep: winetest.ico */
IDI_WINE ICON "wine.ico" IDI_WINE ICON "winetest.ico"
/* {
'00 00 01 00 02 00 20 20 10 00 00 00 00 00 E8 02' /* list of tests (automatically generated by make_makefiles) */
'00 00 26 00 00 00 10 10 10 00 00 00 00 00 28 01'
'00 00 0E 03 00 00 28 00 00 00 20 00 00 00 40 00' /*
'00 00 01 00 04 00 00 00 00 00 00 02 00 00 00 00' advapi32_test.exe TESTRES "advapi32_test.exe"
'00 00 00 00 00 00 10 00 00 00 00 00 00 00 39 02' advpack_test.exe TESTRES "advpack_test.exe"
'B1 00 23 02 6C 00 0F 03 29 00 1B 02 51 00 FF FF' browseui_test.exe TESTRES "browseui_test.exe"
'FF 00 1B 1A 1B 00 1E 02 63 00 33 02 A1 00 08 08' cabinet_test.exe TESTRES "cabinet_test.exe"
'08 00 14 03 3C 00 0C 04 1E 00 2E 02 8E 00 10 0F' comcat_test.exe TESTRES "comcat_test.exe"
'10 00 2A 02 82 00 29 02 7D 00 03 02 04 00 44 44' comctl32_test.exe TESTRES "comctl32_test.exe"
'44 44 44 44 44 44 55 44 44 44 44 44 44 44 44 44' comdlg32_test.exe TESTRES "comdlg32_test.exe"
'44 44 44 44 8F FF 84 44 44 44 44 44 44 44 44 44' credui_test.exe TESTRES "credui_test.exe"
'44 44 44 8F F8 F8 44 44 44 44 44 44 44 44 44 44' crypt32_test.exe TESTRES "crypt32_test.exe"
'44 44 8F FF F5 44 44 44 44 44 44 44 44 44 44 44' cryptnet_test.exe TESTRES "cryptnet_test.exe"
'44 5C F8 C8 F5 44 44 44 44 44 44 44 44 44 44 44' d3d8_test.exe TESTRES "d3d8_test.exe"
'44 44 44 44 85 44 44 44 44 44 44 44 44 44 44 44' d3d9_test.exe TESTRES "d3d9_test.exe"
'44 44 44 44 4C 44 44 44 44 44 44 44 44 44 44 44' d3drm_test.exe TESTRES "d3drm_test.exe"
'44 44 44 44 4C 44 44 44 44 44 44 44 44 44 44 44' d3dx8_test.exe TESTRES "d3dx8_test.exe"
'44 44 44 44 45 54 44 44 44 44 44 44 44 44 44 44' d3dx9_36_test.exe TESTRES "d3dx9_36_test.exe"
'44 44 44 44 45 F4 44 44 44 44 44 44 44 44 44 44' ddraw_test.exe TESTRES "ddraw_test.exe"
'44 44 44 44 45 FF 44 44 44 44 44 44 44 44 44 44' dinput_test.exe TESTRES "dinput_test.exe"
'44 44 44 44 48 FF F4 44 44 44 44 44 44 44 44 44' dnsapi_test.exe TESTRES "dnsapi_test.exe"
'44 44 44 44 48 23 9A 84 44 44 44 44 44 44 44 44' dplayx_test.exe TESTRES "dplayx_test.exe"
'44 44 44 44 42 B7 7E AF 44 44 44 44 44 44 44 44' dsound_test.exe TESTRES "dsound_test.exe"
'44 44 44 44 49 00 00 EA C4 44 44 44 44 44 44 44' fusion_test.exe TESTRES "fusion_test.exe"
'44 44 44 44 46 00 00 01 F4 44 44 44 44 44 44 44' gdi32_test.exe TESTRES "gdi32_test.exe"
'44 44 44 44 46 00 00 00 9F 44 44 44 44 44 44 44' gdiplus_test.exe TESTRES "gdiplus_test.exe"
'44 44 44 44 46 00 70 00 EF 44 44 44 44 44 44 44' hlink_test.exe TESTRES "hlink_test.exe"
'44 44 44 44 43 00 00 00 79 F4 44 44 44 44 44 44' imm32_test.exe TESTRES "imm32_test.exe"
'44 44 44 44 49 00 00 00 0E F4 44 44 44 44 44 44' inetcomm_test.exe TESTRES "inetcomm_test.exe"
'44 44 44 44 42 00 00 00 07 24 44 44 44 44 44 44' infosoft_test.exe TESTRES "infosoft_test.exe"
'44 44 44 44 43 B0 00 00 00 34 44 44 44 44 44 44' iphlpapi_test.exe TESTRES "iphlpapi_test.exe"
'44 44 44 44 4C 30 00 00 00 1F 44 44 44 44 44 44' itss_test.exe TESTRES "itss_test.exe"
'44 44 44 44 48 27 E1 1D B1 2C 44 44 44 44 44 44' jscript_test.exe TESTRES "jscript_test.exe"
'44 44 44 44 44 A9 CC CF F8 48 C4 44 44 44 44 44' kernel32_test.exe TESTRES "kernel32_test.exe"
'44 44 44 44 44 58 44 44 44 45 C4 44 44 44 44 44' localspl_test.exe TESTRES "localspl_test.exe"
'44 44 44 44 44 4C 44 44 44 44 84 44 44 44 44 44' localui_test.exe TESTRES "localui_test.exe"
'44 44 44 44 44 48 44 44 44 44 C4 44 44 44 44 44' lz32_test.exe TESTRES "lz32_test.exe"
'44 44 44 44 44 48 C4 44 44 44 C4 44 44 44 44 44' mapi32_test.exe TESTRES "mapi32_test.exe"
'44 44 44 44 44 44 F4 44 44 4C C4 44 44 44 44 44' mlang_test.exe TESTRES "mlang_test.exe"
'44 44 44 44 44 44 84 44 F8 84 44 44 44 44 44 44' msacm32_test.exe TESTRES "msacm32_test.exe"
'44 44 44 44 44 44 48 F8 44 44 44 44 44 44 FF FF' mscms_test.exe TESTRES "mscms_test.exe"
'3F FF FF F0 7F FF FF C0 FF FF FF 03 FF FF FC 03' mshtml_test.exe TESTRES "mshtml_test.exe"
'FF FF FF F3 FF FF FF FB FF FF FF FB FF FF FF F9' msi_test.exe TESTRES "msi_test.exe"
'FF FF FF F9 FF FF FF F8 FF FF FF F8 7F FF FF F8' msvcrt_test.exe TESTRES "msvcrt_test.exe"
'1F FF FF F8 0F FF FF F8 07 FF FF F8 07 FF FF F8' msvcrtd_test.exe TESTRES "msvcrtd_test.exe"
'03 FF FF F8 03 FF FF F8 01 FF FF F8 01 FF FF F8' msxml3_test.exe TESTRES "msxml3_test.exe"
'01 FF FF F8 01 FF FF F8 00 FF FF F8 00 FF FF FC' netapi32_test.exe TESTRES "netapi32_test.exe"
'02 7F FF FC FE 7F FF FE FF 7F FF FE FF 7F FF FE' ntdll_test.exe TESTRES "ntdll_test.exe"
'7F 7F FF FF 7E 7F FF FF 71 FF FF FF 8F FF 28 00' ntdsapi_test.exe TESTRES "ntdsapi_test.exe"
'00 00 10 00 00 00 20 00 00 00 01 00 04 00 00 00' ntprint_test.exe TESTRES "ntprint_test.exe"
'00 00 80 00 00 00 00 00 00 00 00 00 00 00 10 00' odbccp32_test.exe TESTRES "odbccp32_test.exe"
'00 00 00 00 00 00 3A 02 B1 00 0A 06 14 00 12 03' ole32_test.exe TESTRES "ole32_test.exe"
'33 00 FF FF FF 00 12 12 12 00 0B 0B 0B 00 1B 1B' oleaut32_test.exe TESTRES "oleaut32_test.exe"
'1B 00 25 02 6F 00 2E 02 92 00 1A 02 52 00 36 02' opengl32_test.exe TESTRES "opengl32_test.exe"
'A6 00 15 03 3E 00 04 04 05 00 13 11 19 00 1E 02' pdh_test.exe TESTRES "pdh_test.exe"
'62 00 2A 02 82 00 33 33 33 CC 43 33 33 33 33 33' psapi_test.exe TESTRES "psapi_test.exe"
'CC 5C 33 33 33 33 33 36 C5 53 33 33 33 33 33 33' qedit_test.exe TESTRES "qedit_test.exe"
'33 43 33 33 33 33 33 33 33 65 33 33 33 33 33 33' qmgr_test.exe TESTRES "qmgr_test.exe"
'33 DC 33 33 33 33 33 33 33 17 EC 33 33 33 33 33' quartz_test.exe TESTRES "quartz_test.exe"
'33 B0 07 53 33 33 33 33 33 90 00 B3 33 33 33 33' riched20_test.exe TESTRES "riched20_test.exe"
'33 B0 00 FC 33 33 33 33 33 BA 00 A2 33 33 33 33' riched32_test.exe TESTRES "riched32_test.exe"
'33 C7 88 82 33 33 33 33 33 3D D5 14 43 33 33 33' rpcrt4_test.exe TESTRES "rpcrt4_test.exe"
'33 35 33 33 53 33 33 33 33 33 53 33 53 33 33 33' rsaenh_test.exe TESTRES "rsaenh_test.exe"
'33 33 C5 5C 33 33 FC 7F 00 00 F0 FF 00 00 E1 FF' schannel_test.exe TESTRES "schannel_test.exe"
'00 00 FD FF 00 00 FC FF 00 00 FC FF 00 00 FC 3F' secur32_test.exe TESTRES "secur32_test.exe"
'00 00 FC 1F 00 00 FC 1F 00 00 FC 0F 00 00 FC 0F' serialui_test.exe TESTRES "serialui_test.exe"
'00 00 FC 0F 00 00 FE 07 00 00 FE F7 00 00 FF 77' setupapi_test.exe TESTRES "setupapi_test.exe"
'00 00 FF 0F 00 00' shdocvw_test.exe TESTRES "shdocvw_test.exe"
} */ shell32_test.exe TESTRES "shell32_test.exe"
shlwapi_test.exe TESTRES "shlwapi_test.exe"
snmpapi_test.exe TESTRES "snmpapi_test.exe"
spoolss_test.exe TESTRES "spoolss_test.exe"
urlmon_test.exe TESTRES "urlmon_test.exe"
user32_test.exe TESTRES "user32_test.exe"
userenv_test.exe TESTRES "userenv_test.exe"
usp10_test.exe TESTRES "usp10_test.exe"
uxtheme_test.exe TESTRES "uxtheme_test.exe"
version_test.exe TESTRES "version_test.exe"
wininet_test.exe TESTRES "wininet_test.exe"
winmm_test.exe TESTRES "winmm_test.exe"
winspool.drv_test.exe TESTRES "winspool.drv_test.exe"
wintrust_test.exe TESTRES "wintrust_test.exe"
ws2_32_test.exe TESTRES "ws2_32_test.exe"
*/