summaryrefslogtreecommitdiffstats
path: root/base/test_suite.h
diff options
context:
space:
mode:
authorjeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-29 20:46:04 +0000
committerjeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-29 20:46:04 +0000
commit307f536386aad3abf7c0978b892ffac059eb0be5 (patch)
tree9e59dd49ecdd90a63e007c37bdd27cc045549138 /base/test_suite.h
parentfcbaeacfce08303236709e2603e64fc40bdba435 (diff)
downloadchromium_src-307f536386aad3abf7c0978b892ffac059eb0be5.zip
chromium_src-307f536386aad3abf7c0978b892ffac059eb0be5.tar.gz
chromium_src-307f536386aad3abf7c0978b892ffac059eb0be5.tar.bz2
1) Add a new MULTIPROCESS_TEST_MAIN macro to store child process names
in a lookup table. Previously we were using different mechanisms on each platform to look up child process names at runtime. This broke on OS X where we strip the symbol table on release executables. 2) Enable process_util_unittest on OS X. Review URL: http://codereview.chromium.org/8864 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4165 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/test_suite.h')
-rw-r--r--base/test_suite.h26
1 files changed, 2 insertions, 24 deletions
diff --git a/base/test_suite.h b/base/test_suite.h
index 503aeda..1c0a785 100644
--- a/base/test_suite.h
+++ b/base/test_suite.h
@@ -16,15 +16,12 @@
#include "base/logging.h"
#include "base/multiprocess_test.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "testing/multiprocess_func_list.h"
#if defined(OS_WIN)
#include <windows.h>
-#include "base/multiprocess_test.h"
#elif defined(OS_LINUX)
-#include <dlfcn.h>
#include <gtk/gtk.h>
-#elif defined(OS_MACOSX)
-#include <dlfcn.h>
#endif
class TestSuite {
@@ -47,26 +44,7 @@ class TestSuite {
// Convert our function name to a usable string for GetProcAddress.
std::string func_name(client_func.begin(), client_func.end());
-#if defined(OS_WIN)
- // Get our module handle and search for an exported function
- // which we can use as our client main.
- MultiProcessTest::ChildFunctionPtr func =
- reinterpret_cast<MultiProcessTest::ChildFunctionPtr>(
- GetProcAddress(GetModuleHandle(NULL), func_name.c_str()));
-#elif defined(OS_LINUX)
- void* exobj = dlopen(0, RTLD_LAZY);
- MultiProcessTest::ChildFunctionPtr func =
- reinterpret_cast<MultiProcessTest::ChildFunctionPtr>(
- dlsym(exobj, func_name.c_str()));
-#elif defined(OS_MACOSX)
- MultiProcessTest::ChildFunctionPtr func =
- reinterpret_cast<MultiProcessTest::ChildFunctionPtr>(
- dlsym(RTLD_SELF, func_name.c_str()));
-#endif // defined(OS_MACOSX)
-
- if (func)
- return (*func)();
- return -1;
+ return multi_process_function_list::InvokeChildProcessTest(func_name);
}
int result = RUN_ALL_TESTS();