diff options
author | Thomas Radke <tradke@aei.mpg.de> | 2000-10-28 19:19:39 (GMT) |
---|---|---|
committer | Thomas Radke <tradke@aei.mpg.de> | 2000-10-28 19:19:39 (GMT) |
commit | 4b78390eda6b3b6c5757f44ba62839b6db56a500 (patch) | |
tree | 100577432bd7e96d4537e316639fd90cd34ee9ae /test | |
parent | 9c93282d1bd29fcac6176e9fac12b2c1ebd6463e (diff) | |
download | hdf5-4b78390eda6b3b6c5757f44ba62839b6db56a500.zip hdf5-4b78390eda6b3b6c5757f44ba62839b6db56a500.tar.gz hdf5-4b78390eda6b3b6c5757f44ba62839b6db56a500.tar.bz2 |
[svn-r2750]
Purpose:
Port to Windows.
Description:
The stream_test program now also compiles and can be run under Windows.
Solution:
The problem was that fork(2) and waitpid(2) aren't available
under Windows when using the MS compilers.
So I test for both H5_HAVE_FORK and H5_HAVE_WAITPID.
These are already checked fortunately during configuration.
If they are not there the code just says
printf ("Test skipped because this architecture doesn't provide "
"fork(2) and waitpid(2)\n");
Platforms tested:
Windows NT, both with MS Visual C++ and GNU cc
Now you can build and run the Stream VFD testsuite under Windows
when using GNU cc !!
Diffstat (limited to 'test')
-rw-r--r-- | test/stream_test.c | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/test/stream_test.c b/test/stream_test.c index a29a0c1..239c2c6 100644 --- a/test/stream_test.c +++ b/test/stream_test.c @@ -6,7 +6,11 @@ * Author: Thomas Radke <tradke@aei-potsdam.mpg.de> * Tuesday, September 12, 2000 * + * Version: $Id$ + * * Modifications: + * Thomas Radke, Thursday, October 26, 2000 + * Made it compiling under Windows. * */ @@ -28,23 +32,34 @@ * processes and returns their exit code. */ -#include <sys/types.h> -#include <sys/wait.h> #include <stdio.h> -#include <stdlib.h> - -#include <h5test.h> +#include <hdf5.h> #ifndef H5_HAVE_STREAM int main (void) { - printf ("Test skipped because Stream Virtual File Driver not available\n"); - return (0); + printf ("Test skipped because Stream Virtual File Driver not available\n"); + return (0); +} + +#elif ! defined (H5_HAVE_FORK) || ! defined (H5_HAVE_WAITPID) + +int main (void) +{ + printf ("Test skipped because this architecture doesn't provide " + "fork(2) and waitpid(2)\n"); + return (0); } #else +#include <stdlib.h> +#include <unistd.h> +#include <sys/types.h> +#include <sys/wait.h> + + #define DELAY 10 /* sleeping time in seconds */ #define RANK 2 /* sample dataset rank */ #define DIMS 50 /* sample dataset dimensions */ |