* config (SEH): Remove.
* regtests/shared/regtests.c (_alloca): Remove; Use from malloca.h
instead.
(PerformTest): Use PSEH to catch exceptions while running tests.
* tools/config.mk (CONFIG): Don't add SEH.
* tools/helper.mk: Link tests with pseh.a.
svn path=/trunk/; revision=11714
#
3GB := 1
-#
-# Whether to use Structured Exception Handling
-#
-SEH := 0
-
#
# Which version of NDIS do we support up to?
#
* UPDATE HISTORY:
* 06-07-2003 CSH Created
*/
-#include <roscfg.h>
#include <ctype.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <malloc.h>
#define NTOS_MODE_USER
#include <ntos.h>
+#include <pseh.h>
#include "regtests.h"
#define NDEBUG
static LIST_ENTRY AllTests;
-void *_alloca(size_t size)
-{
- void *ret;
-
- asm ("movl %1, %%eax\n"
- "addl $3, %%eax\n"
- "andl $-4, %%eax\n"
- "subl %%eax, %%esp\n"
- "movl %%esp, %0\n"
- : "=m" (ret) : "m" (size) : "eax");
-
- return ret;
-}
-
VOID
InitializeTests()
{
}
}
-#ifdef SEH
- __try {
-#endif
+ _SEH_TRY {
_Result = TS_OK;
_Buffer = Buffer;
(Test->Routine)(TESTCMD_RUN);
-#ifdef SEH
- } __except(EXCEPTION_EXECUTE_HANDLER) {
+ } _SEH_HANDLE {
_Result = TS_FAILED;
- strcpy(Buffer, "Failed due to exception");
- }
-#endif
+ sprintf(Buffer, "due to exception 0x%lx", _SEH_GetExceptionCode());
+ } _SEH_END;
if (_Result != TS_OK)
{
CONFIG += ACPI
endif
-ifeq ($(SEH), 1)
-CONFIG += SEH
-endif
-
$(PATH_TO_TOP)/tools/mkconfig$(EXE_POSTFIX): $(PATH_TO_TOP)/tools/mkconfig.c
@$(HOST_CC) -g -o $(PATH_TO_TOP)/tools/mkconfig$(EXE_POSTFIX) $(PATH_TO_TOP)/tools/mkconfig.c
-# $Id: helper.mk,v 1.94 2004/11/02 19:47:18 gvg Exp $
+# $Id: helper.mk,v 1.95 2004/11/20 17:48:38 chorns Exp $
#
# Helper makefile for ReactOS modules
# Variables this makefile accepts:
ifeq ($(TARGET_TYPE),test)
run: all
@$(CC) -nostdlib -o _runtest.exe regtests.a $(TARGET_LIBS) _stubs.o \
- $(SDK_PATH_LIB)/rtshared.a $(SDK_PATH_LIB)/regtests.a _hooks.o -lgcc -lmsvcrt -lntdll
+ $(SDK_PATH_LIB)/rtshared.a $(SDK_PATH_LIB)/regtests.a $(SDK_PATH_LIB)/pseh.a \
+ _hooks.o -lgcc -lmsvcrt -lntdll
@$(CP) $(REGTESTS_PATH)/regtests/regtests.dll regtests.dll
@_runtest.exe
@$(RM) regtests.dll