2004-10-24 Casper S. Hornstrup <chorns@users.sourceforge.net>
[reactos.git] / reactos / regtests / regtests / regtests.c
index 40b0fb8..db0170b 100755 (executable)
@@ -1,89 +1,34 @@
 /*
  * PROJECT:         ReactOS kernel
  * FILE:            regtests/regtests/regtests.c
- * PURPOSE:         Regression testing host
+ * PURPOSE:         Regression testing framework
  * PROGRAMMER:      Casper S. Hornstrup (chorns@users.sourceforge.net)
  * UPDATE HISTORY:
- *      06-07-2003  CSH  Created
+ *      23-10-2004  CSH  Created
  */
-#define NTOS_MODE_USER
-#include <stdio.h>
-#include <ntos.h>
-#include "regtests.h"
+#include <windows.h>
 
-#define OUPUT_MODE_DbgPrint 0
-#define OUPUT_MODE_OutputDebugString 1
-#define OUPUT_MODE_printf 2
-
-static int OutputMode = 0;
-
-static void OutputRoutine(char *Buffer)
+HMODULE STDCALL
+_GetModuleHandleA(LPCSTR lpModuleName)
 {
-  if (OutputMode == OUPUT_MODE_DbgPrint)
-    {
-      DbgPrint(Buffer);
-    }
-  else if (OutputMode == OUPUT_MODE_OutputDebugString)
-    {
-      OutputDebugString(Buffer);
-    }
-  else if (OutputMode == OUPUT_MODE_printf)
-    {
-      printf(Buffer);
-    }
+  return GetModuleHandleA(lpModuleName);
 }
 
-static VOID
-RunTestDriver(LPSTR FileName, LPSTR TestName)
+FARPROC STDCALL
+_GetProcAddress(HMODULE hModule,
+  LPCSTR lpProcName)
 {
-  TestDriverMain Main;
-  HMODULE hModule;
-
-  hModule = LoadLibrary(FileName);
-  if (hModule != NULL) 
-    { 
-        Main = (TestDriverMain) GetProcAddress(hModule, "RegTestMain");
-        if (Main != NULL)
-          {
-            (Main)(OutputRoutine, TestName);
-          }
-        FreeLibrary(hModule); 
-    }
+  return GetProcAddress(hModule, lpProcName);
 }
 
-int
-main(int argc, char* argv[])
+HINSTANCE STDCALL
+_LoadLibraryA(LPCSTR lpLibFileName)
 {
-  LPSTR testname = NULL;
-  int i;
-
-  if (argc > 1)
-    {
-      i = 1;
-      if (argv[i][0] == '-')
-        {
-          switch (argv[i][1])
-            {
-              case 'd':
-                OutputMode = OUPUT_MODE_DbgPrint;
-                break;
-              case 'o':
-                OutputMode = OUPUT_MODE_OutputDebugString;
-                break;
-              case 'p':
-                OutputMode = OUPUT_MODE_printf;
-                break;
-              default:
-                printf("Usage: regtests [-dop] [testname]");
-                return 0;
-            }
-          i++;
-        }
-
-      testname = argv[i];
-    }
+  return LoadLibraryA(lpLibFileName);
+}
 
-  RunTestDriver("win32base.dll", testname);
-  RunTestDriver("kmrtint.dll", testname);
-  return 0;
+VOID STDCALL
+_ExitProcess(UINT uExitCode)
+{
+  ExitProcess(uExitCode);
 }