summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2017-06-06 12:45:31 -0400
committerBernard Normier <bernard@zeroc.com>2017-06-06 12:45:31 -0400
commit4c08e435deaa2cb33a5966d68e8f3af796c3f36b (patch)
treefe4612dfdc71f63612fa59ca87f6b6079b6843f3 /cpp
parentAdded tests for async_sent_callback_async & fixed Java AMI test failure (diff)
downloadice-4c08e435deaa2cb33a5966d68e8f3af796c3f36b.tar.bz2
ice-4c08e435deaa2cb33a5966d68e8f3af796c3f36b.tar.xz
ice-4c08e435deaa2cb33a5966d68e8f3af796c3f36b.zip
Reenabled stacktrace testing on Windows
Diffstat (limited to 'cpp')
-rw-r--r--cpp/test/IceUtil/stacktrace/Client.cpp85
-rw-r--r--cpp/test/IceUtil/stacktrace/StackTrace.debug.Win649
-rw-r--r--cpp/test/IceUtil/stacktrace/StackTrace.release-vc110.Win644
-rw-r--r--cpp/test/IceUtil/stacktrace/StackTrace.release-vc120.Win645
-rw-r--r--cpp/test/IceUtil/stacktrace/StackTrace.release-vc140.Win323
-rw-r--r--cpp/test/IceUtil/stacktrace/StackTrace.release-vc140.Win644
-rw-r--r--cpp/test/IceUtil/stacktrace/StackTrace.release.Win643
7 files changed, 39 insertions, 74 deletions
diff --git a/cpp/test/IceUtil/stacktrace/Client.cpp b/cpp/test/IceUtil/stacktrace/Client.cpp
index c2b75a74439..45e772d962e 100644
--- a/cpp/test/IceUtil/stacktrace/Client.cpp
+++ b/cpp/test/IceUtil/stacktrace/Client.cpp
@@ -67,40 +67,6 @@ private:
};
typedef IceUtil::Handle<Thrower> ThrowerPtr;
-#ifdef _WIN32
-string
-getIceHome()
-{
- vector<wchar_t> buf(256);
- DWORD ret = GetEnvironmentVariableW(L"ICE_HOME", &buf[0], static_cast<DWORD>(buf.size()));
- string iceHome = (ret > 0 && ret < buf.size()) ? wstringToString(&buf[0]) : string("");
- if(!iceHome.empty())
- {
- return iceHome;
- }
- else
- {
- HKEY hKey;
-
- string key = string("SOFTWARE\\ZeroC\\Ice ") + ICE_STRING_VERSION;
- const wstring keyName = stringToWstring(key);
-
- if(RegOpenKeyExW(HKEY_LOCAL_MACHINE, keyName.c_str(), 0, KEY_QUERY_VALUE, &hKey) != ERROR_SUCCESS)
- {
- return "";
- }
-
- WCHAR buf[512];
- DWORD bufSize = sizeof(buf);
- if(RegQueryValueExW(hKey, L"InstallDir", 0, ICE_NULLPTR, (LPBYTE)buf, &bufSize) != ERROR_SUCCESS)
- {
- return "";
- }
- return wstringToString(wstring(buf));
- }
-}
-#endif
-
#if defined(__APPLE__)
void
standardizeVersion(string& str)
@@ -138,7 +104,7 @@ int main(int argc, char* argv[])
{
if(IceUtilInternal::stackTraceImpl() == IceUtilInternal::STNone)
{
- cout << "This IceUtil build cannot capture stack traces" << endl;
+ cout << "This Ice build cannot capture stack traces" << endl;
return EXIT_SUCCESS;
}
@@ -147,34 +113,6 @@ int main(int argc, char* argv[])
optimized = true;
#endif
-#if defined(_WIN32)
- bool binDist = false;
- vector<wchar_t> buf(256);
- DWORD ret = GetEnvironmentVariableW(L"ICE_BIN_DIST", &buf[0], static_cast<DWORD>(buf.size()));
- string valstr = (ret > 0 && ret < buf.size()) ? wstringToString(&buf[0]) : string("");
- binDist = (valstr.find("all") != std::string::npos) || (valstr.find("cpp") != std::string::npos);
-
- if(binDist)
- {
- //
- // For Windows we only run the test against bindist if PDBs were installed
- //
- string pdb = getIceHome() + "\\bin\\icebox.pdb";
- if(!ifstream(pdb))
- {
- cout << "Test requires PDBs to be installed" << endl;
- return EXIT_SUCCESS;
- }
- }
- else if(optimized)
- {
- //
- // Only support debug srcdist Windows builds
- //
- return EXIT_SUCCESS;
- }
-#endif
-
cout << "checking stacktrace... ";
IceUtilInternal::printStackTraces = true;
@@ -214,7 +152,9 @@ int main(int argc, char* argv[])
filename += "debug";
}
-#if defined(_WIN32)
+#if defined(_WIN64)
+ filename += ".Win64";
+#elif defined(_WIN32)
filename += ".Win32";
#elif defined(__APPLE__)
filename += ".OSX";
@@ -290,9 +230,7 @@ int main(int argc, char* argv[])
// With windows and Linux optimized builds retry with the alternate
// files.
//
- if(filename == "StackTrace.release-vc110.Win32" ||
- filename == "StackTrace.release-vc130.Win32" ||
- filename == "StackTrace.release-vc140.Win32" ||
+ if(filename.find("StackTrace.release-vc") == 0 ||
filename == "StackTrace.release.Linux")
{
break;
@@ -308,12 +246,15 @@ int main(int argc, char* argv[])
if(!match)
{
- if(filename == "StackTrace.release-vc110.Win32" ||
- filename == "StackTrace.release-vc130.Win32" ||
- filename == "StackTrace.release-vc140.Win32")
+ if(filename.find("StackTrace.release-vc") == 0)
{
- // Retry with alternate Win32 stack
- filename = "StackTrace.release.Win32";
+ // Retry with alternate stack
+ filename = "StackTrace.release";
+#if defined(_WIN64)
+ filename += ".Win64";
+#elif defined(_WIN32)
+ filename += ".Win32";
+#endif
continue;
}
else if(filename == "StackTrace.release.Linux")
diff --git a/cpp/test/IceUtil/stacktrace/StackTrace.debug.Win64 b/cpp/test/IceUtil/stacktrace/StackTrace.debug.Win64
new file mode 100644
index 00000000000..0539f10185a
--- /dev/null
+++ b/cpp/test/IceUtil/stacktrace/StackTrace.debug.Win64
@@ -0,0 +1,9 @@
+ 0 IceUtil::Exception::Exception
+ 1 IceUtil::ExceptionHelper<IceUtil::NullHandleException>::ExceptionHelper
+ 2 IceUtil::NullHandleException::NullHandleException
+ 3 `anonymous namespace'::Thrower::fifth
+ 4 `anonymous namespace'::Thrower::forth
+ 5 `anonymous namespace'::Thrower::third
+ 6 `anonymous namespace'::Thrower::second
+ 7 `anonymous namespace'::Thrower::first
+ 8 main
diff --git a/cpp/test/IceUtil/stacktrace/StackTrace.release-vc110.Win64 b/cpp/test/IceUtil/stacktrace/StackTrace.release-vc110.Win64
new file mode 100644
index 00000000000..823da2cd4fc
--- /dev/null
+++ b/cpp/test/IceUtil/stacktrace/StackTrace.release-vc110.Win64
@@ -0,0 +1,4 @@
+ 0 IceUtil::Exception::Exception
+ 1 IceUtil::NullHandleException::NullHandleException
+ 2 `anonymous namespace'::Thrower::fifth
+ 3 main
diff --git a/cpp/test/IceUtil/stacktrace/StackTrace.release-vc120.Win64 b/cpp/test/IceUtil/stacktrace/StackTrace.release-vc120.Win64
new file mode 100644
index 00000000000..19ab443db12
--- /dev/null
+++ b/cpp/test/IceUtil/stacktrace/StackTrace.release-vc120.Win64
@@ -0,0 +1,5 @@
+ 0 IceUtil::Exception::Exception
+ 1 IceUtil::ExceptionHelper<IceUtil::NullHandleException>::ExceptionHelper
+ 2 IceUtil::NullHandleException::NullHandleException
+ 3 `anonymous namespace'::Thrower::fifth
+ 4 main
diff --git a/cpp/test/IceUtil/stacktrace/StackTrace.release-vc140.Win32 b/cpp/test/IceUtil/stacktrace/StackTrace.release-vc140.Win32
index e3d09003035..7290cffd13e 100644
--- a/cpp/test/IceUtil/stacktrace/StackTrace.release-vc140.Win32
+++ b/cpp/test/IceUtil/stacktrace/StackTrace.release-vc140.Win32
@@ -1,3 +1,2 @@
0 IceUtil::NullHandleException::NullHandleException
-1 `anonymous namespace'::Thrower::first
-2 main
+1 main
diff --git a/cpp/test/IceUtil/stacktrace/StackTrace.release-vc140.Win64 b/cpp/test/IceUtil/stacktrace/StackTrace.release-vc140.Win64
new file mode 100644
index 00000000000..d4da12a908d
--- /dev/null
+++ b/cpp/test/IceUtil/stacktrace/StackTrace.release-vc140.Win64
@@ -0,0 +1,4 @@
+ 0 IceUtil::Exception::Exception at
+ 1 IceUtil::ExceptionHelper<IceUtil::NullHandleException>::ExceptionHelper<IceUtil::NullHandleException> at
+ 2 IceUtil::NullHandleException::NullHandleException at
+ 3 main at \ No newline at end of file
diff --git a/cpp/test/IceUtil/stacktrace/StackTrace.release.Win64 b/cpp/test/IceUtil/stacktrace/StackTrace.release.Win64
new file mode 100644
index 00000000000..06fdff43f80
--- /dev/null
+++ b/cpp/test/IceUtil/stacktrace/StackTrace.release.Win64
@@ -0,0 +1,3 @@
+ 0 IceUtil::NullHandleException::NullHandleException
+ 1 `anonymous namespace'::Thrower::fifth
+ 2 main