Skip to content
Snippets Groups Projects
Commit 80d68c09 authored by Nicolas "Pixel" Noble's avatar Nicolas "Pixel" Noble
Browse files

Fixing test_config.c

Now all the gpr tests build and run under win32.
parent 848e7444
No related branches found
No related tags found
No related merge requests found
......@@ -45,9 +45,11 @@
#if defined(_WIN64) || defined(WIN64)
#define GPR_WIN32 1
#define GPR_ARCH_64 1
#define GPR_GETPID_IN_PROCESS_H 1
#elif defined(_WIN32) || defined(WIN32)
#define GPR_ARCH_32 1
#define GPR_WIN32 1
#define GPR_GETPID_IN_PROCESS_H 1
#elif defined(ANDROID) || defined(__ANDROID__)
#define GPR_ANDROID 1
#define GPR_ARCH_32 1
......@@ -61,6 +63,7 @@
#define GPR_POSIX_STRING 1
#define GPR_POSIX_SYNC 1
#define GPR_POSIX_TIME 1
#define GPR_GETPID_IN_UNISTD_H 1
#elif defined(__linux__)
#define GPR_CPU_LINUX 1
#define GPR_GCC_ATOMIC 1
......@@ -72,6 +75,7 @@
#define GPR_POSIX_STRING 1
#define GPR_POSIX_SYNC 1
#define GPR_POSIX_TIME 1
#define GPR_GETPID_IN_UNISTD_H 1
#ifdef _LP64
#define GPR_ARCH_64 1
#else /* _LP64 */
......@@ -89,6 +93,7 @@
#define GPR_POSIX_STRING 1
#define GPR_POSIX_SYNC 1
#define GPR_POSIX_TIME 1
#define GPR_GETPID_IN_UNISTD_H 1
#ifdef _LP64
#define GPR_ARCH_64 1
#else /* _LP64 */
......
......@@ -13,7 +13,7 @@
@rem Build the library dependencies first
MSBuild.exe gpr.vcxproj /p:Configuration=Debug
MSBuild.exe grpc_test_util.vcxproj /p:Configuration=Debug
MSBuild.exe gpr_test_util.vcxproj /p:Configuration=Debug
mkdir ${test_bin_dir}
......
......@@ -33,11 +33,25 @@
#include "test/core/util/test_config.h"
#include <grpc/support/port_platform.h>
#include <stdlib.h>
#if GPR_GETPID_IN_UNISTD_H
#include <unistd.h>
static int seed() {
return getpid();
}
#endif
#if GPR_GETPID_IN_PROCESS_H
#include <process.h>
static int seed(void) {
return _getpid();
}
#endif
void grpc_test_init(int argc, char **argv) {
/* seed rng with pid, so we don't end up with the same random numbers as a
concurrently running test binary */
srand(getpid());
srand(seed());
}
......@@ -5,7 +5,7 @@
@rem Build the library dependencies first
MSBuild.exe gpr.vcxproj /p:Configuration=Debug
MSBuild.exe grpc_test_util.vcxproj /p:Configuration=Debug
MSBuild.exe gpr_test_util.vcxproj /p:Configuration=Debug
mkdir test_bin
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment