[ofa-general] [PATCH 3/5] [DAPL] dapl/test: merge WinOF changes to dtest

Sean Hefty sean.hefty at intel.com
Fri Jan 30 10:56:26 PST 2009


Changes to dtest to support building on Windows.

Signed-off-by: Sean Hefty <sean.hefty at intel.com>
---

 test/dirs                           |    2 +
 test/dtest/SOURCES                  |   34 -------------------------
 test/dtest/dirs                     |    1 +
 test/dtest/dtest.c                  |    4 +--
 test/dtest/dtest.rc                 |   48 -----------------------------------
 test/dtest/dtestx.c                 |    2 +
 test/dtest/makefile.am              |    7 -----
 test/dtest/windows/dirs             |    1 +
 test/dtest/windows/dtest/SOURCES    |   33 ++++++++++++++++++++++++
 test/dtest/windows/dtest/dtest.c    |    2 +
 test/dtest/windows/dtest/dtest.rc   |   48 +++++++++++++++++++++++++++++++++++
 test/dtest/windows/dtest/makefile   |    7 +++++
 test/dtest/windows/dtestx/SOURCES   |   28 ++++++++++++++++++++
 test/dtest/windows/dtestx/dtestx.c  |    1 +
 test/dtest/windows/dtestx/dtestx.rc |   48 +++++++++++++++++++++++++++++++++++
 test/dtest/windows/dtestx/makefile  |    7 +++++
 16 files changed, 180 insertions(+), 93 deletions(-)

diff --git a/test/dirs b/test/dirs
index cf0ef2b..b6232e9 100644
--- a/test/dirs
+++ b/test/dirs
@@ -1 +1 @@
-DIRS=dapltest dtest dtestx
+DIRS = dapltest dtest
diff --git a/test/dtest/SOURCES b/test/dtest/SOURCES
deleted file mode 100644
index 676e34c..0000000
--- a/test/dtest/SOURCES
+++ /dev/null
@@ -1,34 +0,0 @@
-!if $(FREEBUILD)
-TARGETNAME=dtest2
-!else
-TARGETNAME=dtest2d
-!endif
-TARGETPATH=..\..\..\..\bin\user\obj$(BUILD_ALT_DIR)
-TARGETTYPE=PROGRAM
-UMTYPE=console
-USE_MSVCRT=1
-
-SOURCES=dtest.rc	\
-	dtest.c		\
-	getopt.c
-
-INCLUDES=.;..\..\dat\include;\
-	../../../../inc;..\..\..\..\inc\user;\
-	$(SDK_INC_PATH);
-
-RCOPTIONS=/I..\..\..\..\inc;
-
-# Set defines particular to the driver.
-#USER_C_FLAGS=$(USER_C_FLAGS) /DDAT_EXTENSIONS
-
-!if $(FREEBUILD)
-DATLIB=dat2.lib
-!else
-DATLIB=dat2d.lib
-!endif
-
-TARGETLIBS=$(TARGETPATH)\*\$(DATLIB) $(SDK_LIB_PATH)\ws2_32.lib
-
-# XXX do this ASAP - MSC_WARNING_LEVEL= /W3
-MSC_WARNING_LEVEL= /W1
-
diff --git a/test/dtest/dirs b/test/dtest/dirs
new file mode 100644
index 0000000..f3b2bb0
--- /dev/null
+++ b/test/dtest/dirs
@@ -0,0 +1 @@
+dirs = windows
diff --git a/test/dtest/dtest.c b/test/dtest/dtest.c
index 37edd6c..6fe6a4f 100755
--- a/test/dtest/dtest.c
+++ b/test/dtest/dtest.c
@@ -46,10 +46,10 @@
 #include <ws2tcpip.h>
 #include <io.h>
 #include <process.h>
-#include <getopt.h>
 #include <complib/cl_types.h>
+#include "..\..\..\..\etc\user\getopt.c"
 
-#define getpid _getpid
+#define getpid() ((int)GetCurrentProcessId())
 #define F64x "%I64x" 
 
 #ifdef DBG
diff --git a/test/dtest/dtest.rc b/test/dtest/dtest.rc
deleted file mode 100644
index 9253096..0000000
--- a/test/dtest/dtest.rc
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2007 Intel Corporation.  All rights reserved.
- *
- * This software is available to you under the OpenIB.org BSD license
- * below:
- *
- *     Redistribution and use in source and binary forms, with or
- *     without modification, are permitted provided that the following
- *     conditions are met:
- *
- *      - Redistributions of source code must retain the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer.
- *
- *      - Redistributions in binary form must reproduce the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer in the documentation and/or other materials
- *        provided with the distribution.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * $Id$
- */
-
-
-#include <oib_ver.h>
-
-#define VER_FILETYPE			VFT_APP
-#define VER_FILESUBTYPE			VFT2_UNKNOWN
-
-#if DBG
-#define VER_FILEDESCRIPTION_STR		"Simple DAPL/DAT svr/cli test Application (Debug)"
-#define VER_INTERNALNAME_STR		"dtest2d.exe"
-#define VER_ORIGINALFILENAME_STR	"dtest2d.exe"
-#else
-#define VER_FILEDESCRIPTION_STR		"Simple DAPL/DAT svr/cli test Application"
-#define VER_INTERNALNAME_STR		"dtest2.exe"
-#define VER_ORIGINALFILENAME_STR	"dtest2.exe"
-#endif
-
-#include <common.ver>
diff --git a/test/dtest/dtestx.c b/test/dtest/dtestx.c
index 24536a1..032cadd 100755
--- a/test/dtest/dtestx.c
+++ b/test/dtest/dtestx.c
@@ -41,9 +41,9 @@
 #include <io.h>
 #include <process.h>
 #include <complib/cl_types.h>
+#include "..\..\..\..\etc\user\getopt.c"
 #define __BYTE_ORDER __LITTLE_ENDIAN
 
-#define getpid _getpid
 #define F64x "%I64x"
 #define DAPL_PROVIDER "ibnic0v2"
 #else
diff --git a/test/dtest/makefile.am b/test/dtest/makefile.am
deleted file mode 100644
index e26e1c0..0000000
--- a/test/dtest/makefile.am
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# DO NOT EDIT THIS FILE!!!  Edit .\sources. if you want to add a new source
-# file to this component.  This file merely indirects to the real make file
-# that is shared by all the driver components of the OpenIB Windows project.
-#
-
-!INCLUDE ..\..\..\..\inc\openib.def
diff --git a/test/dtest/windows/dirs b/test/dtest/windows/dirs
new file mode 100644
index 0000000..cac5a54
--- /dev/null
+++ b/test/dtest/windows/dirs
@@ -0,0 +1 @@
+dirs = dtest dtestx
diff --git a/test/dtest/windows/dtest/SOURCES b/test/dtest/windows/dtest/SOURCES
new file mode 100644
index 0000000..58f5c66
--- /dev/null
+++ b/test/dtest/windows/dtest/SOURCES
@@ -0,0 +1,33 @@
+!if $(FREEBUILD)
+TARGETNAME = dtest2
+!else
+TARGETNAME = dtest2d
+!endif
+
+TARGETPATH = ..\..\..\..\..\..\bin\user\obj$(BUILD_ALT_DIR)
+TARGETTYPE = PROGRAM
+UMTYPE = console
+USE_MSVCRT = 1
+
+SOURCES = \
+	dtest.rc	\
+	dtest.c
+	
+INCLUDES = ..\..\..\..\dat\include;..\..\..\..\..\..\inc;\
+	   ..\..\..\..\..\..\inc\user;
+
+RCOPTIONS=/I..\..\..\..\..\..\inc;
+
+# Set defines particular to the driver.
+#USER_C_FLAGS = $(USER_C_FLAGS) /DDAT_EXTENSIONS
+
+!if $(FREEBUILD)
+DATLIB = dat2.lib
+!else
+DATLIB = dat2d.lib
+!endif
+
+TARGETLIBS = $(TARGETPATH)\*\$(DATLIB) $(SDK_LIB_PATH)\ws2_32.lib
+
+# XXX do this ASAP - MSC_WARNING_LEVEL= /W3
+MSC_WARNING_LEVEL = /W1
diff --git a/test/dtest/windows/dtest/dtest.c b/test/dtest/windows/dtest/dtest.c
new file mode 100644
index 0000000..ae69c20
--- /dev/null
+++ b/test/dtest/windows/dtest/dtest.c
@@ -0,0 +1,2 @@
+#include "..\..\dtest.c"
+
diff --git a/test/dtest/windows/dtest/dtest.rc b/test/dtest/windows/dtest/dtest.rc
new file mode 100644
index 0000000..9253096
--- /dev/null
+++ b/test/dtest/windows/dtest/dtest.rc
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2007 Intel Corporation.  All rights reserved.
+ *
+ * This software is available to you under the OpenIB.org BSD license
+ * below:
+ *
+ *     Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *      - Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *
+ *      - Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * $Id$
+ */
+
+
+#include <oib_ver.h>
+
+#define VER_FILETYPE			VFT_APP
+#define VER_FILESUBTYPE			VFT2_UNKNOWN
+
+#if DBG
+#define VER_FILEDESCRIPTION_STR		"Simple DAPL/DAT svr/cli test Application (Debug)"
+#define VER_INTERNALNAME_STR		"dtest2d.exe"
+#define VER_ORIGINALFILENAME_STR	"dtest2d.exe"
+#else
+#define VER_FILEDESCRIPTION_STR		"Simple DAPL/DAT svr/cli test Application"
+#define VER_INTERNALNAME_STR		"dtest2.exe"
+#define VER_ORIGINALFILENAME_STR	"dtest2.exe"
+#endif
+
+#include <common.ver>
diff --git a/test/dtest/windows/dtest/makefile b/test/dtest/windows/dtest/makefile
new file mode 100644
index 0000000..5fb2ee8
--- /dev/null
+++ b/test/dtest/windows/dtest/makefile
@@ -0,0 +1,7 @@
+#
+# DO NOT EDIT THIS FILE!!!  Edit .\sources. if you want to add a new source
+# file to this component.  This file merely indirects to the real make file
+# that is shared by all the driver components of the OpenIB Windows project.
+#
+
+!INCLUDE ..\..\..\..\..\..\inc\openib.def
diff --git a/test/dtest/windows/dtestx/SOURCES b/test/dtest/windows/dtestx/SOURCES
new file mode 100644
index 0000000..ee63817
--- /dev/null
+++ b/test/dtest/windows/dtestx/SOURCES
@@ -0,0 +1,28 @@
+!if $(FREEBUILD)
+TARGETNAME = dtestx
+!else
+TARGETNAME = dtestxd
+!endif
+
+TARGETPATH = ..\..\..\..\..\..\bin\user\obj$(BUILD_ALT_DIR)
+TARGETTYPE = PROGRAM
+UMTYPE = console
+USE_MSVCRT = 1
+
+SOURCES = \
+	dtestx.rc	\
+	dtestx.c
+
+INCLUDES = ..\..\..\..\dat\include;..\..\..\..\..\..\inc;\
+	   ..\..\..\..\..\..\inc\user;
+
+!if $(FREEBUILD)
+DATLIB = dat2.lib
+!else
+DATLIB = dat2d.lib
+!endif
+
+TARGETLIBS = $(TARGETPATH)\*\$(DATLIB) $(SDK_LIB_PATH)\ws2_32.lib
+
+# XXX do this ASAP - MSC_WARNING_LEVEL= /W3
+MSC_WARNING_LEVEL = /W1
diff --git a/test/dtest/windows/dtestx/dtestx.c b/test/dtest/windows/dtestx/dtestx.c
new file mode 100644
index 0000000..4cc23c1
--- /dev/null
+++ b/test/dtest/windows/dtestx/dtestx.c
@@ -0,0 +1 @@
+#include "..\..\dtestx.c"
diff --git a/test/dtest/windows/dtestx/dtestx.rc b/test/dtest/windows/dtestx/dtestx.rc
new file mode 100644
index 0000000..98659e0
--- /dev/null
+++ b/test/dtest/windows/dtestx/dtestx.rc
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2007 Intel Corporation.  All rights reserved.
+ *
+ * This software is available to you under the OpenIB.org BSD license
+ * below:
+ *
+ *     Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *      - Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *
+ *      - Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * $Id$
+ */
+
+
+#include <oib_ver.h>
+
+#define VER_FILETYPE			VFT_APP
+#define VER_FILESUBTYPE			VFT2_UNKNOWN
+
+#if DBG
+#define VER_FILEDESCRIPTION_STR		"DAT/DAPL v2.0 extensions cli/svr test (Debug)"
+#define VER_INTERNALNAME_STR		"dtestxd.exe"
+#define VER_ORIGINALFILENAME_STR	"dtestxd.exe"
+#else
+#define VER_FILEDESCRIPTION_STR		"DAT/DAPL v2.0 Extensions cli/svr test"
+#define VER_INTERNALNAME_STR		"dtestx.exe"
+#define VER_ORIGINALFILENAME_STR	"dtestx.exe"
+#endif
+
+#include <common.ver>
diff --git a/test/dtest/windows/dtestx/makefile b/test/dtest/windows/dtestx/makefile
new file mode 100644
index 0000000..5fb2ee8
--- /dev/null
+++ b/test/dtest/windows/dtestx/makefile
@@ -0,0 +1,7 @@
+#
+# DO NOT EDIT THIS FILE!!!  Edit .\sources. if you want to add a new source
+# file to this component.  This file merely indirects to the real make file
+# that is shared by all the driver components of the OpenIB Windows project.
+#
+
+!INCLUDE ..\..\..\..\..\..\inc\openib.def





More information about the general mailing list