summaryrefslogtreecommitdiff
path: root/indra/newview/tests
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/tests')
-rw-r--r--indra/newview/tests/lllogininstance_test.cpp1
-rw-r--r--indra/newview/tests/llremoteparcelrequest_test.cpp3
-rw-r--r--indra/newview/tests/llversioninfo_test.cpp11
-rwxr-xr-xindra/newview/tests/test_llxmlrpc_peer.py36
4 files changed, 37 insertions, 14 deletions
diff --git a/indra/newview/tests/lllogininstance_test.cpp b/indra/newview/tests/lllogininstance_test.cpp
index aa05897c0b..55dcb83567 100644
--- a/indra/newview/tests/lllogininstance_test.cpp
+++ b/indra/newview/tests/lllogininstance_test.cpp
@@ -136,6 +136,7 @@ void LLGridManager::addSystemGrid(const std::string& label,
const std::string& helper,
const std::string& login_page,
const std::string& update_url_base,
+ const std::string& web_profile_url,
const std::string& login_id)
{
}
diff --git a/indra/newview/tests/llremoteparcelrequest_test.cpp b/indra/newview/tests/llremoteparcelrequest_test.cpp
index ea5014a59c..4f7f87b6b0 100644
--- a/indra/newview/tests/llremoteparcelrequest_test.cpp
+++ b/indra/newview/tests/llremoteparcelrequest_test.cpp
@@ -34,6 +34,7 @@
#include "../llagent.h"
#include "message.h"
#include "llurlentry.h"
+#include "llpounceable.h"
namespace {
const LLUUID TEST_PARCEL_ID("11111111-1111-1111-1111-111111111111");
@@ -62,7 +63,7 @@ void LLMessageSystem::addUUID(char const *,LLUUID const &) { }
void LLMessageSystem::addUUIDFast(char const *,LLUUID const &) { }
void LLMessageSystem::nextBlockFast(char const *) { }
void LLMessageSystem::newMessage(char const *) { }
-LLMessageSystem * gMessageSystem;
+LLPounceable<LLMessageSystem*, LLPounceableStatic> gMessageSystem;
char const* const _PREHASH_AgentID = 0; // never dereferenced during this test
char const* const _PREHASH_AgentData = 0; // never dereferenced during this test
LLAgent gAgent;
diff --git a/indra/newview/tests/llversioninfo_test.cpp b/indra/newview/tests/llversioninfo_test.cpp
index 6b0be29c2d..f1f69f33f1 100644
--- a/indra/newview/tests/llversioninfo_test.cpp
+++ b/indra/newview/tests/llversioninfo_test.cpp
@@ -29,6 +29,13 @@
#include "../llversioninfo.h"
+// LL_VIEWER_CHANNEL is a macro defined on the compiler command line. The
+// macro expands to the string name of the channel, but without quotes. We
+// need to turn it into a quoted string. This macro trick does that.
+#define stringize_inner(x) #x
+#define stringize_outer(x) stringize_inner(x)
+#define ll_viewer_channel stringize_outer(LL_VIEWER_CHANNEL)
+
namespace tut
{
struct versioninfo
@@ -50,7 +57,7 @@ namespace tut
mShortVersion = stream.str();
stream.str("");
- stream << LL_VIEWER_CHANNEL
+ stream << ll_viewer_channel
<< " "
<< mVersion;
mVersionAndChannel = stream.str();
@@ -89,7 +96,7 @@ namespace tut
LL_VIEWER_VERSION_BUILD);
ensure_equals("Channel version",
LLVersionInfo::getChannel(),
- LL_VIEWER_CHANNEL);
+ ll_viewer_channel);
ensure_equals("Version String",
LLVersionInfo::getVersion(),
mVersion);
diff --git a/indra/newview/tests/test_llxmlrpc_peer.py b/indra/newview/tests/test_llxmlrpc_peer.py
index 281b72a058..cff40aa4c2 100755
--- a/indra/newview/tests/test_llxmlrpc_peer.py
+++ b/indra/newview/tests/test_llxmlrpc_peer.py
@@ -31,15 +31,23 @@ $/LicenseInfo$
import os
import sys
-from threading import Thread
from SimpleXMLRPCServer import SimpleXMLRPCServer
mydir = os.path.dirname(__file__) # expected to be .../indra/newview/tests/
-sys.path.insert(0, os.path.join(mydir, os.pardir, os.pardir, "lib", "python"))
-sys.path.insert(1, os.path.join(mydir, os.pardir, os.pardir, "llmessage", "tests"))
+sys.path.insert(0, os.path.join(mydir, os.pardir, os.pardir, "llmessage", "tests"))
from testrunner import freeport, run, debug
class TestServer(SimpleXMLRPCServer):
+ # This server_bind() override is borrowed and simplified from
+ # BaseHTTPServer.HTTPServer.server_bind(): we want to capture the actual
+ # server port. BaseHTTPServer.HTTPServer.server_bind() stores the actual
+ # port in a server_port attribute, but SimpleXMLRPCServer isn't derived
+ # from HTTPServer. So do it ourselves.
+ def server_bind(self):
+ """Override server_bind to store the server port."""
+ SimpleXMLRPCServer.server_bind(self)
+ self.server_port = self.socket.getsockname()[1]
+
def _dispatch(self, method, params):
try:
func = getattr(self, method)
@@ -67,15 +75,21 @@ class TestServer(SimpleXMLRPCServer):
pass
if __name__ == "__main__":
- # Instantiate a TestServer on the first free port in the specified port
- # range. Doing this inline is better than in a daemon thread: if it blows
- # up here, we'll get a traceback. If it blew up in some other thread, the
- # traceback would get eaten and we'd run the subject test program anyway.
- xmlrpcd, port = freeport(xrange(8000, 8020),
- lambda port: TestServer(('127.0.0.1', port)))
+ # function to make a server with specified port
+ make_server = lambda port: TestServer(('127.0.0.1', port))
+
+ if not sys.platform.startswith("win"):
+ # Instantiate a TestServer on a port chosen by the runtime.
+ xmlrpcd = make_server(0)
+ else:
+ # "Then there's Windows"
+ # Instantiate a TestServer on the first free port in the specified
+ # port range.
+ xmlrpcd, port = freeport(xrange(8000, 8020), make_server)
+
# Pass the selected port number to the subject test program via the
# environment. We don't want to impose requirements on the test program's
# command-line parsing -- and anyway, for C++ integration tests, that's
# performed in TUT code rather than our own.
- os.environ["PORT"] = str(port)
- sys.exit(run(server=Thread(name="xmlrpc", target=xmlrpcd.serve_forever), *sys.argv[1:]))
+ os.environ["PORT"] = str(xmlrpcd.server_port)
+ sys.exit(run(server_inst=xmlrpcd, *sys.argv[1:]))