* lib/gdiplus/makefile (TARGET_BUILDENV_TEST): Remove.
(TARGET_TYPE): Set to test.
* lib/kernel32/makefile: Ditto.
* subsys/win32k/makefile: Ditto.
* tools/helper.mk (TARGET_BUILDENV_TEST): Remove.
(TARGET_TYPE): New value test.
* regtests/shared/regtests.c (_Result, _Buffer): Add.
* regtests/shared/regtests.h (_Result, _Buffer): Declare extern.
(TestRoutine): Make void return type and remove Buffer parameter.
(FAIL*): Remove.
svn path=/trunk/; revision=11356
+2004-10-20 Casper S. Hornstrup <chorns@users.sourceforge.net>
+
+ * lib/gdiplus/makefile (TARGET_BUILDENV_TEST): Remove.
+ (TARGET_TYPE): Set to test.
+ * lib/kernel32/makefile: Ditto.
+ * subsys/win32k/makefile: Ditto.
+ * tools/helper.mk (TARGET_BUILDENV_TEST): Remove.
+ (TARGET_TYPE): New value test.
+ * regtests/shared/regtests.c (_Result, _Buffer): Add.
+ * regtests/shared/regtests.h (_Result, _Buffer): Declare extern.
+ (TestRoutine): Make void return type and remove Buffer parameter.
+ (FAIL*): Remove.
+
2004-10-18 Casper S. Hornstrup <chorns@users.sourceforge.net>
* lib/kernel32/makefile (TARGET_BUILDENV_TEST): Set to yes.
TARGET_REGTESTS = yes
-TARGET_BUILDENV_TEST = yes
-
TARGET_TYPE = dynlink
TARGET_NAME = gdiplus
PATH_TO_TOP = ../../..
-TARGET_TYPE = library
+TARGET_TYPE = test
TARGET_NAME = regtests
-D_WIN32_WINNT=0x0501 \
-I$(REGTESTS_PATH_INC)
+TARGET_LIBS = ../gdiplus.a
+
-include Makefile.tests
TARGET_OBJECTS = \
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
-
-LIBS = ../gdiplus.a
-
-run: all
- @$(CC) -o _runtest.exe _rtstub.o regtests.a $(SDK_PATH_LIB)/rtshared.a $(LIBS) -lntdll
- @_runtest.exe
- @$(RM) _runtest.exe
-# $Id: makefile,v 1.88 2004/10/18 19:11:07 chorns Exp $
+# $Id: makefile,v 1.89 2004/10/20 20:51:21 chorns Exp $
PATH_TO_TOP = ../..
TARGET_REGTESTS = yes
-TARGET_BUILDENV_TEST = yes
-
TARGET_TYPE = dynlink
TARGET_NAME = kernel32
-# $Id: Makefile,v 1.2 2004/10/18 19:11:07 chorns Exp $
+# $Id: Makefile,v 1.3 2004/10/20 20:51:21 chorns Exp $
PATH_TO_TOP = ../../..
-TARGET_TYPE = library
+TARGET_TYPE = test
TARGET_NAME = regtests
TARGET_CFLAGS = -I$(REGTESTS_PATH_INC)
+TARGET_LIBS = ../kernel32.a
+
-include Makefile.tests
TARGET_OBJECTS = \
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
-
-LIBS = ../kernel32.a
-
-run: all
- @$(CC) -o _runtest.exe _rtstub.o regtests.a $(SDK_PATH_LIB)/rtshared.a $(LIBS) -lntdll
- @_runtest.exe
- @$(RM) _runtest.exe
_AssertEqualValue(NO_ERROR, GetLastError());
_AssertEqualValue(TestHandle, FileHandle);
}
- _ResetAllHooks();
+ _UnsetAllHooks();
}
static void RunTest()
#define NDEBUG
#include <debug.h>
-LIST_ENTRY AllTests;
+int _Result;
+char *_Buffer;
+
+static LIST_ENTRY AllTests;
int
DriverTest()
char OutputBuffer[5000];
char Buffer[5000];
char Name[200];
- int Result;
- memset(Name, 0, sizeof(Name));
memset(Buffer, 0, sizeof(Buffer));
+ memset(Name, 0, sizeof(Name));
- if (!((Test->Routine)(TESTCMD_TESTNAME, Name) == 0))
+ _Result = TS_OK;
+ _Buffer = Name;
+ (Test->Routine)(TESTCMD_TESTNAME);
+ if (_Result != TS_OK)
{
if (TestName != NULL)
{
#ifdef SEH
__try {
#endif
- Result = (Test->Routine)(TESTCMD_RUN, Buffer);
+ _Result = TS_OK;
+ _Buffer = Buffer;
+ (Test->Routine)(TESTCMD_RUN);
#ifdef SEH
} __except(EXCEPTION_EXECUTE_HANDLER) {
Result = TS_FAILED;
}
#endif
- if (Result != TS_OK)
+ if (_Result != TS_OK)
{
sprintf(OutputBuffer, "ROSREGTEST: |%s| Status: Failed (%s)\n", Name, Buffer);
}
#define TS_OK 0
#define TS_FAILED 1
-static int _Result;
-static char *_Buffer;
+extern int _Result;
+extern char *_Buffer;
/* Macros to simplify tests */
#define DISPATCHER(FunctionName, TestName) \
-int \
-FunctionName(int Command, \
- char *Buffer) \
+void \
+FunctionName(int Command) \
{ \
switch (Command) \
{ \
- case TESTCMD_RUN: \
- _Result = TS_OK; \
- _Buffer = Buffer; \
- RunTest(); \
- return _Result; \
- case TESTCMD_TESTNAME: \
- strcpy(Buffer, TestName); \
- return TS_OK; \
- default: \
- break; \
+ case TESTCMD_RUN: \
+ RunTest(); \
+ break; \
+ case TESTCMD_TESTNAME: \
+ strcpy(_Buffer, TestName); \
+ break; \
+ default: \
+ _Result = TS_FAILED; \
+ break; \
} \
- return TS_FAILED; \
}
-#define FAIL(ErrorMessage) \
- sprintf(Buffer, "%s\n", ErrorMessage); \
- return TS_FAILED;
-
-#define FAIL_IF_NULL(GivenValue, ErrorMessage) if (GivenValue == NULL) { FAIL(ErrorMessage); }
-#define FAIL_IF_TRUE(GivenValue, ErrorMessage) if (GivenValue == TRUE) { FAIL(ErrorMessage); }
-#define FAIL_IF_FALSE(GivenValue, ErrorMessage) if (GivenValue == FALSE) { FAIL(ErrorMessage); }
-#define FAIL_IF_EQUAL(GivenValue, FailValue, ErrorMessage) if (GivenValue == FailValue) { FAIL(ErrorMessage); }
-#define FAIL_IF_NOT_EQUAL(GivenValue, FailValue, ErrorMessage) if (GivenValue != FailValue) { FAIL(ErrorMessage); }
-#define FAIL_IF_LESS_EQUAL(GivenValue, FailValue, ErrorMessage) if (GivenValue <= FailValue) { FAIL(ErrorMessage); }
-#define FAIL_IF_GREATER_EQUAL(GivenValue, FailValue, ErrorMessage) if (GivenValue >= FailValue) { FAIL(ErrorMessage); }
-
-static inline void AppendAssertion(char *message)
+static inline void
+AppendAssertion(char *message)
{
if (strlen(_Buffer) != 0)
strcat(_Buffer, "\n");
/*
* Test routine prototype
* Command - The command to process
- * Buffer - Pointer to buffer in which to return context information
*/
-typedef int (*TestRoutine)(int Command, char *Buffer);
+typedef void (*TestRoutine)(int Command);
/*
* Test output routine prototype
}
static inline VOID
-_ResetAllHooks()
+_UnsetAllHooks()
{
PAPI_DESCRIPTION api;
ULONG index;
-# $Id: makefile,v 1.103 2004/10/18 19:11:09 chorns Exp $
+# $Id: makefile,v 1.104 2004/10/20 20:51:21 chorns Exp $
PATH_TO_TOP = ../..
TARGET_REGTESTS = yes
-TARGET_BUILDENV_TEST = yes
-
FREETYPE_DIR = $(PATH_TO_TOP)/lib/freetype
include $(PATH_TO_TOP)/config
PATH_TO_TOP = ../../..
-TARGET_TYPE = library
+TARGET_TYPE = test
TARGET_NAME = regtests
-D__USE_W32API \
-D_WIN32K_
+TARGET_LIBS = ../win32k.a
+
-include Makefile.tests
TARGET_OBJECTS = \
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
-
-LIBS = ../win32k.a
-
-run: all
- @$(CC) -o _runtest.exe _rtstub.o regtests.a $(SDK_PATH_LIB)/rtshared.a $(LIBS) -lntdll
- @_runtest.exe
- @$(RM) _runtest.exe
-# $Id: helper.mk,v 1.88 2004/10/20 20:31:35 gvg Exp $
+# $Id: helper.mk,v 1.89 2004/10/20 20:51:21 chorns Exp $
#
# Helper makefile for ReactOS modules
# Variables this makefile accepts:
# kmdll = Kernel mode DLL
# winedll = DLL imported from wine
# kernel = ReactOS kernel
+# test = ReactOS test
# $TARGET_APPTYPE = Application type (windows,native,console).
# Required only for TARGET_TYPEs program and proglib
# $TARGET_NAME = Base name of output file and .rc, .def, and .edf files
# $TARGET_BOOTSTRAP = Whether this file is needed to bootstrap the installation (no,yes) (optional)
# $TARGET_BOOTSTRAP_NAME = Name on the installation medium (optional)
# $TARGET_REGTESTS = This module has regression tests (no,yes) (optional)
-# $TARGET_BUILDENV_TEST = Build this test to be run in the build environment (no,yes) (optional)
# $SUBDIRS = Subdirs in which to run make (optional)
include $(PATH_TO_TOP)/config
MK_RES_BASE := $(TARGET_NAME)
endif
+ifeq ($(TARGET_TYPE),test)
+ TARGET_NORC := yes
+ MK_MODE := static
+ MK_EXETYPE :=
+ MK_DEFEXT := .a
+ MK_DEFENTRY :=
+ MK_DDKLIBS :=
+ MK_SDKLIBS :=
+ MK_CFLAGS := -I.
+ MK_CPPFLAGS := -I.
+ MK_IMPLIB := no
+ MK_IMPLIBONLY := no
+ MK_IMPLIBDEFPATH :=
+ MK_IMPLIB_EXT :=
+ MK_INSTALLDIR := # none
+ MK_BOOTCDDIR := system32
+ MK_DISTDIR := # none
+ MK_RES_BASE :=
+endif
+
# can be overidden with $(CXX) for linkage of c++ executables
LD_CC = $(CC)
endif
ifeq ($(TARGET_REGTESTS),yes)
-ifeq ($(TARGET_BUILDENV_TEST),yes)
REGTEST_TARGETS := tests/_hooks.c tests/_regtests.c tests/_stubs.S tests/Makefile.tests tests/_rtstub.c
MK_REGTESTS_CLEAN := clean_regtests
-else
- REGTEST_TARGETS := tests/_regtests.c tests/Makefile.tests tests/_rtstub.c
-ifeq ($(MK_MODE),user)
- MK_LIBS := $(SDK_PATH_LIB)/rtshared.a $(MK_LIBS)
-endif
- MK_REGTESTS_CLEAN := clean_regtests
- MK_OBJECTS += tests/_rtstub.o tests/regtests.a
- TARGET_CFLAGS += -I$(REGTESTS_PATH_INC)
-endif
else
REGTEST_TARGETS :=
MK_REGTESTS_CLEAN :=
REGTEST_TESTS = $(wildcard tests/tests/*.c)
$(REGTEST_TARGETS): $(REGTEST_TESTS)
-ifeq ($(TARGET_BUILDENV_TEST),yes)
$(REGTESTS) ./tests/tests ./tests/_regtests.c ./tests/Makefile.tests -e ./tests/_rtstub.c
$(REGTESTS) -s ./tests/stubs.tst ./tests/_stubs.S ./tests/_hooks.c
-else
-ifeq ($(MK_MODE),user)
- $(REGTESTS) ./tests/tests ./tests/_regtests.c ./tests/Makefile.tests -u ./tests/_rtstub.c
- $(MAKE) -C tests TARGET_REGTESTS=no all
-else
-ifeq ($(MK_MODE),kernel)
- $(REGTESTS) ./tests/tests ./tests/_regtests.c ./tests/Makefile.tests -k ./tests/_rtstub.c
- $(MAKE) -C tests TARGET_REGTESTS=no all
-endif
-endif
-endif
clean_regtests:
-ifeq ($(TARGET_BUILDENV_TEST),yes)
- $(MAKE) -C tests TARGET_REGTESTS=no clean
- $(RM) ./tests/_rtstub.c ./tests/_hooks.c ./tests/_regtests.c ./tests/_stubs.S ./tests/Makefile.tests
-else
- $(MAKE) -C tests TARGET_REGTESTS=no clean
- $(RM) ./tests/_rtstub.c ./tests/_regtests.c ./tests/_hooks.c ./tests/_stubs.S ./tests/Makefile.tests
-endif
.PHONY: all depends implib clean install dist bootcd depends gen_regtests clean_regtests
endif
ifeq ($(TARGET_REGTESTS),yes)
-ifeq ($(TARGET_BUILDENV_TEST),yes)
test: all
$(MAKE) -C tests run
else
test:
-
endif
-else
-test:
- -
+
+ifeq ($(TARGET_TYPE),test)
+run: all
+ @$(CC) -o _runtest.exe _rtstub.o regtests.a $(SDK_PATH_LIB)/rtshared.a $(TARGET_LIBS) -lntdll
+ @_runtest.exe
+ @$(RM) _runtest.exe
endif