* config (REGRESSIONTESTS): Remove.
* tools/config.mk: Update.
* lib/kernel32/misc/dllmain.c: Update.
* drivers/net/tcpip/tests/Makefile (TARGET_OBJECTS): Add setup.o.
* lib/gdiplus/tests/Makefile (TARGET_OBJECTS): Ditto.
* lib/kernel32/tests/Makefile (TARGET_OBJECTS): Ditto.
* lib/ws2_32/tests/Makefile (TARGET_OBJECTS): Ditto.
* subsys/win32k/tests/makefile (TARGET_OBJECTS): Ditto.
* regtests/shared/regtests.h (SetupOnce, _SetupOnce): Declare.
(DISPATCHER): Rename to _Dispatcher.
* lib/gdiplus/tests/tests/test-1.c: Update.
* lib/kernel32/tests/tests/CreateFile.c: Ditto.
* lib/ws2_32/tests/tests/WinsockEvent.c: Ditto.
* subsys/win32k/tests/tests/eng-mem-1.c: Ditto.
* tools/helper.mk: Be quiet when building tests.
* tools/regtests.c: Remove unused code.
* drivers/net/tcpip/tests/setup.c: New file.
* lib/gdiplus/tests/setup.c: Ditto.
* lib/kernel32/tests/setup.c: Ditto.
* lib/ws2_32/tests/setup.c: Ditto.
* subsys/win32k/tests/setup.c: Ditto.
svn path=/trunk/; revision=11414
+2004-10-24 Casper S. Hornstrup <chorns@users.sourceforge.net>
+
+ * config (REGRESSIONTESTS): Remove.
+ * tools/config.mk: Update.
+ * lib/kernel32/misc/dllmain.c: Update.
+ * drivers/net/tcpip/tests/Makefile (TARGET_OBJECTS): Add setup.o.
+ * lib/gdiplus/tests/Makefile (TARGET_OBJECTS): Ditto.
+ * lib/kernel32/tests/Makefile (TARGET_OBJECTS): Ditto.
+ * lib/ws2_32/tests/Makefile (TARGET_OBJECTS): Ditto.
+ * subsys/win32k/tests/makefile (TARGET_OBJECTS): Ditto.
+ * regtests/shared/regtests.h (SetupOnce, _SetupOnce): Declare.
+ (DISPATCHER): Rename to _Dispatcher.
+ * lib/gdiplus/tests/tests/test-1.c: Update.
+ * lib/kernel32/tests/tests/CreateFile.c: Ditto.
+ * lib/ws2_32/tests/tests/WinsockEvent.c: Ditto.
+ * subsys/win32k/tests/tests/eng-mem-1.c: Ditto.
+ * tools/helper.mk: Be quiet when building tests.
+ * tools/regtests.c: Remove unused code.
+ * drivers/net/tcpip/tests/setup.c: New file.
+ * lib/gdiplus/tests/setup.c: Ditto.
+ * lib/kernel32/tests/setup.c: Ditto.
+ * lib/ws2_32/tests/setup.c: Ditto.
+ * subsys/win32k/tests/setup.c: Ditto.
+
2004-10-23 Casper S. Hornstrup <chorns@users.sourceforge.net>
* Makefile: Support regtests_implib.
#
3GB := 1
-#
-# Whether to build regression tests
-#
-REGRESSIONTESTS := 0
-
#
# Whether to use Structured Exception Handling
#
-include Makefile.tests
-TARGET_OBJECTS = $(addprefix tests/, $(TESTS))
+TARGET_OBJECTS = \
+ setup.o \
+ $(addprefix tests/, $(TESTS))
include $(PATH_TO_TOP)/rules.mak
--- /dev/null
+#include "regtests.h"
+
+_SetupOnce()
+{
+}
-include Makefile.tests
-TARGET_OBJECTS = $(addprefix tests/, $(TESTS))
+TARGET_OBJECTS = \
+ setup.o \
+ $(addprefix tests/, $(TESTS))
include $(PATH_TO_TOP)/rules.mak
--- /dev/null
+#include "regtests.h"
+
+extern BOOL
+STDCALL
+DllMain(HANDLE hInstDll,
+ ULONG dwReason,
+ LPVOID lpReserved);
+
+_SetupOnce()
+{
+ DllMain(NULL, DLL_PROCESS_ATTACH, NULL);
+}
{
}
-DISPATCHER(Test_1Test, "Test 1")
+_Dispatcher(Test_1Test, "Test 1")
-/* $Id: dllmain.c,v 1.36 2004/08/24 17:21:11 navaraf Exp $
+/* $Id: dllmain.c,v 1.37 2004/10/24 12:39:53 chorns Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
/* INCLUDES ******************************************************************/
-#include <roscfg.h>
#include <k32.h>
#define NDEBUG
case DLL_PROCESS_ATTACH:
DPRINT("DLL_PROCESS_ATTACH\n");
-#if !defined(REGTESTS)
- /*
- * When running regression tests, this module need to receive
- * thread attach/detach notifications. This is needed because
- * the module is already loaded when the regression test suite
- * driver would load this module using LoadLibrary() so a
- * DLL_PROCESS_ATTACH notification is not sent. The regression
- * test suite driver sends thread notifications instead in this
- * case.
- */
LdrDisableThreadCalloutsForDll ((PVOID)hDll);
-#endif
/*
* Connect to the csrss server
-# $Id: Makefile,v 1.4 2004/10/23 21:05:11 chorns Exp $
+# $Id: Makefile,v 1.5 2004/10/24 12:39:53 chorns Exp $
PATH_TO_TOP = ../../..
-include Makefile.tests
-TARGET_OBJECTS = $(addprefix tests/, $(TESTS))
+TARGET_OBJECTS = \
+ setup.o \
+ $(addprefix tests/, $(TESTS))
include $(PATH_TO_TOP)/rules.mak
--- /dev/null
+#include "regtests.h"
+
+_SetupOnce()
+{
+}
TestFile();
}
-DISPATCHER(CreatefileTest, "CreateFileW")
+_Dispatcher(CreatefileTest, "CreateFileW")
-include Makefile.tests
-TARGET_OBJECTS = $(addprefix tests/, $(TESTS))
+TARGET_OBJECTS = \
+ setup.o \
+ $(addprefix tests/, $(TESTS))
include $(PATH_TO_TOP)/rules.mak
--- /dev/null
+#include "regtests.h"
+
+extern BOOL
+STDCALL
+DllMain(HANDLE hInstDll,
+ ULONG dwReason,
+ LPVOID lpReserved);
+
+_SetupOnce()
+{
+ DllMain(NULL, DLL_PROCESS_ATTACH, NULL);
+}
TestWSACloseEventFailure();
}
-extern BOOL
-STDCALL
-DllMain(HANDLE hInstDll,
- ULONG dwReason,
- LPVOID lpReserved);
-
static void
RunTest()
{
WSADATA WSAData;
- DllMain(NULL, DLL_PROCESS_ATTACH, NULL);
WSAStartup(MAKEWORD(2, 0), &WSAData);
TestWSACloseEvent();
WSACleanup();
}
-DISPATCHER(WinsockeventTest, "Winsock 2 event")
+_Dispatcher(WinsockeventTest, "Winsock 2 event")
#include <string.h>
#include <windows.h>
+extern void SetupOnce();
+
+#define _SetupOnce() \
+void SetupOnce()
+
/* Valid values for Command parameter of TestRoutine */
#define TESTCMD_RUN 0 /* Buffer contains information about what failed */
#define TESTCMD_TESTNAME 1 /* Buffer contains description of test */
extern char *_Buffer;
/* Macros to simplify tests */
-#define DISPATCHER(FunctionName, TestName) \
+#define _Dispatcher(FunctionName, TestName) \
void \
FunctionName(int Command) \
{ \
-include Makefile.tests
-TARGET_OBJECTS = $(addprefix tests/, $(TESTS))
+TARGET_OBJECTS = \
+ setup.o \
+ $(addprefix tests/, $(TESTS))
include $(PATH_TO_TOP)/rules.mak
--- /dev/null
+#include "regtests.h"
+
+_SetupOnce()
+{
+}
#endif
}
-DISPATCHER(Eng_mem_1Test, "Win32k Engine Memory API")
+_Dispatcher(Eng_mem_1Test, "Win32k Engine Memory API")
CONFIG += ACPI
endif
-ifeq ($(REGRESSIONTESTS), 1)
-CONFIG += REGTESTS
-endif
-
ifeq ($(SEH), 1)
CONFIG += SEH
endif
-# $Id: helper.mk,v 1.91 2004/10/23 21:05:12 chorns Exp $
+# $Id: helper.mk,v 1.92 2004/10/24 12:39:54 chorns Exp $
#
# Helper makefile for ReactOS modules
# Variables this makefile accepts:
endif
$(MK_BASENAME).a: $(MK_OBJECTS)
- $(AR) -r $(MK_BASENAME).a $(MK_OBJECTS)
+ $(AR) -rc $(MK_BASENAME).a $(MK_OBJECTS)
$(MK_NOSTRIPNAME): $(MK_EXTRADEP) $(MK_FULLRES) $(MK_BASENAME).a $(MK_LIBS)
ifeq ($(MK_EXETYPE),dll)
endif
$(MK_BASENAME).a: $(MK_OBJECTS)
- $(AR) -r $(MK_BASENAME).a $(MK_OBJECTS)
+ $(AR) -rc $(MK_BASENAME).a $(MK_OBJECTS)
$(MK_NOSTRIPNAME): $(MK_EXTRADEP) $(MK_FULLRES) $(MK_BASENAME).a $(MK_LIBS)
$(LD_CC) -Wl,--base-file,base.tmp \
ifeq ($(MK_MODE),static)
$(MK_FULLNAME): $(MK_EXTRADEP) $(MK_OBJECTS)
- $(AR) -r $(MK_FULLNAME) $(MK_OBJECTS)
- @echo $(MK_BASENAME)$(MK_EXT) was successfully built.
+ $(AR) -rc $(MK_FULLNAME) $(MK_OBJECTS)
+ifneq ($(TARGET_TYPE),test)
+ @echo $(MK_FULLNAME) was successfully built.
+endif
# Static libraries dont have a nostrip version
$(MK_NOSTRIPNAME):
static char *path;
static char *file;
static char *makefile;
-static char *umstubfile;
-static char *kmstubfile;
static char *exestubfile;
static char*
return 0;
}
-static char KMSTUB[] =
- "/* This file is autogenerated. */\n"
- "\n"
- "#include <roskrnl.h>\n"
- "#include <../kmregtests/kmregtests.h>\n"
- "\n"
- "typedef int (*TestRoutine)(int Command, char *Buffer);\n"
- "\n"
- "extern void RegisterTests();\n"
- "\n"
- "static PDEVICE_OBJECT KMRegTestsDeviceObject = NULL;\n"
- "static PFILE_OBJECT KMRegTestsFileObject = NULL;\n"
- "\n"
- "void AddTest(TestRoutine Routine)\n"
- "{\n"
- " UNICODE_STRING DriverName;\n"
- " IO_STATUS_BLOCK IoStatus;\n"
- " NTSTATUS Status;\n"
- " KEVENT Event;\n"
- " PIRP Irp;\n"
- "\n"
- " if (KMRegTestsDeviceObject == NULL)\n"
- " {\n"
- " RtlInitUnicodeString(&DriverName, L\"\\\\Device\\\\KMRegTests\");\n"
- " Status = IoGetDeviceObjectPointer(&DriverName, FILE_WRITE_ATTRIBUTES,\n"
- " &KMRegTestsFileObject, &KMRegTestsDeviceObject);\n"
- " if (!NT_SUCCESS(Status)) return;\n"
- " }\n"
- " KeInitializeEvent(&Event, NotificationEvent, FALSE);\n"
- " Irp = IoBuildDeviceIoControlRequest(IOCTL_KMREGTESTS_REGISTER,\n"
- " KMRegTestsDeviceObject, &Routine, sizeof(TestRoutine), NULL, 0, FALSE, &Event, &IoStatus);\n"
- " Status = IoCallDriver(KMRegTestsDeviceObject, Irp);\n"
- "}\n"
- "\n"
- "void PrepareTests()\n"
- "{\n"
- " RegisterTests();\n"
- "}\n";
-
-static char UMSTUB[] =
- "/* This file is autogenerated. */\n"
- "\n"
- "#include <windows.h>\n"
- "#define NTOS_MODE_USER\n"
- "#include <ntos.h>\n"
- "#include \"regtests.h\"\n"
- "\n"
- "PVOID\n"
- "AllocateMemory(ULONG Size)\n"
- "{\n"
- " return (PVOID) RtlAllocateHeap(RtlGetProcessHeap(), 0, Size);\n"
- "}\n"
- "\n"
- "VOID\n"
- "FreeMemory(PVOID Base)\n"
- "{\n"
- " RtlFreeHeap(RtlGetProcessHeap(), 0, Base);\n"
- "}\n"
- "\n"
- "/* This function will be called several times */\n"
- "void PrepareTests()\n"
- "{\n"
- " static int testsRegistered = 0;\n"
- " if (testsRegistered == 0)\n"
- " {\n"
- " HANDLE hEvent;\n"
- " hEvent = OpenEventW(\n"
- " EVENT_ALL_ACCESS,\n"
- " FALSE,\n"
- " L\"WinRegTests\");\n"
- " if (hEvent != NULL)\n"
- " {\n"
- " SetEvent(hEvent);\n"
- " CloseHandle(hEvent);\n"
- " testsRegistered = 1;\n"
- " InitializeTests();\n"
- " RegisterTests();\n"
- " PerformTests(NULL, NULL);\n"
- " }\n"
- " }\n"
- "}\n";
-
static char EXESTUB[] =
"/* This file is autogenerated. */\n"
"\n"
"{\n"
" InitializeTests();\n"
" RegisterTests();\n"
+ " SetupOnce();\n"
" PerformTests(ConsoleWrite, NULL);\n"
" NtTerminateProcess (NtCurrentProcess(), 0);\n"
" return 0;\n"
"ULONG MaxExternalDependency = ExternalDependencyCount - 1;\n";
static char HELP[] =
- "REGTESTS path file makefile [-u umstubfile] [-k kmstubfile] [-e exestubfile]\n"
+ "REGTESTS path file makefile [-e exestubfile]\n"
"REGTESTS -s stublistfile stubsfile hooksfile\n"
"\n"
" path Path to files\n"
" file Registration file to create\n"
" makefile Makefile to create\n"
- " umstubfile Optional stub for running tests internal to a user-mode module\n"
- " kmstubfile Optional stub for running tests internal to a kernel-mode module\n"
- " exestubfile Optional stub for running tests internal to a module in the build environment\n"
+ " exestubfile Optional stub for running tests in the build environment\n"
" stublistfile File with descriptions of stubs\n"
" stubsfile File with stubs to create\n"
" hooksfile File with hooks to create\n";
return 1;
}
- umstubfile = NULL;
- kmstubfile = NULL;
exestubfile = NULL;
for (i = 4; i < argc; i++)
{
if (argv[i][0] == '-')
{
- if (argv[i][1] == 'u')
- {
- umstubfile = convert_path(argv[++i]);
- if (umstubfile[0] == 0)
- {
- printf("Missing umstubfile\n");
- return 1;
- }
- }
- else if (argv[i][1] == 'k')
- {
- kmstubfile = convert_path(argv[++i]);
- if (kmstubfile[0] == 0)
- {
- printf("Missing kmstubfile\n");
- return 1;
- }
- }
- else if (argv[i][1] == 'e')
- {
- exestubfile = convert_path(argv[++i]);
- if (exestubfile[0] == 0)
- {
- printf("Missing exestubfile\n");
- return 1;
- }
- }
- else
- {
- printf("Unknown switch\n");
- return 1;
- }
+ if (argv[i][1] == 'e')
+ {
+ exestubfile = convert_path(argv[++i]);
+ if (exestubfile[0] == 0)
+ {
+ printf("Missing exestubfile\n");
+ return 1;
+ }
+ }
+ else
+ {
+ printf("Unknown switch -%c\n", argv[i][1]);
+ return 1;
+ }
}
}
fclose(out);
- /* User-mode stubfile */
- if (umstubfile != NULL)
- {
- if (write_file_if_changed(umstubfile, UMSTUB) != 0)
- {
- perror("Cannot create output user-mode stubfile");
- return 1;
- }
- }
-
- /* Kernel-mode stubfile */
- if (kmstubfile != NULL)
- {
- if (write_file_if_changed(kmstubfile, KMSTUB) != 0)
- {
- perror("Cannot create output kernel-mode stubfile");
- return 1;
- }
- }
-
/* Executable stubfile */
if (exestubfile != NULL)
{