diff options
author | Mark Spruiell <mes@zeroc.com> | 2015-12-17 11:45:27 -0800 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2015-12-17 11:45:27 -0800 |
commit | 884e2be89b0cd997f372c59f05bf05a9a5372b60 (patch) | |
tree | 53d2123abf22042f827d0e83b6093cea038c3b3a /cpp/test | |
parent | Merge branch '3.6' (diff) | |
download | ice-884e2be89b0cd997f372c59f05bf05a9a5372b60.tar.bz2 ice-884e2be89b0cd997f372c59f05bf05a9a5372b60.tar.xz ice-884e2be89b0cd997f372c59f05bf05a9a5372b60.zip |
Fixes for Bluetooth plug-ins.
Updates to testsuite to support Bluetooth and remote servers.
Diffstat (limited to 'cpp/test')
196 files changed, 1270 insertions, 680 deletions
diff --git a/cpp/test/Common/.gitignore b/cpp/test/Common/.gitignore new file mode 100644 index 00000000000..3ff6195f620 --- /dev/null +++ b/cpp/test/Common/.gitignore @@ -0,0 +1,5 @@ +// Generated by makegitignore.py + +// IMPORTANT: Do not edit this file -- any edits made here will be lost! +Controller.cpp +Controller.h diff --git a/cpp/test/Common/Controller.ice b/cpp/test/Common/Controller.ice new file mode 100644 index 00000000000..5178df68660 --- /dev/null +++ b/cpp/test/Common/Controller.ice @@ -0,0 +1,38 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +module Test +{ + +module Common +{ + +exception ServerFailedException +{ + string reason; +}; + +interface Server +{ + void waitTestSuccess(); + void waitForServer() throws ServerFailedException; + void terminate(); +}; + +sequence<string> StringSeq; + +interface Controller +{ + Server* runServer(string lang, string name, string protocol, string host, bool winrt, string configName, + StringSeq options); +}; + +}; + +}; diff --git a/cpp/test/Common/Makefile b/cpp/test/Common/Makefile new file mode 100644 index 00000000000..817c9542e08 --- /dev/null +++ b/cpp/test/Common/Makefile @@ -0,0 +1,53 @@ +# ********************************************************************** +# +# Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved. +# +# This copy of Ice is licensed to you under the terms described in the +# ICE_LICENSE file included in this distribution. +# +# ********************************************************************** + +top_srcdir = ../.. + +testincdir = ../include + +LIBFILENAME = $(call mklibfilename,TestCommon,$(VERSION)) +SONAME = $(call mksoname,TestCommon,$(SOVERSION)) +LIBNAME = $(call mklibname,TestCommon) +TARGETS = $(call mklibtargets,$(libdir)/$(LIBFILENAME),$(libdir)/$(SONAME),$(libdir)$(cpp11libdirsuffix)/$(LIBNAME)) + +SLICE_OBJS = Controller.o + +OBJS = TestCommon.o \ + $(SLICE_OBJS) + +HDIR = $(testincdir) +SDIR = . + +include $(top_srcdir)/config/Make.rules + +CPPFLAGS := -I$(testincdir) $(CPPFLAGS) -DTEST_API_EXPORTS +SLICE2CPPFLAGS := --dll-export TEST_API $(SLICE2CPPFLAGS) + +LINKWITH := $(LIBS) + +ifeq ($(STATICLIBS),yes) +$(libdir)/$(LIBNAME): $(OBJS) + @mkdir -p $(dir $@) + rm -f $@ + $(call mklib,$@,$(OBJS)) +else +$(libdir)/$(LIBFILENAME): $(OBJS) + @mkdir -p $(dir $@) + rm -f $@ + $(call mkshlib,$@,$(SONAME),$(OBJS),$(LINKWITH)) + +$(libdir)/$(SONAME): $(libdir)/$(LIBFILENAME) + rm -f $@ + ln -s $(LIBFILENAME) $@ + +$(libdir)$(cpp11libdirsuffix)/$(LIBNAME): $(libdir)/$(SONAME) + @mkdir -p $(libdir)$(cpp11libdirsuffix) + rm -f $@ + ln -s $(cpp11sonamedir)$(SONAME) $@ +endif diff --git a/cpp/test/Common/Makefile.mak b/cpp/test/Common/Makefile.mak new file mode 100644 index 00000000000..14aef7c2145 --- /dev/null +++ b/cpp/test/Common/Makefile.mak @@ -0,0 +1,47 @@ +# ********************************************************************** +# +# Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved. +# +# This copy of Ice is licensed to you under the terms described in the +# ICE_LICENSE file included in this distribution. +# +# ********************************************************************** + +top_srcdir = ..\.. + +LIBNAME = $(top_srcdir)\lib\testcommon$(LIBSUFFIX).lib +DLLNAME = $(top_srcdir)\bin\testcommon$(SOVERSION)$(LIBSUFFIX)$(COMPSUFFIX).dll + +TARGETS = $(LIBNAME) $(DLLNAME) + +SLICE_OBJS = .\Controller.obj + +OBJS = $(SLICE_OBJS) \ + .\TestCommon.obj + +HDIR = ..\include +SDIR = . + +!include $(top_srcdir)\config\Make.rules.mak + +CPPFLAGS = -I. -I$(HDIR) $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN -DTEST_API_EXPORTS + +SLICE2CPPFLAGS = --dll-export TEST_API $(SLICE2CPPFLAGS) + +!if "$(GENERATE_PDB)" == "yes" +PDBFLAGS = /pdb:$(DLLNAME:.dll=.pdb) +!endif + +$(LIBNAME): $(DLLNAME) + +$(DLLNAME): $(OBJS) + $(LINK) $(BASE):0x30000000 $(LD_DLLFLAGS) $(PDBFLAGS) $(OBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + move $(DLLNAME:.dll=.lib) $(LIBNAME) + @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ + $(MT) -nologo -manifest $@.manifest -outputresource:$@;#2 && del /q $@.manifest + @if exist $(DLLNAME:.dll=.exp) del /q $(DLLNAME:.dll=.exp) + +clean:: + -del /q Controller.cpp $(HDIR)\Controller.h + +install:: all diff --git a/cpp/test/Common/TestCommon.cpp b/cpp/test/Common/TestCommon.cpp new file mode 100644 index 00000000000..967a69e4602 --- /dev/null +++ b/cpp/test/Common/TestCommon.cpp @@ -0,0 +1,145 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +#include <TestCommon.h> +#include <Controller.h> + +#include <Ice/Communicator.h> + +std::string +getTestEndpoint(const Ice::CommunicatorPtr& communicator, int num, const std::string prot) +{ + std::ostringstream ostr; + std::string protocol = prot; + if(protocol.empty()) + { + protocol = communicator->getProperties()->getPropertyWithDefault("Ice.Default.Protocol", "default"); + } + + if(protocol == "bt") + { + // + // For Bluetooth, there's no need to specify a port (channel) number. + // The client locates the server using its address and a UUID. + // + switch(num) + { + case 0: + ostr << "default -u 5e08f4de-5015-4507-abe1-a7807002db3d"; + break; + case 1: + ostr << "default -u dae56460-2485-46fd-a3ca-8b730e1e868b"; + break; + case 2: + ostr << "default -u 99e08bc6-fcda-4758-afd0-a8c00655c999"; + break; + default: + assert(false); + } + } + else + { + ostr << protocol << " -p " << (12010 + num); + } + return ostr.str(); +} + +RemoteConfig::RemoteConfig(const std::string& name, int argc, char** argv, const Ice::CommunicatorPtr& communicator) : + _status(1) +{ + // + // If ControllerHost is defined, we are using a server on a remote host. We expect a + // test controller will already be active. We let exceptions propagate out to + // the caller. + // + // Also look for a ConfigName property, which specifies the name of the configuration + // we are currently testing. + // + std::string controllerHost; + std::string configName; + for(int i = 1; i < argc; ++i) + { + std::string opt = argv[i]; + if(opt.find("--ControllerHost") == 0) + { + std::string::size_type pos = opt.find('='); + if(pos != std::string::npos && opt.size() > pos + 1) + { + controllerHost = opt.substr(pos + 1); + } + } + else if(opt.find("--ConfigName") == 0) + { + std::string::size_type pos = opt.find('='); + if(pos != std::string::npos && opt.size() > pos + 1) + { + configName = opt.substr(pos + 1); + } + } + } + + Test::Common::ServerPrx server; + + if(!controllerHost.empty()) + { + std::string prot = communicator->getProperties()->getPropertyWithDefault("Ice.Default.Protocol", "tcp"); + std::string host; + if(prot != "bt") + { + host = communicator->getProperties()->getProperty("Ice.Default.Host"); + } + + Test::Common::StringSeq options; + + Test::Common::ControllerPrx controller = Test::Common::ControllerPrx::checkedCast( + communicator->stringToProxy("controller:tcp -h " + controllerHost + " -p 15000")); + server = controller->runServer("cpp", name, prot, host, false, configName, options); + server->waitForServer(); + } + + _server = server; +} + +RemoteConfig::~RemoteConfig() +{ + if(_server) + { + try + { + Test::Common::ServerPrxPtr server = ICE_UNCHECKED_CAST(Test::Common::ServerPrx, _server); + if(_status == 0) + { + server->waitTestSuccess(); + } + else + { + server->terminate(); + } + } + catch(const Ice::LocalException&) + { + if(_status == 0) + { + throw; + } + } + } +} + +bool +RemoteConfig::isRemote() const +{ + return _server != 0; +} + +void +RemoteConfig::finished(int status) +{ + _status = status; +} diff --git a/cpp/test/Ice/acm/AllTests.cpp b/cpp/test/Ice/acm/AllTests.cpp index d89c6827296..970ad0711ec 100644 --- a/cpp/test/Ice/acm/AllTests.cpp +++ b/cpp/test/Ice/acm/AllTests.cpp @@ -556,7 +556,7 @@ public: void allTests(const Ice::CommunicatorPtr& communicator) { - string ref = "communicator:default -p 12010"; + string ref = "communicator:" + getTestEndpoint(communicator, 0); RemoteCommunicatorPrxPtr com = ICE_UNCHECKED_CAST(RemoteCommunicatorPrx, communicator->stringToProxy(ref)); vector<TestCasePtr> tests; diff --git a/cpp/test/Ice/acm/Client.cpp b/cpp/test/Ice/acm/Client.cpp index df4130472ec..70cb93bf97c 100644 --- a/cpp/test/Ice/acm/Client.cpp +++ b/cpp/test/Ice/acm/Client.cpp @@ -15,7 +15,6 @@ DEFINE_TEST("client") using namespace std; - int run(int, char**, const Ice::CommunicatorPtr& communicator) { @@ -29,14 +28,22 @@ main(int argc, char* argv[]) { #ifdef ICE_STATIC_LIBS Ice::registerIceSSL(); +# if defined(__linux) + Ice::registerIceBT(); +# endif #endif + try { Ice::InitializationData initData; initData.properties = Ice::createProperties(argc, argv); initData.properties->setProperty("Ice.Warn.Connections", "0"); + Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData); - return run(argc, argv, ich.communicator()); + RemoteConfig rc("Ice/acm", argc, argv, ich.communicator()); + int status = run(argc, argv, ich.communicator()); + rc.finished(status); + return status; } catch(const Ice::Exception& ex) { diff --git a/cpp/test/Ice/acm/Makefile b/cpp/test/Ice/acm/Makefile index 4c24d87c4de..8848dab9e37 100644 --- a/cpp/test/Ice/acm/Makefile +++ b/cpp/test/Ice/acm/Makefile @@ -31,10 +31,12 @@ include $(top_srcdir)/config/Make.rules CPPFLAGS := -I. -I../../include $(CPPFLAGS) +LINKWITH := -lTestCommon $(LIBS) + $(CLIENT): $(COBJS) rm -f $@ - $(call mktest,$@,$(COBJS) ,$(LIBS)) + $(call mktest,$@,$(COBJS),$(LINKWITH)) $(SERVER): $(SOBJS) rm -f $@ - $(call mktest,$@,$(SOBJS) ,$(LIBS)) + $(call mktest,$@,$(SOBJS),$(LINKWITH)) diff --git a/cpp/test/Ice/acm/Makefile.mak b/cpp/test/Ice/acm/Makefile.mak index bb61b7d31d6..849b63893bd 100644 --- a/cpp/test/Ice/acm/Makefile.mak +++ b/cpp/test/Ice/acm/Makefile.mak @@ -40,6 +40,7 @@ OBJS = $(COBJS) \ !include $(top_srcdir)/config/Make.rules.mak CPPFLAGS = -I. -I../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN +LINKWITH = testcommon$(LIBSUFFIX).lib $(LIBS) !if "$(GENERATE_PDB)" == "yes" CPDBFLAGS = /pdb:$(CLIENT).pdb @@ -47,12 +48,12 @@ SPDBFLAGS = /pdb:$(SERVER).pdb !endif $(CLIENT)$(EXT): $(COBJS) - $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(SERVER)$(EXT): $(SOBJS) - $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest diff --git a/cpp/test/Ice/acm/Server.cpp b/cpp/test/Ice/acm/Server.cpp index a9c46ede6b2..39fce51801d 100644 --- a/cpp/test/Ice/acm/Server.cpp +++ b/cpp/test/Ice/acm/Server.cpp @@ -18,7 +18,7 @@ using namespace std; int run(int, char**, const Ice::CommunicatorPtr& communicator) { - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0)); communicator->getProperties()->setProperty("TestAdapter.ACM.Timeout", "0"); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); Ice::Identity id = communicator->stringToIdentity("communicator"); diff --git a/cpp/test/Ice/acm/TestI.cpp b/cpp/test/Ice/acm/TestI.cpp index fb554bca5d1..aa0ce6dd9af 100644 --- a/cpp/test/Ice/acm/TestI.cpp +++ b/cpp/test/Ice/acm/TestI.cpp @@ -72,7 +72,11 @@ RemoteCommunicatorI::createObjectAdapter(int timeout, int close, int heartbeat, Ice::CommunicatorPtr com = current.adapter->getCommunicator(); Ice::PropertiesPtr properties = com->getProperties(); string protocol = properties->getPropertyWithDefault("Ice.Default.Protocol", "tcp"); - string host = properties->getPropertyWithDefault("Ice.Default.Host", "127.0.0.1"); + string opts; + if(protocol != "bt") + { + opts = " -h \"" + properties->getPropertyWithDefault("Ice.Default.Host", "127.0.0.1") + "\""; + } string name = IceUtil::generateUUID(); if(timeout >= 0) @@ -88,7 +92,7 @@ RemoteCommunicatorI::createObjectAdapter(int timeout, int close, int heartbeat, properties->setProperty(name + ".ACM.Heartbeat", toString(heartbeat)); } properties->setProperty(name + ".ThreadPool.Size", "2"); - ObjectAdapterPtr adapter = com->createObjectAdapterWithEndpoints(name, protocol + " -h \"" + host + "\""); + ObjectAdapterPtr adapter = com->createObjectAdapterWithEndpoints(name, protocol + opts); return ICE_UNCHECKED_CAST(RemoteObjectAdapterPrx, current.adapter->addWithUUID( ICE_MAKE_SHARED(RemoteObjectAdapterI, adapter))); diff --git a/cpp/test/Ice/acm/run.py b/cpp/test/Ice/acm/run.py index ce8c5dd4b18..c1eec8b731d 100755 --- a/cpp/test/Ice/acm/run.py +++ b/cpp/test/Ice/acm/run.py @@ -20,4 +20,5 @@ if len(path) == 0: sys.path.append(os.path.join(path[0], "scripts")) import TestUtil -TestUtil.clientServerTest() +TestUtil.queueClientServerTest() +TestUtil.runQueuedTests() diff --git a/cpp/test/Ice/adapterDeactivation/AllTests.cpp b/cpp/test/Ice/adapterDeactivation/AllTests.cpp index b46f52d806b..3d558b88ab1 100644 --- a/cpp/test/Ice/adapterDeactivation/AllTests.cpp +++ b/cpp/test/Ice/adapterDeactivation/AllTests.cpp @@ -19,7 +19,7 @@ TestIntfPrxPtr allTests(const CommunicatorPtr& communicator) { cout << "testing stringToProxy... " << flush; - ObjectPrxPtr base = communicator->stringToProxy("test:default -p 12010"); + ObjectPrxPtr base = communicator->stringToProxy("test:" + getTestEndpoint(communicator, 0)); test(base); cout << "ok" << endl; @@ -69,9 +69,9 @@ allTests(const CommunicatorPtr& communicator) initData.properties = communicator->getProperties()->clone(); Ice::CommunicatorHolder comm = Ice::initialize(initData); #ifdef ICE_CPP11_MAPPING - comm->stringToProxy("test:default -p 12010")->ice_ping_async(); + comm->stringToProxy("test:" + getTestEndpoint(communicator, 0))->ice_ping_async(); #else - comm->stringToProxy("test:default -p 12010")->begin_ice_ping(); + comm->stringToProxy("test:" + getTestEndpoint(communicator, 0))->begin_ice_ping(); #endif } cout << "ok" << endl; diff --git a/cpp/test/Ice/adapterDeactivation/Collocated.cpp b/cpp/test/Ice/adapterDeactivation/Collocated.cpp index c4ead95efd2..38150a65f08 100644 --- a/cpp/test/Ice/adapterDeactivation/Collocated.cpp +++ b/cpp/test/Ice/adapterDeactivation/Collocated.cpp @@ -21,7 +21,7 @@ using namespace Test; int run(int, char**, const Ice::CommunicatorPtr& communicator) { - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0)); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); ServantLocatorPtr locator = ICE_MAKE_SHARED(ServantLocatorI); adapter->addServantLocator(locator, ""); diff --git a/cpp/test/Ice/adapterDeactivation/Makefile b/cpp/test/Ice/adapterDeactivation/Makefile index c212e23973e..986879401ab 100644 --- a/cpp/test/Ice/adapterDeactivation/Makefile +++ b/cpp/test/Ice/adapterDeactivation/Makefile @@ -40,14 +40,16 @@ include $(top_srcdir)/config/Make.rules CPPFLAGS := -I. -I../../include $(CPPFLAGS) +LINKWITH := -lTestCommon $(LIBS) + $(CLIENT): $(COBJS) rm -f $@ - $(call mktest,$@,$(COBJS),$(LIBS)) + $(call mktest,$@,$(COBJS),$(LINKWITH)) $(SERVER): $(SOBJS) rm -f $@ - $(call mktest,$@,$(SOBJS),$(LIBS)) + $(call mktest,$@,$(SOBJS),$(LINKWITH)) $(COLLOCATED): $(COLOBJS) rm -f $@ - $(call mktest,$@,$(COLOBJS),$(LIBS)) + $(call mktest,$@,$(COLOBJS),$(LINKWITH)) diff --git a/cpp/test/Ice/adapterDeactivation/Makefile.mak b/cpp/test/Ice/adapterDeactivation/Makefile.mak index 857b6651742..91c93ccbaaf 100644 --- a/cpp/test/Ice/adapterDeactivation/Makefile.mak +++ b/cpp/test/Ice/adapterDeactivation/Makefile.mak @@ -49,6 +49,7 @@ OBJS = $(COBJS) \ !include $(top_srcdir)/config/Make.rules.mak CPPFLAGS = -I. -I../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN +LINKWITH = testcommon$(LIBSUFFIX).lib $(LIBS) !if "$(GENERATE_PDB)" == "yes" CPDBFLAGS = /pdb:$(CLIENT).pdb @@ -57,17 +58,17 @@ COPDBFLAGS = /pdb:$(COLLOCATED).pdb !endif $(CLIENT)$(EXT): $(COBJS) - $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(SERVER)$(EXT): $(SOBJS) - $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(COLLOCATED)$(EXT): $(COLOBJS) - $(LINK) $(LD_TESTFLAGS) $(COPDBFLAGS) $(COLOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(COPDBFLAGS) $(COLOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest diff --git a/cpp/test/Ice/adapterDeactivation/Server.cpp b/cpp/test/Ice/adapterDeactivation/Server.cpp index 37c85a68653..c8d19f5d6f8 100644 --- a/cpp/test/Ice/adapterDeactivation/Server.cpp +++ b/cpp/test/Ice/adapterDeactivation/Server.cpp @@ -19,7 +19,7 @@ using namespace Ice; int run(int, char**, const Ice::CommunicatorPtr& communicator) { - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010:udp"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0) + ":udp"); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); ServantLocatorPtr locator = ICE_MAKE_SHARED(ServantLocatorI); adapter->addServantLocator(locator, ""); diff --git a/cpp/test/Ice/adapterDeactivation/run.py b/cpp/test/Ice/adapterDeactivation/run.py index c9767485188..eb52f00447a 100755 --- a/cpp/test/Ice/adapterDeactivation/run.py +++ b/cpp/test/Ice/adapterDeactivation/run.py @@ -20,5 +20,6 @@ if len(path) == 0: sys.path.append(os.path.join(path[0], "scripts")) import TestUtil -TestUtil.clientServerTest() -TestUtil.collocatedTest() +TestUtil.queueClientServerTest() +TestUtil.queueCollocatedTest() +TestUtil.runQueuedTests() diff --git a/cpp/test/Ice/admin/AllTests.cpp b/cpp/test/Ice/admin/AllTests.cpp index 09131385924..d7291121964 100644 --- a/cpp/test/Ice/admin/AllTests.cpp +++ b/cpp/test/Ice/admin/AllTests.cpp @@ -259,7 +259,7 @@ allTests(const Ice::CommunicatorPtr& communicator) } cout << "ok" << endl; - string ref = "factory:default -p 12010 -t 10000"; + string ref = "factory:" + getTestEndpoint(communicator, 0) + " -t 10000"; RemoteCommunicatorFactoryPrxPtr factory = ICE_UNCHECKED_CAST(RemoteCommunicatorFactoryPrx, communicator->stringToProxy(ref)); diff --git a/cpp/test/Ice/admin/Makefile b/cpp/test/Ice/admin/Makefile index 33e1fa6dae7..4556e4cc978 100644 --- a/cpp/test/Ice/admin/Makefile +++ b/cpp/test/Ice/admin/Makefile @@ -31,10 +31,12 @@ include $(top_srcdir)/config/Make.rules CPPFLAGS := -I. -I../../include $(CPPFLAGS) +LINKWITH := -lTestCommon $(LIBS) + $(CLIENT): $(COBJS) rm -f $@ - $(call mktest,$@,$(COBJS),$(LIBS)) + $(call mktest,$@,$(COBJS),$(LINKWITH)) $(SERVER): $(SOBJS) rm -f $@ - $(call mktest,$@,$(SOBJS),$(LIBS)) + $(call mktest,$@,$(SOBJS),$(LINKWITH)) diff --git a/cpp/test/Ice/admin/Makefile.mak b/cpp/test/Ice/admin/Makefile.mak index 88a53965a1d..d43fd63c0d5 100644 --- a/cpp/test/Ice/admin/Makefile.mak +++ b/cpp/test/Ice/admin/Makefile.mak @@ -40,6 +40,7 @@ OBJS = $(COBJS) \ !include $(top_srcdir)/config/Make.rules.mak CPPFLAGS = -I. -I../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN +LINKWITH = testcommon$(LIBSUFFIX).lib $(LIBS) !if "$(GENERATE_PDB)" == "yes" CPDBFLAGS = /pdb:$(CLIENT).pdb @@ -47,12 +48,12 @@ SPDBFLAGS = /pdb:$(SERVER).pdb !endif $(CLIENT)$(EXT): $(COBJS) - $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(SERVER)$(EXT): $(SOBJS) - $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest diff --git a/cpp/test/Ice/admin/Server.cpp b/cpp/test/Ice/admin/Server.cpp index 9414199da85..8861ed73915 100644 --- a/cpp/test/Ice/admin/Server.cpp +++ b/cpp/test/Ice/admin/Server.cpp @@ -18,7 +18,7 @@ DEFINE_TEST("server") int run(int, char**, const Ice::CommunicatorPtr& communicator) { - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010 -t 10000"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0) + " -t 10000"); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); Ice::Identity id = communicator->stringToIdentity("factory"); adapter->add(ICE_MAKE_SHARED(RemoteCommunicatorFactoryI), id); diff --git a/cpp/test/Ice/admin/run.py b/cpp/test/Ice/admin/run.py index ce8c5dd4b18..c1eec8b731d 100755 --- a/cpp/test/Ice/admin/run.py +++ b/cpp/test/Ice/admin/run.py @@ -20,4 +20,5 @@ if len(path) == 0: sys.path.append(os.path.join(path[0], "scripts")) import TestUtil -TestUtil.clientServerTest() +TestUtil.queueClientServerTest() +TestUtil.runQueuedTests() diff --git a/cpp/test/Ice/ami/AllTests.cpp b/cpp/test/Ice/ami/AllTests.cpp index c122840bff9..0fa6622c6da 100644 --- a/cpp/test/Ice/ami/AllTests.cpp +++ b/cpp/test/Ice/ami/AllTests.cpp @@ -851,14 +851,16 @@ typedef IceUtil::Handle<Thrower> ThrowerPtr; void allTests(const Ice::CommunicatorPtr& communicator, bool collocated) { + const string protocol = communicator->getProperties()->getProperty("Ice.Default.Protocol"); + #ifdef ICE_CPP11_MAPPING - string sref = "test:default -p 12010"; + string sref = "test:" + getTestEndpoint(communicator, 0); auto obj = communicator->stringToProxy(sref); test(obj); auto p = Ice::uncheckedCast<Test::TestIntfPrx>(obj); - sref = "testController:default -p 12011"; + sref = "testController:" + getTestEndpoint(communicator, 1); obj = communicator->stringToProxy(sref); test(obj); @@ -1195,7 +1197,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) // // Check that CommunicatorDestroyedException is raised directly. // - if(p->ice_getConnection()) + if(p->ice_getConnection() && protocol != "bt") { Ice::InitializationData initData; initData.properties = communicator->getProperties()->clone(); @@ -1679,7 +1681,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) test(p->waitForBatch(2)); } - if(p->ice_getConnection()) + if(p->ice_getConnection() && protocol != "bt") { test(p->opBatchCount() == 0); auto b1 = p->ice_batchOneway(); @@ -1754,6 +1756,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) promise.get_future().get(); } + if(protocol != "bt") { test(p->opBatchCount() == 0); auto b1 = Ice::uncheckedCast<Test::TestIntfPrx>( @@ -1816,6 +1819,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) test(p->waitForBatch(2)); } + if(protocol != "bt") { // // Exception - 1 connection. @@ -1844,6 +1848,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) test(p->opBatchCount() == 0); } + if(protocol != "bt") { // // 2 connections. @@ -1878,6 +1883,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) test(p->waitForBatch(4)); } + if(protocol != "bt") { // // 2 connections - 2 failures. @@ -1984,7 +1990,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) // // TODO port this to use the C++11 callback API // -// if(p->ice_getConnection()) +// if(p->ice_getConnection() && protocol != "bt") // { // cout << "testing close connection with sending queue... " << flush; // { @@ -2051,15 +2057,14 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) } - p->shutdown(); #else - string sref = "test:default -p 12010"; + string sref = "test:" + getTestEndpoint(communicator, 0); Ice::ObjectPrx obj = communicator->stringToProxy(sref); test(obj); Test::TestIntfPrx p = Test::TestIntfPrx::uncheckedCast(obj); - sref = "testController:default -p 12011"; + sref = "testController:" + getTestEndpoint(communicator, 1); obj = communicator->stringToProxy(sref); test(obj); @@ -2437,7 +2442,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) // // Check that CommunicatorDestroyedException is raised directly. // - if(p->ice_getConnection()) + if(p->ice_getConnection() && protocol != "bt") { Ice::InitializationData initData; initData.properties = communicator->getProperties()->clone(); @@ -3016,6 +3021,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) if(p->ice_getConnection()) { + if(protocol != "bt") { // // AsyncResult exception without cookie. @@ -3033,6 +3039,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) test(p->waitForBatch(1)); } + if(protocol != "bt") { // // AsyncResult exception with cookie. @@ -3082,7 +3089,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) test(p->waitForBatch(2)); } - if(p->ice_getConnection()) + if(p->ice_getConnection() && protocol != "bt") { { // @@ -3141,7 +3148,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) test(p->waitForBatch(2)); } - if(p->ice_getConnection()) + if(p->ice_getConnection() && protocol != "bt") { test(p->opBatchCount() == 0); Test::TestIntfPrx b1 = p->ice_batchOneway(); @@ -3208,6 +3215,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) test(p->waitForBatch(2)); } + if(protocol != "bt") { // // AsyncResult exception without cookie. @@ -3226,6 +3234,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) test(p->opBatchCount() == 0); } + if(protocol != "bt") { // // AsyncResult exception with cookie. @@ -3277,6 +3286,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) test(p->waitForBatch(2)); } + if(protocol != "bt") { // // Exception without cookie. @@ -3296,6 +3306,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) test(p->opBatchCount() == 0); } + if(protocol != "bt") { // // Exception with cookie. @@ -3338,7 +3349,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) test(p->waitForBatch(2)); } - if(p->ice_getConnection()) + if(p->ice_getConnection() && protocol != "bt") { // // Exception without cookie. @@ -3399,6 +3410,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) test(p->waitForBatch(2)); } + if(protocol != "bt") { // // AsyncResult exception without cookie - 1 connection. @@ -3417,6 +3429,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) test(p->opBatchCount() == 0); } + if(protocol != "bt") { // // AsyncResult exception with cookie - 1 connection. @@ -3433,6 +3446,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) test(p->opBatchCount() == 0); } + if(protocol != "bt") { // // AsyncResult - 2 connections. @@ -3457,6 +3471,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) test(p->waitForBatch(4)); } + if(protocol != "bt") { // // AsyncResult exception - 2 connections - 1 failure. @@ -3484,6 +3499,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) test(p->waitForBatch(1)); } + if(protocol != "bt") { // // AsyncResult exception - 2 connections - 2 failures. @@ -3547,6 +3563,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) test(p->waitForBatch(2)); } + if(protocol != "bt") { // // Exception without cookie - 1 connection. @@ -3566,6 +3583,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) test(p->opBatchCount() == 0); } + if(protocol != "bt") { // // Exception with cookie - 1 connection. @@ -3583,6 +3601,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) test(p->opBatchCount() == 0); } + if(protocol != "bt") { // // 2 connections. @@ -3609,6 +3628,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) test(p->waitForBatch(4)); } + if(protocol != "bt") { // // Exception - 2 connections - 1 failure. @@ -3637,6 +3657,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) test(p->waitForBatch(1)); } + if(protocol != "bt") { // // Exception - 2 connections - 2 failures. @@ -3689,6 +3710,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) test(p->waitForBatch(2)); } + if(protocol != "bt") { // // Exception without cookie - 1 connection. @@ -3734,6 +3756,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) test(p->waitForBatch(4)); } + if(protocol != "bt") { // // Exception - 2 connections - 1 failure. @@ -3762,6 +3785,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) test(p->waitForBatch(1)); } + if(protocol != "bt") { // // Exception - 2 connections - 2 failures. @@ -3988,7 +4012,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated) } cout << "ok" << endl; - if(p->ice_getConnection()) + if(p->ice_getConnection() && protocol != "bt") { cout << "testing close connection with sending queue... " << flush; { diff --git a/cpp/test/Ice/ami/Client.cpp b/cpp/test/Ice/ami/Client.cpp index 78de0c13009..28b4bf917ec 100644 --- a/cpp/test/Ice/ami/Client.cpp +++ b/cpp/test/Ice/ami/Client.cpp @@ -28,6 +28,9 @@ main(int argc, char* argv[]) { #ifdef ICE_STATIC_LIBS Ice::registerIceSSL(); +# if defined(__linux) + Ice::registerIceBT(); +# endif #endif try @@ -43,11 +46,14 @@ main(int argc, char* argv[]) initData.properties->setProperty("Ice.TCP.SndSize", "50000"); Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData); - return run(argc, argv, ich.communicator()); + RemoteConfig rc("Ice/ami", argc, argv, ich.communicator()); + int status = run(argc, argv, ich.communicator()); + rc.finished(status); + return status; } catch(const Ice::Exception& ex) { cerr << ex << endl; - return EXIT_FAILURE; + return EXIT_FAILURE; } } diff --git a/cpp/test/Ice/ami/Collocated.cpp b/cpp/test/Ice/ami/Collocated.cpp index 59309dbe248..1d7e1397758 100644 --- a/cpp/test/Ice/ami/Collocated.cpp +++ b/cpp/test/Ice/ami/Collocated.cpp @@ -18,8 +18,8 @@ using namespace std; int run(int, char**, const Ice::CommunicatorPtr& communicator) { - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010"); - communicator->getProperties()->setProperty("ControllerAdapter.Endpoints", "default -p 12011"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0)); + communicator->getProperties()->setProperty("ControllerAdapter.Endpoints", getTestEndpoint(communicator, 1)); communicator->getProperties()->setProperty("ControllerAdapter.ThreadPool.Size", "1"); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); diff --git a/cpp/test/Ice/ami/Makefile b/cpp/test/Ice/ami/Makefile index 4de5fd9f02d..09253ec0d26 100644 --- a/cpp/test/Ice/ami/Makefile +++ b/cpp/test/Ice/ami/Makefile @@ -38,14 +38,16 @@ include $(top_srcdir)/config/Make.rules CPPFLAGS := -I. -I../../include $(CPPFLAGS) +LINKWITH := -lTestCommon $(LIBS) + $(CLIENT): $(COBJS) rm -f $@ - $(call mktest,$@,$(COBJS),$(LIBS)) + $(call mktest,$@,$(COBJS),$(LINKWITH)) $(SERVER): $(SOBJS) rm -f $@ - $(call mktest,$@,$(SOBJS),$(LIBS)) + $(call mktest,$@,$(SOBJS),$(LINKWITH)) $(COLLOCATED): $(COLOBJS) rm -f $@ - $(call mktest,$@,$(COLOBJS),$(LIBS)) + $(call mktest,$@,$(COLOBJS),$(LINKWITH)) diff --git a/cpp/test/Ice/ami/Makefile.mak b/cpp/test/Ice/ami/Makefile.mak index a339f0448b8..3dccf42b9be 100644 --- a/cpp/test/Ice/ami/Makefile.mak +++ b/cpp/test/Ice/ami/Makefile.mak @@ -47,6 +47,7 @@ OBJS = $(COBJS) \ !include $(top_srcdir)/config/Make.rules.mak CPPFLAGS = -I. -I../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN +LINKWITH = testcommon$(LIBSUFFIX).lib $(LIBS) !if "$(GENERATE_PDB)" == "yes" CPDBFLAGS = /pdb:$(CLIENT).pdb @@ -55,17 +56,17 @@ COPDBFLAGS = /pdb:$(COLLOCATED).pdb !endif $(CLIENT)$(EXT): $(COBJS) - $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(SERVER)$(EXT): $(SOBJS) - $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(COLLOCATED)$(EXT): $(COLOBJS) - $(LINK) $(LD_TESTFLAGS) $(COPDBFLAGS) $(COLOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(COPDBFLAGS) $(COLOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest diff --git a/cpp/test/Ice/ami/Server.cpp b/cpp/test/Ice/ami/Server.cpp index 67c15379bb2..b655f4025dc 100644 --- a/cpp/test/Ice/ami/Server.cpp +++ b/cpp/test/Ice/ami/Server.cpp @@ -18,8 +18,8 @@ using namespace std; int run(int, char**, const Ice::CommunicatorPtr& communicator) { - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010"); - communicator->getProperties()->setProperty("ControllerAdapter.Endpoints", "default -p 12011"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0)); + communicator->getProperties()->setProperty("ControllerAdapter.Endpoints", getTestEndpoint(communicator, 1)); communicator->getProperties()->setProperty("ControllerAdapter.ThreadPool.Size", "1"); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); diff --git a/cpp/test/Ice/ami/run.py b/cpp/test/Ice/ami/run.py index 0816938a196..eb52f00447a 100755 --- a/cpp/test/Ice/ami/run.py +++ b/cpp/test/Ice/ami/run.py @@ -20,7 +20,6 @@ if len(path) == 0: sys.path.append(os.path.join(path[0], "scripts")) import TestUtil -print("tests with regular server.") -TestUtil.clientServerTest() -print("tests with collocated server.") -TestUtil.collocatedTest() +TestUtil.queueClientServerTest() +TestUtil.queueCollocatedTest() +TestUtil.runQueuedTests() diff --git a/cpp/test/Ice/background/AllTests.cpp b/cpp/test/Ice/background/AllTests.cpp index 70a44976b6d..900a611bfa7 100644 --- a/cpp/test/Ice/background/AllTests.cpp +++ b/cpp/test/Ice/background/AllTests.cpp @@ -202,13 +202,14 @@ void readWriteTests(const ConfigurationPtr&, const Test::BackgroundPrx&, const T BackgroundPrx allTests(const Ice::CommunicatorPtr& communicator) { - string sref = "background:default -p 12010"; + const string endp = getTestEndpoint(communicator, 0); + string sref = "background:" + endp; Ice::ObjectPrx obj = communicator->stringToProxy(sref); test(obj); BackgroundPrx background = BackgroundPrx::uncheckedCast(obj); - sref = "backgroundController:tcp -p 12011"; + sref = "backgroundController:" + getTestEndpoint(communicator, 1, "tcp"); obj = communicator->stringToProxy(sref); test(obj); @@ -245,7 +246,7 @@ allTests(const Ice::CommunicatorPtr& communicator) cout << "testing locator... " << flush; { Ice::LocatorPrx locator; - obj = communicator->stringToProxy("locator:default -p 12010")->ice_invocationTimeout(250); + obj = communicator->stringToProxy("locator:" + endp)->ice_invocationTimeout(250); locator = Ice::LocatorPrx::uncheckedCast(obj); obj = communicator->stringToProxy("background@Test")->ice_locator(locator)->ice_oneway(); @@ -260,7 +261,7 @@ allTests(const Ice::CommunicatorPtr& communicator) } backgroundController->resumeCall("findAdapterById"); - obj = communicator->stringToProxy("locator:default -p 12010"); + obj = communicator->stringToProxy("locator:" + endp); locator = Ice::LocatorPrx::uncheckedCast(obj); obj = obj->ice_locator(locator); obj->ice_ping(); @@ -285,7 +286,7 @@ allTests(const Ice::CommunicatorPtr& communicator) { Ice::RouterPrx router; - obj = communicator->stringToProxy("router:default -p 12010")->ice_invocationTimeout(250); + obj = communicator->stringToProxy("router:" + endp)->ice_invocationTimeout(250); router = Ice::RouterPrx::uncheckedCast(obj); obj = communicator->stringToProxy("background@Test")->ice_router(router)->ice_oneway(); @@ -300,7 +301,7 @@ allTests(const Ice::CommunicatorPtr& communicator) } backgroundController->resumeCall("getClientProxy"); - obj = communicator->stringToProxy("router:default -p 12010"); + obj = communicator->stringToProxy("router:" + endp); router = Ice::RouterPrx::uncheckedCast(obj); obj = communicator->stringToProxy("background@Test")->ice_router(router); BackgroundPrx bg = BackgroundPrx::uncheckedCast(obj); diff --git a/cpp/test/Ice/background/Makefile b/cpp/test/Ice/background/Makefile index 11b033ee78f..fd3ed0fbd29 100644 --- a/cpp/test/Ice/background/Makefile +++ b/cpp/test/Ice/background/Makefile @@ -46,15 +46,15 @@ OBJS = $(TRANSPORT_OBJS) \ include $(top_srcdir)/config/Make.rules CPPFLAGS := -I. -I../../include -I../../../src $(CPPFLAGS) $(NO_DEPRECATED_FLAGS) -LINKWITH := $(BZIP2_RPATH_LINK) -lIce -lIceUtil +LINKWITH := $(BZIP2_RPATH_LINK) -lTestCommon -lIce -lIceUtil $(CLIENT): $(COBJS) rm -f $@ - $(call mktest,$@,$(COBJS),$(LIBS)) + $(call mktest,$@,$(COBJS),$(LINKWITH)) $(SERVER): $(SOBJS) rm -f $@ - $(call mktest,$@,$(SOBJS),$(LIBS)) + $(call mktest,$@,$(SOBJS),$(LINKWITH)) $(TSPFILENAME): $(TRANSPORT_OBJS) rm -f $@ diff --git a/cpp/test/Ice/background/Makefile.mak b/cpp/test/Ice/background/Makefile.mak index 01b9940f29a..5b9aae0a0e0 100644 --- a/cpp/test/Ice/background/Makefile.mak +++ b/cpp/test/Ice/background/Makefile.mak @@ -44,7 +44,7 @@ OBJS = $(TRANSPORT_OBJS) \ !include $(top_srcdir)/config/Make.rules.mak CPPFLAGS = -I. -I../../include -I../../../src $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN -LINKWITH = $(LIBS) +LINKWITH = testcommon$(LIBSUFFIX).lib $(LIBS) !if "$(GENERATE_PDB)" == "yes" TPDBFLAGS = /pdb:$(DLLNAME:.dll=.pdb) @@ -53,12 +53,12 @@ SPDBFLAGS = /pdb:$(SERVER:.exe=.pdb) !endif $(CLIENT): $(COBJS) - $(LINK) $(LD_EXEFLAGS) $(CPDBFLAGS) $(SETARGV) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_EXEFLAGS) $(CPDBFLAGS) $(SETARGV) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(SERVER): $(SOBJS) - $(LINK) $(LD_EXEFLAGS) $(SPDBFLAGS) $(SETARGV) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_EXEFLAGS) $(SPDBFLAGS) $(SETARGV) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest diff --git a/cpp/test/Ice/background/Server.cpp b/cpp/test/Ice/background/Server.cpp index bb965e7ed96..cc0a4265bd2 100644 --- a/cpp/test/Ice/background/Server.cpp +++ b/cpp/test/Ice/background/Server.cpp @@ -8,6 +8,7 @@ // ********************************************************************** #include <Ice/Ice.h> +#include <TestCommon.h> #include <TestI.h> #include <Configuration.h> #include <PluginI.h> @@ -92,8 +93,8 @@ private: int run(int, char**, const Ice::CommunicatorPtr& communicator) { - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010"); - communicator->getProperties()->setProperty("ControllerAdapter.Endpoints", "tcp -p 12011"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0)); + communicator->getProperties()->setProperty("ControllerAdapter.Endpoints", getTestEndpoint(communicator, 1, "tcp")); communicator->getProperties()->setProperty("ControllerAdapter.ThreadPool.Size", "1"); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); diff --git a/cpp/test/Ice/background/run.py b/cpp/test/Ice/background/run.py index ce8c5dd4b18..c1eec8b731d 100755 --- a/cpp/test/Ice/background/run.py +++ b/cpp/test/Ice/background/run.py @@ -20,4 +20,5 @@ if len(path) == 0: sys.path.append(os.path.join(path[0], "scripts")) import TestUtil -TestUtil.clientServerTest() +TestUtil.queueClientServerTest() +TestUtil.runQueuedTests() diff --git a/cpp/test/Ice/binding/AllTests.cpp b/cpp/test/Ice/binding/AllTests.cpp index 9de164414e8..fedce8110f6 100644 --- a/cpp/test/Ice/binding/AllTests.cpp +++ b/cpp/test/Ice/binding/AllTests.cpp @@ -103,7 +103,7 @@ deactivate(const RemoteCommunicatorPrxPtr& com, vector<RemoteObjectAdapterPrxPtr void allTests(const Ice::CommunicatorPtr& communicator) { - string ref = "communicator:default -p 12010"; + string ref = "communicator:" + getTestEndpoint(communicator, 0); RemoteCommunicatorPrxPtr com = ICE_UNCHECKED_CAST(RemoteCommunicatorPrx, communicator->stringToProxy(ref)); RandomNumberGenerator rng; diff --git a/cpp/test/Ice/binding/Client.cpp b/cpp/test/Ice/binding/Client.cpp index c66e79a5c5a..e1a944f0c41 100644 --- a/cpp/test/Ice/binding/Client.cpp +++ b/cpp/test/Ice/binding/Client.cpp @@ -28,11 +28,18 @@ main(int argc, char* argv[]) { #ifdef ICE_STATIC_LIBS Ice::registerIceSSL(); +# if defined(__linux) + Ice::registerIceBT(); +# endif #endif + try { Ice::CommunicatorHolder ich = Ice::initialize(argc, argv); - return run(argc, argv, ich.communicator()); + RemoteConfig rc("Ice/binding", argc, argv, ich.communicator()); + int status = run(argc, argv, ich.communicator()); + rc.finished(status); + return status; } catch(const Ice::Exception& ex) { diff --git a/cpp/test/Ice/binding/Makefile b/cpp/test/Ice/binding/Makefile index 33e1fa6dae7..4556e4cc978 100644 --- a/cpp/test/Ice/binding/Makefile +++ b/cpp/test/Ice/binding/Makefile @@ -31,10 +31,12 @@ include $(top_srcdir)/config/Make.rules CPPFLAGS := -I. -I../../include $(CPPFLAGS) +LINKWITH := -lTestCommon $(LIBS) + $(CLIENT): $(COBJS) rm -f $@ - $(call mktest,$@,$(COBJS),$(LIBS)) + $(call mktest,$@,$(COBJS),$(LINKWITH)) $(SERVER): $(SOBJS) rm -f $@ - $(call mktest,$@,$(SOBJS),$(LIBS)) + $(call mktest,$@,$(SOBJS),$(LINKWITH)) diff --git a/cpp/test/Ice/binding/Makefile.mak b/cpp/test/Ice/binding/Makefile.mak index f707af46233..d6453b14796 100644 --- a/cpp/test/Ice/binding/Makefile.mak +++ b/cpp/test/Ice/binding/Makefile.mak @@ -40,6 +40,7 @@ OBJS = $(COBJS) \ !include $(top_srcdir)/config/Make.rules.mak CPPFLAGS = -I. -I../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN +LINKWITH = testcommon$(LIBSUFFIX).lib $(LIBS) !if "$(GENERATE_PDB)" == "yes" CPDBFLAGS = /pdb:$(CLIENT).pdb @@ -47,12 +48,12 @@ SPDBFLAGS = /pdb:$(SERVER).pdb !endif $(CLIENT)$(EXT): $(COBJS) - $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(SERVER)$(EXT): $(SOBJS) - $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest diff --git a/cpp/test/Ice/binding/Server.cpp b/cpp/test/Ice/binding/Server.cpp index 0d8d44be843..1a05743d645 100644 --- a/cpp/test/Ice/binding/Server.cpp +++ b/cpp/test/Ice/binding/Server.cpp @@ -18,7 +18,7 @@ using namespace std; int run(int, char**, const Ice::CommunicatorPtr& communicator) { - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010:udp"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0) + ":udp"); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); Ice::Identity id = communicator->stringToIdentity("communicator"); adapter->add(ICE_MAKE_SHARED(RemoteCommunicatorI), id); diff --git a/cpp/test/Ice/binding/TestI.cpp b/cpp/test/Ice/binding/TestI.cpp index 104966084d0..cdf9d7595c9 100644 --- a/cpp/test/Ice/binding/TestI.cpp +++ b/cpp/test/Ice/binding/TestI.cpp @@ -26,19 +26,23 @@ RemoteObjectAdapterPrx RemoteCommunicatorI::createObjectAdapter(const string& name, const string& endpts, const Current& current) #endif { + Ice::CommunicatorPtr com = current.adapter->getCommunicator(); + const string defaultProtocol = com->getProperties()->getProperty("Ice.Default.Protocol"); + string endpoints = endpts; - if(endpoints.find("-p") == string::npos) + if(defaultProtocol != "bt") { - // Use a fixed port if none is specified (bug 2896) - ostringstream os; - os << endpoints << " -h \"" - << (current.adapter->getCommunicator()->getProperties()->getPropertyWithDefault( - "Ice.Default.Host", "127.0.0.1")) - << "\" -p " << _nextPort++; - endpoints = os.str(); + if(endpoints.find("-p") == string::npos) + { + // Use a fixed port if none is specified (bug 2896) + ostringstream os; + os << endpoints << " -h \"" + << (com->getProperties()->getPropertyWithDefault("Ice.Default.Host", "127.0.0.1")) + << "\" -p " << _nextPort++; + endpoints = os.str(); + } } - Ice::CommunicatorPtr com = current.adapter->getCommunicator(); com->getProperties()->setProperty(name + ".ThreadPool.Size", "1"); ObjectAdapterPtr adapter = com->createObjectAdapterWithEndpoints(name, endpoints); return ICE_UNCHECKED_CAST(RemoteObjectAdapterPrx, current.adapter->addWithUUID(ICE_MAKE_SHARED(RemoteObjectAdapterI, adapter))); diff --git a/cpp/test/Ice/binding/run.py b/cpp/test/Ice/binding/run.py index ce8c5dd4b18..c1eec8b731d 100755 --- a/cpp/test/Ice/binding/run.py +++ b/cpp/test/Ice/binding/run.py @@ -20,4 +20,5 @@ if len(path) == 0: sys.path.append(os.path.join(path[0], "scripts")) import TestUtil -TestUtil.clientServerTest() +TestUtil.queueClientServerTest() +TestUtil.runQueuedTests() diff --git a/cpp/test/Ice/checksum/AllTests.cpp b/cpp/test/Ice/checksum/AllTests.cpp index dc0283ecac5..baf9bdbd63b 100644 --- a/cpp/test/Ice/checksum/AllTests.cpp +++ b/cpp/test/Ice/checksum/AllTests.cpp @@ -16,7 +16,7 @@ using namespace std; Test::ChecksumPrxPtr allTests(const Ice::CommunicatorPtr& communicator, bool) { - string ref = "test:default -p 12010"; + string ref = "test:" + getTestEndpoint(communicator, 0); Ice::ObjectPrxPtr base = communicator->stringToProxy(ref); test(base); diff --git a/cpp/test/Ice/checksum/Makefile b/cpp/test/Ice/checksum/Makefile index b0b72f23708..e8034f127dc 100644 --- a/cpp/test/Ice/checksum/Makefile +++ b/cpp/test/Ice/checksum/Makefile @@ -26,11 +26,13 @@ include $(top_srcdir)/config/Make.rules CPPFLAGS := -I. -I../../include $(CPPFLAGS) +LINKWITH := -lTestCommon $(LIBS) + SLICE2CPPFLAGS := --checksum $(SLICE2CPPFLAGS) $(CLIENT): $(COBJS) rm -f $@ - $(call mktest,$@,$(COBJS),$(LIBS)) + $(call mktest,$@,$(COBJS),$(LINKWITH)) SUBDIRS = server diff --git a/cpp/test/Ice/checksum/Makefile.mak b/cpp/test/Ice/checksum/Makefile.mak index 9147024f1c7..5e6d584c45a 100644 --- a/cpp/test/Ice/checksum/Makefile.mak +++ b/cpp/test/Ice/checksum/Makefile.mak @@ -24,13 +24,14 @@ OBJS = $(SLICE_OBJS) \ SLICE2CPPFLAGS = --checksum $(SLICE2CPPFLAGS) CPPFLAGS = -I. -I../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN +LINKWITH = testcommon$(LIBSUFFIX).lib $(LIBS) !if "$(GENERATE_PDB)" == "yes" PDBFLAGS = /pdb:$(CLIENT:.exe=.pdb) !endif $(CLIENT): $(OBJS) - $(LINK) $(LD_EXEFLAGS) $(PDBFLAGS) $(SETARGV) $(OBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_EXEFLAGS) $(PDBFLAGS) $(SETARGV) $(OBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest diff --git a/cpp/test/Ice/checksum/run.py b/cpp/test/Ice/checksum/run.py index db935718825..70361473f99 100755 --- a/cpp/test/Ice/checksum/run.py +++ b/cpp/test/Ice/checksum/run.py @@ -21,4 +21,5 @@ sys.path.append(os.path.join(path[0], "scripts")) import TestUtil server = os.path.join(os.getcwd(), "server", "server") -TestUtil.clientServerTest(server = server) +TestUtil.queueClientServerTest(server = server) +TestUtil.runQueuedTests() diff --git a/cpp/test/Ice/checksum/server/Makefile b/cpp/test/Ice/checksum/server/Makefile index a60c508d46e..dba411adfba 100644 --- a/cpp/test/Ice/checksum/server/Makefile +++ b/cpp/test/Ice/checksum/server/Makefile @@ -26,8 +26,10 @@ include $(top_srcdir)/config/Make.rules CPPFLAGS := -I. -I../../../include $(CPPFLAGS) +LINKWITH := -lTestCommon $(LIBS) + SLICE2CPPFLAGS := --checksum $(SLICE2CPPFLAGS) $(SERVER): $(SOBJS) rm -f $@ - $(call mktest,$@,$(SOBJS),$(LIBS)) + $(call mktest,$@,$(SOBJS),$(LINKWITH)) diff --git a/cpp/test/Ice/checksum/server/Makefile.mak b/cpp/test/Ice/checksum/server/Makefile.mak index c8e619231e4..f6407e5d156 100644 --- a/cpp/test/Ice/checksum/server/Makefile.mak +++ b/cpp/test/Ice/checksum/server/Makefile.mak @@ -26,13 +26,14 @@ SRCS = $(SOBJS:.obj=.cpp) SLICE2CPPFLAGS = --checksum $(SLICE2CPPFLAGS) CPPFLAGS = -I. -I../../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN +LINKWITH = testcommon$(LIBSUFFIX).lib $(LIBS) !if "$(GENERATE_PDB)" == "yes" PDBFLAGS = /pdb:$(SERVER:.exe=.pdb) !endif $(SERVER): $(OBJS) - $(LINK) $(LD_EXEFLAGS) $(PDBFLAGS) $(SETARGV) $(OBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_EXEFLAGS) $(PDBFLAGS) $(SETARGV) $(OBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest diff --git a/cpp/test/Ice/checksum/server/Server.cpp b/cpp/test/Ice/checksum/server/Server.cpp index 38a621ab15b..2f517f0e126 100644 --- a/cpp/test/Ice/checksum/server/Server.cpp +++ b/cpp/test/Ice/checksum/server/Server.cpp @@ -18,7 +18,7 @@ DEFINE_TEST("server") int run(int, char**, const Ice::CommunicatorPtr& communicator) { - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010 -t 10000"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0) + " -t 10000"); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); adapter->add(ICE_MAKE_SHARED(ChecksumI), communicator->stringToIdentity("test")); adapter->activate(); diff --git a/cpp/test/Ice/custom/AllTests.cpp b/cpp/test/Ice/custom/AllTests.cpp index 1ba93ec0f39..625990d7adc 100644 --- a/cpp/test/Ice/custom/AllTests.cpp +++ b/cpp/test/Ice/custom/AllTests.cpp @@ -577,9 +577,9 @@ typedef IceUtil::Handle<Callback> CallbackPtr; Test::TestIntfPrx allTests(const Ice::CommunicatorPtr& communicator) { + const string endp = getTestEndpoint(communicator, 0); cout << "testing stringToProxy... " << flush; - string ref = communicator->getProperties()->getPropertyWithDefault( - "Custom.Proxy", "test:default -p 12010"); + string ref = communicator->getProperties()->getPropertyWithDefault("Custom.Proxy", "test:" + endp); Ice::ObjectPrx base = communicator->stringToProxy(ref); test(base); cout << "ok" << endl; @@ -1012,11 +1012,11 @@ allTests(const Ice::CommunicatorPtr& communicator) { deque<Test::CPrx> in(5); - in[0] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C1:default -p 12010 -t 10000")); - in[1] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C2:default -p 12010 -t 10001")); - in[2] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C3:default -p 12010 -t 10002")); - in[3] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C4:default -p 12010 -t 10003")); - in[4] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C5:default -p 12010 -t 10004")); + in[0] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C1:" + endp + " -t 10000")); + in[1] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C2:" + endp + " -t 10001")); + in[2] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C3:" + endp + " -t 10002")); + in[3] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C4:" + endp + " -t 10003")); + in[4] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C5:" + endp + " -t 10004")); deque<Test::CPrx> out; deque<Test::CPrx> ret = t->opCPrxSeq(in, out); @@ -1026,11 +1026,11 @@ allTests(const Ice::CommunicatorPtr& communicator) { list<Test::CPrx> in; - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C1:default -p 12010 -t 10000"))); - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C2:default -p 12010 -t 10001"))); - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C3:default -p 12010 -t 10002"))); - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C4:default -p 12010 -t 10003"))); - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C5:default -p 12010 -t 10004"))); + in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C1:" + endp + " -t 10000"))); + in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C2:" + endp + " -t 10001"))); + in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C3:" + endp + " -t 10002"))); + in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C4:" + endp + " -t 10003"))); + in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C5:" + endp + " -t 10004"))); list<Test::CPrx> out; list<Test::CPrx> ret = t->opCPrxList(in, out); @@ -1637,11 +1637,11 @@ allTests(const Ice::CommunicatorPtr& communicator) { deque<Test::CPrx> in(5); - in[0] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C1:default -p 12010 -t 10000")); - in[1] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C2:default -p 12010 -t 10001")); - in[2] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C3:default -p 12010 -t 10002")); - in[3] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C4:default -p 12010 -t 10003")); - in[4] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C5:default -p 12010 -t 10004")); + in[0] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C1:" + endp + " -t 10000")); + in[1] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C2:" + endp + " -t 10001")); + in[2] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C3:" + endp + " -t 10002")); + in[3] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C4:" + endp + " -t 10003")); + in[4] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C5:" + endp + " -t 10004")); deque<Test::CPrx> out; Ice::AsyncResultPtr r = t->begin_opCPrxSeq(in); @@ -1652,11 +1652,11 @@ allTests(const Ice::CommunicatorPtr& communicator) { list<Test::CPrx> in; - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C1:default -p 12010 -t 10000"))); - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C2:default -p 12010 -t 10001"))); - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C3:default -p 12010 -t 10002"))); - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C4:default -p 12010 -t 10003"))); - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C5:default -p 12010 -t 10004"))); + in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C1:" + endp + " -t 10000"))); + in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C2:" + endp + " -t 10001"))); + in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C3:" + endp + " -t 10002"))); + in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C4:" + endp + " -t 10003"))); + in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C5:" + endp + " -t 10004"))); list<Test::CPrx> out; Ice::AsyncResultPtr r = t->begin_opCPrxList(in); @@ -2185,11 +2185,11 @@ allTests(const Ice::CommunicatorPtr& communicator) { deque<Test::CPrx> in(5); - in[0] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C1:default -p 12010 -t 10000")); - in[1] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C2:default -p 12010 -t 10001")); - in[2] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C3:default -p 12010 -t 10002")); - in[3] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C4:default -p 12010 -t 10003")); - in[4] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C5:default -p 12010 -t 10004")); + in[0] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C1:" + endp + " -t 10000")); + in[1] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C2:" + endp + " -t 10001")); + in[2] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C3:" + endp + " -t 10002")); + in[3] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C4:" + endp + " -t 10003")); + in[4] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C5:" + endp + " -t 10004")); CallbackPtr cb = new Callback(); Test::Callback_TestIntf_opCPrxSeqPtr callback = @@ -2200,11 +2200,11 @@ allTests(const Ice::CommunicatorPtr& communicator) { list<Test::CPrx> in; - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C1:default -p 12010 -t 10000"))); - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C2:default -p 12010 -t 10001"))); - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C3:default -p 12010 -t 10002"))); - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C4:default -p 12010 -t 10003"))); - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C5:default -p 12010 -t 10004"))); + in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C1:" + endp + " -t 10000"))); + in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C2:" + endp + " -t 10001"))); + in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C3:" + endp + " -t 10002"))); + in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C4:" + endp + " -t 10003"))); + in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C5:" + endp + " -t 10004"))); CallbackPtr cb = new Callback(); Test::Callback_TestIntf_opCPrxListPtr callback = @@ -2867,11 +2867,11 @@ allTests(const Ice::CommunicatorPtr& communicator) { deque<Test::CPrx> in(5); - in[0] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C1:default -p 12010 -t 10000")); - in[1] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C2:default -p 12010 -t 10001")); - in[2] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C3:default -p 12010 -t 10002")); - in[3] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C4:default -p 12010 -t 10003")); - in[4] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C5:default -p 12010 -t 10004")); + in[0] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C1:" + endp + " -t 10000")); + in[1] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C2:" + endp + " -t 10001")); + in[2] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C3:" + endp + " -t 10002")); + in[3] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C4:" + endp + " -t 10003")); + in[4] = Test::CPrx::uncheckedCast(communicator->stringToProxy("C5:" + endp + " -t 10004")); CallbackPtr cb = new Callback(); t->begin_opCPrxSeq(in, @@ -2888,11 +2888,11 @@ allTests(const Ice::CommunicatorPtr& communicator) { list<Test::CPrx> in; - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C1:default -p 12010 -t 10000"))); - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C2:default -p 12010 -t 10001"))); - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C3:default -p 12010 -t 10002"))); - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C4:default -p 12010 -t 10003"))); - in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C5:default -p 12010 -t 10004"))); + in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C1:" + endp + " -t 10000"))); + in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C2:" + endp + " -t 10001"))); + in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C3:" + endp + " -t 10002"))); + in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C4:" + endp + " -t 10003"))); + in.push_back(Test::CPrx::uncheckedCast(communicator->stringToProxy("C5:" + endp + " -t 10004"))); CallbackPtr cb = new Callback(); t->begin_opCPrxList(in, @@ -3271,13 +3271,13 @@ allTests(const Ice::CommunicatorPtr& communicator) Test2::WstringWStringDict wdict2; wdict2 = wdict1; - ref = communicator->getProperties()->getPropertyWithDefault("Custom.WstringProxy1", "wstring1:default -p 12010"); + ref = communicator->getProperties()->getPropertyWithDefault("Custom.WstringProxy1", "wstring1:" + endp); base = communicator->stringToProxy(ref); test(base); Test1::WstringClassPrx wsc1 = Test1::WstringClassPrx::checkedCast(base); test(t); - ref = communicator->getProperties()->getPropertyWithDefault("Custom.WstringProxy2", "wstring2:default -p 12010"); + ref = communicator->getProperties()->getPropertyWithDefault("Custom.WstringProxy2", "wstring2:" + endp); base = communicator->stringToProxy(ref); test(base); Test2::WstringClassPrx wsc2 = Test2::WstringClassPrx::checkedCast(base); diff --git a/cpp/test/Ice/custom/Collocated.cpp b/cpp/test/Ice/custom/Collocated.cpp index 4aa75410b6b..3c072aed1bf 100644 --- a/cpp/test/Ice/custom/Collocated.cpp +++ b/cpp/test/Ice/custom/Collocated.cpp @@ -20,6 +20,7 @@ DEFINE_TEST("collocated") int run(int, char**, const Ice::CommunicatorPtr& communicator) { + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0)); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); adapter->add(new TestIntfI(communicator), communicator->stringToIdentity("test")); adapter->add(new Test1::WstringClassI, communicator->stringToIdentity("wstring1")); @@ -45,10 +46,7 @@ main(int argc, char** argv) IceUtil::setProcessStringConverter(new Test::StringConverterI()); IceUtil::setProcessWstringConverter(new Test::WstringConverterI()); - Ice::InitializationData initData; - initData.properties = Ice::createProperties(argc, argv); - initData.properties->setProperty("TestAdapter.Endpoints", "default -p 12010"); - communicator = Ice::initialize(argc, argv, initData); + communicator = Ice::initialize(argc, argv); status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) diff --git a/cpp/test/Ice/custom/Makefile b/cpp/test/Ice/custom/Makefile index 73fa9486798..f294c35b1d1 100644 --- a/cpp/test/Ice/custom/Makefile +++ b/cpp/test/Ice/custom/Makefile @@ -64,6 +64,8 @@ include $(top_srcdir)/config/Make.rules CPPFLAGS := -I. -I../../include $(CPPFLAGS) -DSTRING_VIEW_IGNORE_STRING_CONVERTER +LINKWITH := -lTestCommon $(LIBS) + # # Disables optimization when building with Solaris CC: # AllTests.cpp takes a very very long time to compile with -O @@ -80,16 +82,16 @@ endif $(CLIENT): $(COBJS) rm -f $@ - $(call mktest,$@,$(COBJS),$(LIBS)) + $(call mktest,$@,$(COBJS),$(LINKWITH)) $(SERVER): $(SOBJS) rm -f $@ - $(call mktest,$@,$(SOBJS),$(LIBS)) + $(call mktest,$@,$(SOBJS),$(LINKWITH)) $(SERVERAMD): $(SAMDOBJS) rm -f $@ - $(call mktest,$@,$(SAMDOBJS),$(LIBS)) + $(call mktest,$@,$(SAMDOBJS),$(LINKWITH)) $(COLLOCATED): $(COLOBJS) rm -f $@ - $(call mktest,$@,$(COLOBJS),$(LIBS)) + $(call mktest,$@,$(COLOBJS),$(LINKWITH)) diff --git a/cpp/test/Ice/custom/Makefile.mak b/cpp/test/Ice/custom/Makefile.mak index eb5ee807e4a..354cb8f8a3b 100644 --- a/cpp/test/Ice/custom/Makefile.mak +++ b/cpp/test/Ice/custom/Makefile.mak @@ -61,6 +61,7 @@ OBJS = $(COBJS) \ !include $(top_srcdir)/config/Make.rules.mak CPPFLAGS = -I. -I../../include $(CPPFLAGS) -DSTRING_VIEW_IGNORE_STRING_CONVERTER -DWIN32_LEAN_AND_MEAN -Zm300 -bigobj +LINKWITH = testcommon$(LIBSUFFIX).lib $(LIBS) !if "$(GENERATE_PDB)" == "yes" CPDBFLAGS = /pdb:$(CLIENT:.exe=.pdb) @@ -70,22 +71,22 @@ COPDBFLAGS = /pdb:$(COLLOCATED:.exe=.pdb) !endif $(CLIENT): $(COBJS) - $(LINK) $(LD_EXEFLAGS) $(CPDBFLAGS) $(SETARGV) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_EXEFLAGS) $(CPDBFLAGS) $(SETARGV) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(SERVER): $(SOBJS) - $(LINK) $(LD_EXEFLAGS) $(SPDBFLAGS) $(SETARGV) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_EXEFLAGS) $(SPDBFLAGS) $(SETARGV) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(SERVERAMD): $(SAMDOBJS) - $(LINK) $(LD_EXEFLAGS) $(SAPDBFLAGS) $(SETARGV) $(SAMDOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_EXEFLAGS) $(SAPDBFLAGS) $(SETARGV) $(SAMDOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(COLLOCATED): $(COLOBJS) - $(LINK) $(LD_EXEFLAGS) $(COPDBFLAGS) $(SETARGV) $(COLOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_EXEFLAGS) $(COPDBFLAGS) $(SETARGV) $(COLOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest diff --git a/cpp/test/Ice/custom/Server.cpp b/cpp/test/Ice/custom/Server.cpp index e854b07f514..e67df41083d 100644 --- a/cpp/test/Ice/custom/Server.cpp +++ b/cpp/test/Ice/custom/Server.cpp @@ -20,6 +20,7 @@ DEFINE_TEST("server") int run(int, char**, const Ice::CommunicatorPtr& communicator) { + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0)); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); adapter->add(new TestIntfI(communicator), communicator->stringToIdentity("test")); adapter->add(new Test1::WstringClassI, communicator->stringToIdentity("wstring1")); @@ -46,11 +47,7 @@ main(int argc, char** argv) IceUtil::setProcessStringConverter(new Test::StringConverterI); IceUtil::setProcessWstringConverter(new Test::WstringConverterI); - Ice::InitializationData initData; - initData.properties = Ice::createProperties(argc, argv); - initData.properties->setProperty("TestAdapter.Endpoints", "default -p 12010"); - - communicator = Ice::initialize(argc, argv, initData); + communicator = Ice::initialize(argc, argv); status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) diff --git a/cpp/test/Ice/custom/ServerAMD.cpp b/cpp/test/Ice/custom/ServerAMD.cpp index 82593b21a6d..a8e2a653140 100644 --- a/cpp/test/Ice/custom/ServerAMD.cpp +++ b/cpp/test/Ice/custom/ServerAMD.cpp @@ -20,6 +20,7 @@ DEFINE_TEST("serveramd") int run(int, char**, const Ice::CommunicatorPtr& communicator) { + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0)); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); adapter->add(new TestIntfI(communicator), communicator->stringToIdentity("test")); adapter->add(new Test1::WstringClassI, communicator->stringToIdentity("wstring1")); @@ -46,11 +47,7 @@ main(int argc, char** argv) IceUtil::setProcessStringConverter(new Test::StringConverterI()); IceUtil::setProcessWstringConverter(new Test::WstringConverterI()); - Ice::InitializationData initData; - initData.properties = Ice::createProperties(argc, argv); - - initData.properties->setProperty("TestAdapter.Endpoints", "default -p 12010"); - communicator = Ice::initialize(argc, argv, initData); + communicator = Ice::initialize(argc, argv); status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) diff --git a/cpp/test/Ice/custom/run.py b/cpp/test/Ice/custom/run.py index 6d8f4682523..ab0953a3b3a 100755 --- a/cpp/test/Ice/custom/run.py +++ b/cpp/test/Ice/custom/run.py @@ -20,9 +20,8 @@ if len(path) == 0: sys.path.append(os.path.join(path[0], "scripts")) import TestUtil -print("tests with regular server.") -TestUtil.clientServerTest() -print("tests with AMD server.") -TestUtil.clientServerTest(server = "serveramd") -print("tests with collocated server.") -TestUtil.collocatedTest() +TestUtil.queueClientServerTest() +TestUtil.queueClientServerTest(configName = "amd", localOnly = True, message = "Running test with AMD server.", + server = "serveramd") +TestUtil.queueCollocatedTest() +TestUtil.runQueuedTests() diff --git a/cpp/test/Ice/dispatcher/AllTests.cpp b/cpp/test/Ice/dispatcher/AllTests.cpp index 6f36faa9ef7..e42055fcdc9 100644 --- a/cpp/test/Ice/dispatcher/AllTests.cpp +++ b/cpp/test/Ice/dispatcher/AllTests.cpp @@ -112,13 +112,13 @@ ICE_DEFINE_PTR(CallbackPtr, Callback); void allTests(const Ice::CommunicatorPtr& communicator) { - string sref = "test:default -p 12010"; + string sref = "test:" + getTestEndpoint(communicator, 0); Ice::ObjectPrxPtr obj = communicator->stringToProxy(sref); test(obj); Test::TestIntfPrxPtr p = ICE_UNCHECKED_CAST(Test::TestIntfPrx, obj); - sref = "testController:tcp -p 12011"; + sref = "testController:" + getTestEndpoint(communicator, 1, "tcp"); obj = communicator->stringToProxy(sref); test(obj); diff --git a/cpp/test/Ice/dispatcher/Collocated.cpp b/cpp/test/Ice/dispatcher/Collocated.cpp index e76bfa09b08..afa55d366ba 100644 --- a/cpp/test/Ice/dispatcher/Collocated.cpp +++ b/cpp/test/Ice/dispatcher/Collocated.cpp @@ -19,8 +19,8 @@ using namespace std; int run(int, char**, const Ice::CommunicatorPtr& communicator) { - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010"); - communicator->getProperties()->setProperty("ControllerAdapter.Endpoints", "tcp -p 12011"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0)); + communicator->getProperties()->setProperty("ControllerAdapter.Endpoints", getTestEndpoint(communicator, 1, "tcp")); communicator->getProperties()->setProperty("ControllerAdapter.ThreadPool.Size", "1"); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); diff --git a/cpp/test/Ice/dispatcher/Makefile b/cpp/test/Ice/dispatcher/Makefile index d60583058c8..b20873b1ab6 100644 --- a/cpp/test/Ice/dispatcher/Makefile +++ b/cpp/test/Ice/dispatcher/Makefile @@ -41,14 +41,16 @@ include $(top_srcdir)/config/Make.rules CPPFLAGS := -I. -I../../include $(CPPFLAGS) +LINKWITH := -lTestCommon $(LIBS) + $(CLIENT): $(COBJS) rm -f $@ - $(call mktest,$@,$(COBJS),$(LIBS)) + $(call mktest,$@,$(COBJS),$(LINKWITH)) $(SERVER): $(SOBJS) rm -f $@ - $(call mktest,$@,$(SOBJS),$(LIBS)) + $(call mktest,$@,$(SOBJS),$(LINKWITH)) $(COLLOCATED): $(COLOBJS) rm -f $@ - $(call mktest,$@,$(COLOBJS),$(LIBS)) + $(call mktest,$@,$(COLOBJS),$(LINKWITH)) diff --git a/cpp/test/Ice/dispatcher/Makefile.mak b/cpp/test/Ice/dispatcher/Makefile.mak index c0a168cc955..16a7f5b47d7 100644 --- a/cpp/test/Ice/dispatcher/Makefile.mak +++ b/cpp/test/Ice/dispatcher/Makefile.mak @@ -50,6 +50,7 @@ OBJS = $(COBJS) \ !include $(top_srcdir)/config/Make.rules.mak CPPFLAGS = -I. -I../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN +LINKWITH = testcommon$(LIBSUFFIX).lib $(LIBS) !if "$(GENERATE_PDB)" == "yes" CPDBFLAGS = /pdb:$(CLIENT).pdb @@ -58,17 +59,17 @@ COLPDBFLAGS = /pdb:$(COLLOCATED).pdb !endif $(CLIENT)$(EXT): $(COBJS) - $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(SERVER)$(EXT): $(SOBJS) - $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(COLLOCATED)$(EXT): $(COLOBJS) - $(LINK) $(LD_TESTFLAGS) $(COLPDBFLAGS) $(COLOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(COLPDBFLAGS) $(COLOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest diff --git a/cpp/test/Ice/dispatcher/Server.cpp b/cpp/test/Ice/dispatcher/Server.cpp index efbf63e3692..923a40db870 100644 --- a/cpp/test/Ice/dispatcher/Server.cpp +++ b/cpp/test/Ice/dispatcher/Server.cpp @@ -19,8 +19,8 @@ using namespace std; int run(int, char**, const Ice::CommunicatorPtr& communicator) { - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010"); - communicator->getProperties()->setProperty("ControllerAdapter.Endpoints", "tcp -p 12011"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0)); + communicator->getProperties()->setProperty("ControllerAdapter.Endpoints", getTestEndpoint(communicator, 1, "tcp")); communicator->getProperties()->setProperty("ControllerAdapter.ThreadPool.Size", "1"); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); diff --git a/cpp/test/Ice/dispatcher/run.py b/cpp/test/Ice/dispatcher/run.py index 0816938a196..eb52f00447a 100755 --- a/cpp/test/Ice/dispatcher/run.py +++ b/cpp/test/Ice/dispatcher/run.py @@ -20,7 +20,6 @@ if len(path) == 0: sys.path.append(os.path.join(path[0], "scripts")) import TestUtil -print("tests with regular server.") -TestUtil.clientServerTest() -print("tests with collocated server.") -TestUtil.collocatedTest() +TestUtil.queueClientServerTest() +TestUtil.queueCollocatedTest() +TestUtil.runQueuedTests() diff --git a/cpp/test/Ice/echo/Makefile b/cpp/test/Ice/echo/Makefile index 7c8ebcee3aa..7d85b872d90 100644 --- a/cpp/test/Ice/echo/Makefile +++ b/cpp/test/Ice/echo/Makefile @@ -25,6 +25,8 @@ include $(top_srcdir)/config/Make.rules CPPFLAGS := -I. -I../../include $(CPPFLAGS) +LINKWITH := -lTestCommon $(LIBS) + $(SERVER): $(OBJS) rm -f $@ - $(call mktest,$@,$(OBJS),$(LIBS)) + $(call mktest,$@,$(OBJS),$(LINKWITH)) diff --git a/cpp/test/Ice/echo/Makefile.mak b/cpp/test/Ice/echo/Makefile.mak index 62fd0a8d8af..67cc290222b 100644 --- a/cpp/test/Ice/echo/Makefile.mak +++ b/cpp/test/Ice/echo/Makefile.mak @@ -32,6 +32,7 @@ OBJS = $(SLICE_OBJS) \ !include $(top_srcdir)/config/Make.rules.mak CPPFLAGS = -I. -I../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN +LINKWITH = testcommon$(LIBSUFFIX).lib $(LIBS) !if "$(GENERATE_PDB)" == "yes" CPDBFLAGS = /pdb:$(CLIENT).pdb @@ -39,7 +40,7 @@ SPDBFLAGS = /pdb:$(SERVER).pdb !endif $(SERVER)$(EXT): $(OBJS) - $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(OBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(OBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest diff --git a/cpp/test/Ice/echo/Server.cpp b/cpp/test/Ice/echo/Server.cpp index 668aa7ef619..7a789c5db1f 100644 --- a/cpp/test/Ice/echo/Server.cpp +++ b/cpp/test/Ice/echo/Server.cpp @@ -48,7 +48,7 @@ private: int run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) { - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0)); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); BlobjectIPtr blob = new BlobjectI; adapter->addDefaultServant(blob, ""); diff --git a/cpp/test/Ice/enums/AllTests.cpp b/cpp/test/Ice/enums/AllTests.cpp index bb531fb4019..9178e812945 100644 --- a/cpp/test/Ice/enums/AllTests.cpp +++ b/cpp/test/Ice/enums/AllTests.cpp @@ -18,7 +18,7 @@ using namespace Test; TestIntfPrxPtr allTests(const Ice::CommunicatorPtr& communicator) { - string ref = "test:default -p 12010"; + string ref = "test:" + getTestEndpoint(communicator, 0); Ice::ObjectPrxPtr obj = communicator->stringToProxy(ref); test(obj); TestIntfPrxPtr proxy = ICE_CHECKED_CAST(TestIntfPrx, obj); diff --git a/cpp/test/Ice/enums/Client.cpp b/cpp/test/Ice/enums/Client.cpp index 2d3ca3fc480..bb5fc6503d7 100644 --- a/cpp/test/Ice/enums/Client.cpp +++ b/cpp/test/Ice/enums/Client.cpp @@ -30,16 +30,22 @@ main(int argc, char* argv[]) { #ifdef ICE_STATIC_LIBS Ice::registerIceSSL(); +# if defined(__linux) + Ice::registerIceBT(); +# endif #endif try { Ice::CommunicatorHolder ich = Ice::initialize(argc, argv); - return run(argc, argv, ich.communicator()); + RemoteConfig rc("Ice/enums", argc, argv, ich.communicator()); + int status = run(argc, argv, ich.communicator()); + rc.finished(status); + return status; } catch(const Ice::Exception& ex) { cerr << ex << endl; - return EXIT_FAILURE; + return EXIT_FAILURE; } } diff --git a/cpp/test/Ice/enums/Makefile b/cpp/test/Ice/enums/Makefile index e70cc46e187..47d5ed126f1 100644 --- a/cpp/test/Ice/enums/Makefile +++ b/cpp/test/Ice/enums/Makefile @@ -32,10 +32,12 @@ include $(top_srcdir)/config/Make.rules CPPFLAGS := -I. -I../../include $(CPPFLAGS) SLICE2CPPFLAGS := $(SLICE2CPPFLAGS) +LINKWITH := -lTestCommon $(LIBS) + $(CLIENT): $(COBJS) rm -f $@ - $(call mktest,$@,$(COBJS),$(LIBS)) + $(call mktest,$@,$(COBJS),$(LINKWITH)) $(SERVER): $(SOBJS) rm -f $@ - $(call mktest,$@,$(SOBJS),$(LIBS)) + $(call mktest,$@,$(SOBJS),$(LINKWITH)) diff --git a/cpp/test/Ice/enums/Makefile.mak b/cpp/test/Ice/enums/Makefile.mak index 4aa1215b93e..f9433b35482 100644 --- a/cpp/test/Ice/enums/Makefile.mak +++ b/cpp/test/Ice/enums/Makefile.mak @@ -41,6 +41,7 @@ OBJS = $(COBJS) \ CPPFLAGS = -I. -I../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN SLICE2CPPFLAGS = $(SLICE2CPPFLAGS) +LINKWITH = testcommon$(LIBSUFFIX).lib $(LIBS) !if "$(GENERATE_PDB)" == "yes" CPDBFLAGS = /pdb:$(CLIENT).pdb @@ -48,12 +49,12 @@ SPDBFLAGS = /pdb:$(SERVER).pdb !endif $(CLIENT)$(EXT): $(COBJS) - $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(SERVER)$(EXT): $(SOBJS) - $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest diff --git a/cpp/test/Ice/enums/Server.cpp b/cpp/test/Ice/enums/Server.cpp index dce40a3a616..fd854cb878d 100644 --- a/cpp/test/Ice/enums/Server.cpp +++ b/cpp/test/Ice/enums/Server.cpp @@ -18,7 +18,7 @@ using namespace std; int run(int, char**, const Ice::CommunicatorPtr& communicator) { - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0)); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); adapter->add(ICE_MAKE_SHARED(TestIntfI), communicator->stringToIdentity("test")); diff --git a/cpp/test/Ice/enums/run.py b/cpp/test/Ice/enums/run.py index ad8767bd99e..838b1f97164 100755 --- a/cpp/test/Ice/enums/run.py +++ b/cpp/test/Ice/enums/run.py @@ -20,9 +20,9 @@ if len(path) == 0: sys.path.append(os.path.join(path[0], "scripts")) import TestUtil -print("Running test with 1.0 encoding.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", - additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.queueClientServerTest(configName = "1.0", message = "Running test with 1.0 encoding.", + additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") -print("Running test with 1.1 encoding.") -TestUtil.clientServerTest() +TestUtil.queueClientServerTest(configName = "1.1", message = "Running test with 1.1 encoding.") +TestUtil.runQueuedTests() diff --git a/cpp/test/Ice/exceptions/AllTests.cpp b/cpp/test/Ice/exceptions/AllTests.cpp index 55eaa81147e..4850d9e32b7 100644 --- a/cpp/test/Ice/exceptions/AllTests.cpp +++ b/cpp/test/Ice/exceptions/AllTests.cpp @@ -7,6 +7,7 @@ // // ********************************************************************** +#include <IceUtil/IceUtil.h> #include <Ice/Ice.h> #include <TestCommon.h> #include <Test.h> @@ -487,6 +488,20 @@ allTests(const Ice::CommunicatorPtr& communicator) } cout << "ok" << endl; + string localOAEndpoint; + { + ostringstream ostr; + if(communicator->getProperties()->getProperty("Ice.Default.Protocol") == "bt") + { + ostr << "default -a *"; + } + else + { + ostr << "default -h *"; + } + localOAEndpoint = ostr.str(); + } + cout << "testing object adapter registration exceptions... " << flush; { Ice::ObjectAdapterPtr first; @@ -505,9 +520,7 @@ allTests(const Ice::CommunicatorPtr& communicator) // Expected } - string host = communicator->getProperties()->getPropertyAsIntWithDefault("Ice.IPv6", 0) == 0 ? - "127.0.0.1" : "\"0:0:0:0:0:0:0:1\""; - communicator->getProperties()->setProperty("TestAdapter0.Endpoints", "default -h " + host); + communicator->getProperties()->setProperty("TestAdapter0.Endpoints", localOAEndpoint); first = communicator->createObjectAdapter("TestAdapter0"); try { @@ -547,9 +560,7 @@ allTests(const Ice::CommunicatorPtr& communicator) cout << "testing servant registration exceptions... " << flush; { - string host = communicator->getProperties()->getPropertyAsIntWithDefault("Ice.IPv6", 0) == 0 ? - "127.0.0.1" : "\"0:0:0:0:0:0:0:1\""; - communicator->getProperties()->setProperty("TestAdapter1.Endpoints", "default -h " + host); + communicator->getProperties()->setProperty("TestAdapter1.Endpoints", localOAEndpoint); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter1"); Ice::ObjectPtr obj = ICE_MAKE_SHARED(EmptyI); adapter->add(obj, communicator->stringToIdentity("x")); @@ -594,7 +605,6 @@ allTests(const Ice::CommunicatorPtr& communicator) } } - adapter->remove(communicator->stringToIdentity("x")); try { @@ -616,9 +626,7 @@ allTests(const Ice::CommunicatorPtr& communicator) cout << "testing servant locator registrations exceptions... " << flush; { - string host = communicator->getProperties()->getPropertyAsIntWithDefault("Ice.IPv6", 0) == 0 ? - "127.0.0.1" : "\"0:0:0:0:0:0:0:1\""; - communicator->getProperties()->setProperty("TestAdapter2.Endpoints", "default -h " + host); + communicator->getProperties()->setProperty("TestAdapter2.Endpoints", localOAEndpoint); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter2"); Ice::ServantLocatorPtr loc = ICE_MAKE_SHARED(ServantLocatorI); adapter->addServantLocator(loc, "x"); @@ -673,7 +681,7 @@ allTests(const Ice::CommunicatorPtr& communicator) cout << "ok" << endl; cout << "testing stringToProxy... " << flush; - string ref = "thrower:default -p 12010"; + string ref = "thrower:" + getTestEndpoint(communicator, 0); Ice::ObjectPrxPtr base = communicator->stringToProxy(ref); test(base); cout << "ok" << endl; @@ -977,7 +985,8 @@ allTests(const Ice::CommunicatorPtr& communicator) test(false); } - ThrowerPrxPtr thrower2 = ICE_UNCHECKED_CAST(ThrowerPrx, communicator->stringToProxy("thrower:default -p 12011")); + ThrowerPrxPtr thrower2 = + ICE_UNCHECKED_CAST(ThrowerPrx, communicator->stringToProxy("thrower:" + getTestEndpoint(communicator, 1))); try { thrower2->throwMemoryLimitException(Ice::ByteSeq(2 * 1024 * 1024)); // 2MB (no limits) @@ -985,7 +994,8 @@ allTests(const Ice::CommunicatorPtr& communicator) catch(const Ice::MemoryLimitException&) { } - ThrowerPrxPtr thrower3 = ICE_UNCHECKED_CAST(ThrowerPrx, communicator->stringToProxy("thrower:default -p 12012")); + ThrowerPrxPtr thrower3 = + ICE_UNCHECKED_CAST(ThrowerPrx, communicator->stringToProxy("thrower:" + getTestEndpoint(communicator, 2))); try { thrower3->throwMemoryLimitException(Ice::ByteSeq(1024)); // 1KB limit diff --git a/cpp/test/Ice/exceptions/Client.cpp b/cpp/test/Ice/exceptions/Client.cpp index 7782971d575..c7b0cb63039 100644 --- a/cpp/test/Ice/exceptions/Client.cpp +++ b/cpp/test/Ice/exceptions/Client.cpp @@ -32,6 +32,9 @@ main(int argc, char* argv[]) { #ifdef ICE_STATIC_LIBS Ice::registerIceSSL(); +# if defined(__linux) + Ice::registerIceBT(); +# endif #endif try @@ -42,7 +45,10 @@ main(int argc, char* argv[]) initData.properties->setProperty("Ice.MessageSizeMax", "10"); // 10KB max Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData); - return run(argc, argv, ich.communicator()); + RemoteConfig rc("Ice/exceptions", argc, argv, ich.communicator()); + int status = run(argc, argv, ich.communicator()); + rc.finished(status); + return status; } catch(const Ice::Exception& ex) { diff --git a/cpp/test/Ice/exceptions/Collocated.cpp b/cpp/test/Ice/exceptions/Collocated.cpp index 6751f82ece4..54f18c1ae99 100644 --- a/cpp/test/Ice/exceptions/Collocated.cpp +++ b/cpp/test/Ice/exceptions/Collocated.cpp @@ -19,7 +19,7 @@ using namespace Test; int run(int, char**, const Ice::CommunicatorPtr& communicator) { - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0)); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); Ice::ObjectPtr object = ICE_MAKE_SHARED(ThrowerI); adapter->add(object, communicator->stringToIdentity("thrower")); diff --git a/cpp/test/Ice/exceptions/Makefile b/cpp/test/Ice/exceptions/Makefile index 47013a10590..2a62ef277e0 100644 --- a/cpp/test/Ice/exceptions/Makefile +++ b/cpp/test/Ice/exceptions/Makefile @@ -50,18 +50,20 @@ include $(top_srcdir)/config/Make.rules CPPFLAGS := -I. -I../../include $(CPPFLAGS) +LINKWITH := -lTestCommon $(LIBS) + $(CLIENT): $(COBJS) rm -f $@ - $(call mktest,$@,$(COBJS),$(LIBS)) + $(call mktest,$@,$(COBJS),$(LINKWITH)) $(SERVER): $(SOBJS) rm -f $@ - $(call mktest,$@,$(SOBJS),$(LIBS)) + $(call mktest,$@,$(SOBJS),$(LINKWITH)) $(SERVERAMD): $(SAMDOBJS) rm -f $@ - $(call mktest,$@,$(SAMDOBJS),$(LIBS)) + $(call mktest,$@,$(SAMDOBJS),$(LINKWITH)) $(COLLOCATED): $(COLOBJS) rm -f $@ - $(call mktest,$@,$(COLOBJS),$(LIBS)) + $(call mktest,$@,$(COLOBJS),$(LINKWITH)) diff --git a/cpp/test/Ice/exceptions/Makefile.mak b/cpp/test/Ice/exceptions/Makefile.mak index 8563430ee96..7a07c5ba185 100644 --- a/cpp/test/Ice/exceptions/Makefile.mak +++ b/cpp/test/Ice/exceptions/Makefile.mak @@ -58,6 +58,7 @@ OBJS = $(COBJS) \ !include $(top_srcdir)/config/Make.rules.mak CPPFLAGS = -I. -I../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN +LINKWITH = testcommon$(LIBSUFFIX).lib $(LIBS) !if "$(GENERATE_PDB)" == "yes" CPDBFLAGS = /pdb:$(CLIENT).pdb @@ -67,22 +68,22 @@ COPDBFLAGS = /pdb:$(COLLOCATED).pdb !endif $(CLIENT)$(EXT): $(COBJS) - $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(SERVER)$(EXT): $(SOBJS) - $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(SERVERAMD)$(EXT): $(SAMDOBJS) $(OBJS) - $(LINK) $(LD_TESTFLAGS) $(SAPDBFLAGS) $(SAMDOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(SAPDBFLAGS) $(SAMDOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(COLLOCATED)$(EXT): $(COLOBJS) - $(LINK) $(LD_TESTFLAGS) $(COPDBFLAGS) $(COLOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(COPDBFLAGS) $(COLOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest diff --git a/cpp/test/Ice/exceptions/Server.cpp b/cpp/test/Ice/exceptions/Server.cpp index 4177ba51722..a1fae488246 100644 --- a/cpp/test/Ice/exceptions/Server.cpp +++ b/cpp/test/Ice/exceptions/Server.cpp @@ -18,6 +18,11 @@ using namespace std; int run(int, char**, const Ice::CommunicatorPtr& communicator) { + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0) + ":udp"); + communicator->getProperties()->setProperty("TestAdapter2.Endpoints", getTestEndpoint(communicator, 1)); + communicator->getProperties()->setProperty("TestAdapter2.MessageSizeMax", "0"); + communicator->getProperties()->setProperty("TestAdapter3.Endpoints", getTestEndpoint(communicator, 2)); + communicator->getProperties()->setProperty("TestAdapter3.MessageSizeMax", "1"); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); Ice::ObjectAdapterPtr adapter2 = communicator->createObjectAdapter("TestAdapter2"); Ice::ObjectAdapterPtr adapter3 = communicator->createObjectAdapter("TestAdapter3"); @@ -46,12 +51,7 @@ main(int argc, char* argv[]) initData.properties = Ice::createProperties(argc, argv); initData.properties->setProperty("Ice.Warn.Dispatch", "0"); initData.properties->setProperty("Ice.Warn.Connections", "0"); - initData.properties->setProperty("TestAdapter.Endpoints", "default -p 12010:udp"); initData.properties->setProperty("Ice.MessageSizeMax", "10"); // 10KB max - initData.properties->setProperty("TestAdapter2.Endpoints", "default -p 12011"); - initData.properties->setProperty("TestAdapter2.MessageSizeMax", "0"); - initData.properties->setProperty("TestAdapter3.Endpoints", "default -p 12012"); - initData.properties->setProperty("TestAdapter3.MessageSizeMax", "1"); Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData); return run(argc, argv, ich.communicator()); diff --git a/cpp/test/Ice/exceptions/ServerAMD.cpp b/cpp/test/Ice/exceptions/ServerAMD.cpp index f93fd0e2a2f..14bfcc40cc4 100644 --- a/cpp/test/Ice/exceptions/ServerAMD.cpp +++ b/cpp/test/Ice/exceptions/ServerAMD.cpp @@ -18,6 +18,11 @@ using namespace std; int run(int, char**, const Ice::CommunicatorPtr& communicator) { + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0) + ":udp"); + communicator->getProperties()->setProperty("TestAdapter2.Endpoints", getTestEndpoint(communicator, 1)); + communicator->getProperties()->setProperty("TestAdapter2.MessageSizeMax", "0"); + communicator->getProperties()->setProperty("TestAdapter3.Endpoints", getTestEndpoint(communicator, 2)); + communicator->getProperties()->setProperty("TestAdapter3.MessageSizeMax", "1"); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); Ice::ObjectAdapterPtr adapter2 = communicator->createObjectAdapter("TestAdapter2"); Ice::ObjectAdapterPtr adapter3 = communicator->createObjectAdapter("TestAdapter3"); @@ -46,12 +51,7 @@ main(int argc, char* argv[]) initData.properties = Ice::createProperties(argc, argv); initData.properties->setProperty("Ice.Warn.Dispatch", "0"); initData.properties->setProperty("Ice.Warn.Connections", "0"); - initData.properties->setProperty("TestAdapter.Endpoints", "default -p 12010:udp"); initData.properties->setProperty("Ice.MessageSizeMax", "10"); // 10KB max - initData.properties->setProperty("TestAdapter2.Endpoints", "default -p 12011"); - initData.properties->setProperty("TestAdapter2.MessageSizeMax", "0"); - initData.properties->setProperty("TestAdapter3.Endpoints", "default -p 12012"); - initData.properties->setProperty("TestAdapter3.MessageSizeMax", "1"); Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData); return run(argc, argv, ich.communicator()); diff --git a/cpp/test/Ice/exceptions/run.py b/cpp/test/Ice/exceptions/run.py index b90a1b41d48..95919818241 100755 --- a/cpp/test/Ice/exceptions/run.py +++ b/cpp/test/Ice/exceptions/run.py @@ -20,29 +20,31 @@ if len(path) == 0: sys.path.append(os.path.join(path[0], "scripts")) import TestUtil -print("Running test with compact (default) format.") -TestUtil.clientServerTest() - -print("Running test with sliced format.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.SlicedFormat", - additionalServerOptions="--Ice.Default.SlicedFormat") - -print("Running test with 1.0 encoding.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", - additionalServerOptions="--Ice.Default.EncodingVersion=1.0") - -print("Running test with compact (default) format and AMD server.") -TestUtil.clientServerTest(server="serveramd") - -print("Running test with sliced format and AMD server.") -TestUtil.clientServerTest(server="serveramd", - additionalClientOptions="--Ice.Default.SlicedFormat", - additionalServerOptions="--Ice.Default.SlicedFormat") - -print("Running test with 1.0 encoding and AMD server.") -TestUtil.clientServerTest(server="serveramd", - additionalClientOptions="--Ice.Default.EncodingVersion=1.0", - additionalServerOptions="--Ice.Default.EncodingVersion=1.0") - -print("Running collocated test.") -TestUtil.collocatedTest() +TestUtil.queueClientServerTest(configName = "compact", message = "Running test with compact (default) format.") + +TestUtil.queueClientServerTest(configName = "sliced", message = "Running test with sliced format.", + additionalClientOptions="--Ice.Default.SlicedFormat", + additionalServerOptions="--Ice.Default.SlicedFormat") + +TestUtil.queueClientServerTest(configName = "1.0", message = "Running test with 1.0 encoding.", + additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") + +TestUtil.queueClientServerTest(configName = "compactAMD", localOnly = True, + message = "Running test with compact (default) format and AMD server.", + server="serveramd") + +TestUtil.queueClientServerTest(configName = "slicedAMD", localOnly = True, + message = "Running test with sliced format and AMD server.", + server="serveramd", + additionalClientOptions="--Ice.Default.SlicedFormat", + additionalServerOptions="--Ice.Default.SlicedFormat") + +TestUtil.queueClientServerTest(configName = "1.0AMD", localOnly = True, + message = "Running test with 1.0 encoding and AMD server.", + server="serveramd", + additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") + +TestUtil.queueCollocatedTest() +TestUtil.runQueuedTests() diff --git a/cpp/test/Ice/facets/AllTests.cpp b/cpp/test/Ice/facets/AllTests.cpp index 9ea52c2f771..c10ba942b0a 100644 --- a/cpp/test/Ice/facets/AllTests.cpp +++ b/cpp/test/Ice/facets/AllTests.cpp @@ -44,9 +44,20 @@ allTests(const Ice::CommunicatorPtr& communicator) cout << "ok" << endl; cout << "testing facet registration exceptions... " << flush; - string host = communicator->getProperties()->getPropertyAsIntWithDefault("Ice.IPv6", 0) == 0 ? - "127.0.0.1" : "\"0:0:0:0:0:0:0:1\""; - communicator->getProperties()->setProperty("FacetExceptionTestAdapter.Endpoints", "default -h " + host); + string localOAEndpoint; + { + ostringstream ostr; + if(communicator->getProperties()->getProperty("Ice.Default.Protocol") == "bt") + { + ostr << "default -a *"; + } + else + { + ostr << "default -h *"; + } + localOAEndpoint = ostr.str(); + } + communicator->getProperties()->setProperty("FacetExceptionTestAdapter.Endpoints", localOAEndpoint); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("FacetExceptionTestAdapter"); Ice::ObjectPtr obj = ICE_MAKE_SHARED(EmptyI); adapter->add(obj, communicator->stringToIdentity("d")); @@ -101,7 +112,7 @@ allTests(const Ice::CommunicatorPtr& communicator) adapter->deactivate(); cout << "testing stringToProxy... " << flush; - string ref = "d:default -p 12010"; + string ref = "d:" + getTestEndpoint(communicator, 0); Ice::ObjectPrxPtr db = communicator->stringToProxy(ref); test(db); cout << "ok" << endl; diff --git a/cpp/test/Ice/facets/Client.cpp b/cpp/test/Ice/facets/Client.cpp index be799e603bf..aa2161344bb 100644 --- a/cpp/test/Ice/facets/Client.cpp +++ b/cpp/test/Ice/facets/Client.cpp @@ -30,16 +30,22 @@ main(int argc, char* argv[]) { #ifdef ICE_STATIC_LIBS Ice::registerIceSSL(); +# if defined(__linux) + Ice::registerIceBT(); +# endif #endif try { Ice::CommunicatorHolder ich = Ice::initialize(argc, argv); - return run(argc, argv, ich.communicator()); + RemoteConfig rc("Ice/facets", argc, argv, ich.communicator()); + int status = run(argc, argv, ich.communicator()); + rc.finished(status); + return status; } catch(const Ice::Exception& ex) { cerr << ex << endl; - return EXIT_FAILURE; + return EXIT_FAILURE; } } diff --git a/cpp/test/Ice/facets/Collocated.cpp b/cpp/test/Ice/facets/Collocated.cpp index 035ae9bc480..3390f809817 100644 --- a/cpp/test/Ice/facets/Collocated.cpp +++ b/cpp/test/Ice/facets/Collocated.cpp @@ -19,7 +19,7 @@ using namespace Test; int run(int, char**, const Ice::CommunicatorPtr& communicator) { - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0)); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); Ice::ObjectPtr d = ICE_MAKE_SHARED(DI); adapter->add(d, communicator->stringToIdentity("d")); diff --git a/cpp/test/Ice/facets/Makefile b/cpp/test/Ice/facets/Makefile index 084ef7d8f02..4890a63bced 100644 --- a/cpp/test/Ice/facets/Makefile +++ b/cpp/test/Ice/facets/Makefile @@ -38,14 +38,16 @@ include $(top_srcdir)/config/Make.rules CPPFLAGS := -I. -I../../include $(CPPFLAGS) +LINKWITH := -lTestCommon $(LIBS) + $(CLIENT): $(COBJS) rm -f $@ - $(call mktest,$@,$(COBJS),$(LIBS)) + $(call mktest,$@,$(COBJS),$(LINKWITH)) $(SERVER): $(SOBJS) rm -f $@ - $(call mktest,$@,$(SOBJS),$(LIBS)) + $(call mktest,$@,$(SOBJS),$(LINKWITH)) $(COLLOCATED): $(COLOBJS) rm -f $@ - $(call mktest,$@,$(COLOBJS),$(LIBS)) + $(call mktest,$@,$(COLOBJS),$(LINKWITH)) diff --git a/cpp/test/Ice/facets/Makefile.mak b/cpp/test/Ice/facets/Makefile.mak index 0805d11b3f1..3ffe148e145 100644 --- a/cpp/test/Ice/facets/Makefile.mak +++ b/cpp/test/Ice/facets/Makefile.mak @@ -47,6 +47,7 @@ OBJS = $(COBJS) \ !include $(top_srcdir)/config/Make.rules.mak CPPFLAGS = -I. -I../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN +LINKWITH = testcommon$(LIBSUFFIX).lib $(LIBS) !if "$(GENERATE_PDB)" == "yes" CPDBFLAGS = /pdb:$(CLIENT).pdb @@ -55,17 +56,17 @@ COPDBFLAGS = /pdb:$(COLLOCATED).pdb !endif $(CLIENT)$(EXT): $(COBJS) - $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(SERVER)$(EXT): $(SOBJS) - $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(COLLOCATED)$(EXT): $(COLOBJS) - $(LINK) $(LD_TESTFLAGS) $(COPDBFLAGS) $(COLOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(COPDBFLAGS) $(COLOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest diff --git a/cpp/test/Ice/facets/Server.cpp b/cpp/test/Ice/facets/Server.cpp index e6ecec14ee6..e6fea6cc5bd 100644 --- a/cpp/test/Ice/facets/Server.cpp +++ b/cpp/test/Ice/facets/Server.cpp @@ -18,7 +18,7 @@ using namespace std; int run(int, char**, const Ice::CommunicatorPtr& communicator) { - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0)); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); Ice::ObjectPtr d = ICE_MAKE_SHARED(DI); adapter->add(d, communicator->stringToIdentity("d")); diff --git a/cpp/test/Ice/facets/run.py b/cpp/test/Ice/facets/run.py index c9767485188..eb52f00447a 100755 --- a/cpp/test/Ice/facets/run.py +++ b/cpp/test/Ice/facets/run.py @@ -20,5 +20,6 @@ if len(path) == 0: sys.path.append(os.path.join(path[0], "scripts")) import TestUtil -TestUtil.clientServerTest() -TestUtil.collocatedTest() +TestUtil.queueClientServerTest() +TestUtil.queueCollocatedTest() +TestUtil.runQueuedTests() diff --git a/cpp/test/Ice/hold/AllTests.cpp b/cpp/test/Ice/hold/AllTests.cpp index 525dcc1135a..621ec2763af 100644 --- a/cpp/test/Ice/hold/AllTests.cpp +++ b/cpp/test/Ice/hold/AllTests.cpp @@ -81,10 +81,10 @@ void allTests(const Ice::CommunicatorPtr& communicator) { cout << "testing stringToProxy... " << flush; - string ref = "hold:default -p 12010"; + string ref = "hold:" + getTestEndpoint(communicator, 0); Ice::ObjectPrxPtr base = communicator->stringToProxy(ref); test(base); - string refSerialized = "hold:default -p 12011"; + string refSerialized = "hold:" + getTestEndpoint(communicator, 1); Ice::ObjectPrxPtr baseSerialized = communicator->stringToProxy(refSerialized); test(base); cout << "ok" << endl; diff --git a/cpp/test/Ice/hold/Client.cpp b/cpp/test/Ice/hold/Client.cpp index 4edf543d623..9e08d981b3a 100644 --- a/cpp/test/Ice/hold/Client.cpp +++ b/cpp/test/Ice/hold/Client.cpp @@ -29,11 +29,18 @@ main(int argc, char* argv[]) { #ifdef ICE_STATIC_LIBS Ice::registerIceSSL(); +# if defined(__linux) + Ice::registerIceBT(); +# endif #endif + try { Ice::CommunicatorHolder ich = Ice::initialize(argc, argv); - return run(argc, argv, ich.communicator()); + RemoteConfig rc("Ice/hold", argc, argv, ich.communicator()); + int status = run(argc, argv, ich.communicator()); + rc.finished(status); + return status; } catch(const Ice::Exception& ex) { diff --git a/cpp/test/Ice/hold/Makefile b/cpp/test/Ice/hold/Makefile index 73cbd82bdc7..cbaaed8a43f 100644 --- a/cpp/test/Ice/hold/Makefile +++ b/cpp/test/Ice/hold/Makefile @@ -31,10 +31,12 @@ include $(top_srcdir)/config/Make.rules CPPFLAGS := -I. -I../../include $(CPPFLAGS) +LINKWITH := -lTestCommon $(LIBS) + $(CLIENT): $(COBJS) rm -f $@ - $(call mktest,$@,$(COBJS),$(LIBS)) + $(call mktest,$@,$(COBJS),$(LINKWITH)) $(SERVER): $(SOBJS) rm -f $@ - $(call mktest,$@,$(SOBJS),$(LIBS)) + $(call mktest,$@,$(SOBJS),$(LINKWITH)) diff --git a/cpp/test/Ice/hold/Makefile.mak b/cpp/test/Ice/hold/Makefile.mak index b81fedd766e..6d11b42186e 100644 --- a/cpp/test/Ice/hold/Makefile.mak +++ b/cpp/test/Ice/hold/Makefile.mak @@ -40,6 +40,7 @@ OBJS = $(COBJS) \ !include $(top_srcdir)/config/Make.rules.mak CPPFLAGS = -I. -I../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN +LINKWITH = testcommon$(LIBSUFFIX).lib $(LIBS) !if "$(GENERATE_PDB)" == "yes" CPDBFLAGS = /pdb:$(CLIENT).pdb @@ -47,12 +48,12 @@ SPDBFLAGS = /pdb:$(SERVER).pdb !endif $(CLIENT)$(EXT): $(COBJS) - $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(SERVER)$(EXT): $(SOBJS) - $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest diff --git a/cpp/test/Ice/hold/Server.cpp b/cpp/test/Ice/hold/Server.cpp index ab30b3a4130..ee0ff170128 100644 --- a/cpp/test/Ice/hold/Server.cpp +++ b/cpp/test/Ice/hold/Server.cpp @@ -20,7 +20,7 @@ run(int, char**, const Ice::CommunicatorPtr& communicator) { IceUtil::TimerPtr timer = new IceUtil::Timer(); - communicator->getProperties()->setProperty("TestAdapter1.Endpoints", "default -p 12010:udp"); + communicator->getProperties()->setProperty("TestAdapter1.Endpoints", getTestEndpoint(communicator, 0) + ":udp"); communicator->getProperties()->setProperty("TestAdapter1.ThreadPool.Size", "5"); communicator->getProperties()->setProperty("TestAdapter1.ThreadPool.SizeMax", "5"); communicator->getProperties()->setProperty("TestAdapter1.ThreadPool.SizeWarn", "0"); @@ -28,7 +28,7 @@ run(int, char**, const Ice::CommunicatorPtr& communicator) Ice::ObjectAdapterPtr adapter1 = communicator->createObjectAdapter("TestAdapter1"); adapter1->add(ICE_MAKE_SHARED(HoldI, timer, adapter1), communicator->stringToIdentity("hold")); - communicator->getProperties()->setProperty("TestAdapter2.Endpoints", "default -p 12011:udp"); + communicator->getProperties()->setProperty("TestAdapter2.Endpoints", getTestEndpoint(communicator, 1) + ":udp"); communicator->getProperties()->setProperty("TestAdapter2.ThreadPool.Size", "5"); communicator->getProperties()->setProperty("TestAdapter2.ThreadPool.SizeMax", "5"); communicator->getProperties()->setProperty("TestAdapter2.ThreadPool.SizeWarn", "0"); diff --git a/cpp/test/Ice/hold/run.py b/cpp/test/Ice/hold/run.py index ce8c5dd4b18..c1eec8b731d 100755 --- a/cpp/test/Ice/hold/run.py +++ b/cpp/test/Ice/hold/run.py @@ -20,4 +20,5 @@ if len(path) == 0: sys.path.append(os.path.join(path[0], "scripts")) import TestUtil -TestUtil.clientServerTest() +TestUtil.queueClientServerTest() +TestUtil.runQueuedTests() diff --git a/cpp/test/Ice/info/run.py b/cpp/test/Ice/info/run.py index ce8c5dd4b18..c1eec8b731d 100755 --- a/cpp/test/Ice/info/run.py +++ b/cpp/test/Ice/info/run.py @@ -20,4 +20,5 @@ if len(path) == 0: sys.path.append(os.path.join(path[0], "scripts")) import TestUtil -TestUtil.clientServerTest() +TestUtil.queueClientServerTest() +TestUtil.runQueuedTests() diff --git a/cpp/test/Ice/inheritance/AllTests.cpp b/cpp/test/Ice/inheritance/AllTests.cpp index dd316ac08c8..105bb12a576 100644 --- a/cpp/test/Ice/inheritance/AllTests.cpp +++ b/cpp/test/Ice/inheritance/AllTests.cpp @@ -18,7 +18,7 @@ InitialPrxPtr allTests(const Ice::CommunicatorPtr& communicator) { cout << "testing stringToProxy... " << flush; - string ref = "initial:default -p 12010"; + string ref = "initial:" + getTestEndpoint(communicator, 0); Ice::ObjectPrxPtr base = communicator->stringToProxy(ref); test(base); cout << "ok" << endl; diff --git a/cpp/test/Ice/inheritance/Client.cpp b/cpp/test/Ice/inheritance/Client.cpp index 523efc94ff9..10a96b1f3f5 100644 --- a/cpp/test/Ice/inheritance/Client.cpp +++ b/cpp/test/Ice/inheritance/Client.cpp @@ -30,16 +30,22 @@ main(int argc, char* argv[]) { #ifdef ICE_STATIC_LIBS Ice::registerIceSSL(); +# if defined(__linux) + Ice::registerIceBT(); +# endif #endif try { Ice::CommunicatorHolder ich = Ice::initialize(argc, argv); - return run(argc, argv, ich.communicator()); + RemoteConfig rc("Ice/inheritance", argc, argv, ich.communicator()); + int status = run(argc, argv, ich.communicator()); + rc.finished(status); + return status; } catch(const Ice::Exception& ex) { cerr << ex << endl; - return EXIT_FAILURE; + return EXIT_FAILURE; } } diff --git a/cpp/test/Ice/inheritance/Collocated.cpp b/cpp/test/Ice/inheritance/Collocated.cpp index 8496f69ecd4..ac543d9b123 100644 --- a/cpp/test/Ice/inheritance/Collocated.cpp +++ b/cpp/test/Ice/inheritance/Collocated.cpp @@ -19,7 +19,7 @@ using namespace Test; int run(int, char**, const Ice::CommunicatorPtr& communicator) { - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0)); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); Ice::ObjectPtr object = ICE_MAKE_SHARED(InitialI, adapter); adapter->add(object, communicator->stringToIdentity("initial")); diff --git a/cpp/test/Ice/inheritance/Makefile b/cpp/test/Ice/inheritance/Makefile index 084ef7d8f02..4890a63bced 100644 --- a/cpp/test/Ice/inheritance/Makefile +++ b/cpp/test/Ice/inheritance/Makefile @@ -38,14 +38,16 @@ include $(top_srcdir)/config/Make.rules CPPFLAGS := -I. -I../../include $(CPPFLAGS) +LINKWITH := -lTestCommon $(LIBS) + $(CLIENT): $(COBJS) rm -f $@ - $(call mktest,$@,$(COBJS),$(LIBS)) + $(call mktest,$@,$(COBJS),$(LINKWITH)) $(SERVER): $(SOBJS) rm -f $@ - $(call mktest,$@,$(SOBJS),$(LIBS)) + $(call mktest,$@,$(SOBJS),$(LINKWITH)) $(COLLOCATED): $(COLOBJS) rm -f $@ - $(call mktest,$@,$(COLOBJS),$(LIBS)) + $(call mktest,$@,$(COLOBJS),$(LINKWITH)) diff --git a/cpp/test/Ice/inheritance/Makefile.mak b/cpp/test/Ice/inheritance/Makefile.mak index 41ea2c5ae6f..b2084cf0520 100644 --- a/cpp/test/Ice/inheritance/Makefile.mak +++ b/cpp/test/Ice/inheritance/Makefile.mak @@ -47,6 +47,7 @@ OBJS = $(COBJS) \ !include $(top_srcdir)/config/Make.rules.mak CPPFLAGS = -I. -I../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN +LINKWITH = testcommon$(LIBSUFFIX).lib $(LIBS) !if "$(GENERATE_PDB)" == "yes" CPDBFLAGS = /pdb:$(CLIENT).pdb @@ -55,17 +56,17 @@ COPDBFLAGS = /pdb:$(COLLOCATED).pdb !endif $(CLIENT)$(EXT): $(COBJS) - $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(SERVER)$(EXT): $(SOBJS) - $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(COLLOCATED)$(EXT): $(COLOBJS) - $(LINK) $(LD_TESTFLAGS) $(COPDBFLAGS) $(COLOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(COPDBFLAGS) $(COLOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest diff --git a/cpp/test/Ice/inheritance/Server.cpp b/cpp/test/Ice/inheritance/Server.cpp index a187231ecd2..8d8ad66e2db 100644 --- a/cpp/test/Ice/inheritance/Server.cpp +++ b/cpp/test/Ice/inheritance/Server.cpp @@ -18,7 +18,7 @@ using namespace std; int run(int, char**, const Ice::CommunicatorPtr& communicator) { - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0)); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); Ice::ObjectPtr object = ICE_MAKE_SHARED(InitialI, adapter); adapter->add(object, communicator->stringToIdentity("initial")); diff --git a/cpp/test/Ice/inheritance/run.py b/cpp/test/Ice/inheritance/run.py index c9767485188..eb52f00447a 100755 --- a/cpp/test/Ice/inheritance/run.py +++ b/cpp/test/Ice/inheritance/run.py @@ -20,5 +20,6 @@ if len(path) == 0: sys.path.append(os.path.join(path[0], "scripts")) import TestUtil -TestUtil.clientServerTest() -TestUtil.collocatedTest() +TestUtil.queueClientServerTest() +TestUtil.queueCollocatedTest() +TestUtil.runQueuedTests() diff --git a/cpp/test/Ice/invoke/AllTests.cpp b/cpp/test/Ice/invoke/AllTests.cpp index fc7cf33cf60..d17f2417e93 100644 --- a/cpp/test/Ice/invoke/AllTests.cpp +++ b/cpp/test/Ice/invoke/AllTests.cpp @@ -285,7 +285,7 @@ typedef IceUtil::Handle<Callback> CallbackPtr; Test::MyClassPrx allTests(const Ice::CommunicatorPtr& communicator) { - string ref = "test:default -p 12010"; + string ref = "test:" + getTestEndpoint(communicator, 0); Ice::ObjectPrx base = communicator->stringToProxy(ref); test(base); diff --git a/cpp/test/Ice/invoke/Makefile b/cpp/test/Ice/invoke/Makefile index 3d60adca492..50f6ec85b7c 100644 --- a/cpp/test/Ice/invoke/Makefile +++ b/cpp/test/Ice/invoke/Makefile @@ -28,10 +28,12 @@ include $(top_srcdir)/config/Make.rules CPPFLAGS := -I. -I../../include $(CPPFLAGS) +LINKWITH := -lTestCommon $(LIBS) + $(CLIENT): $(COBJS) rm -f $@ - $(call mktest,$@,$(COBJS),$(LIBS)) + $(call mktest,$@,$(COBJS),$(LINKWITH)) $(SERVER): $(SOBJS) rm -f $@ - $(call mktest,$@,$(SOBJS),$(LIBS)) + $(call mktest,$@,$(SOBJS),$(LINKWITH)) diff --git a/cpp/test/Ice/invoke/Makefile.mak b/cpp/test/Ice/invoke/Makefile.mak index 5bf3b7259cf..4ba9f44b341 100644 --- a/cpp/test/Ice/invoke/Makefile.mak +++ b/cpp/test/Ice/invoke/Makefile.mak @@ -40,6 +40,7 @@ OBJS = $(COBJS) \ !include $(top_srcdir)/config/Make.rules.mak CPPFLAGS = -I. -I../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN +LINKWITH = testcommon$(LIBSUFFIX).lib $(LIBS) !if "$(GENERATE_PDB)" == "yes" CPDBFLAGS = /pdb:$(CLIENT).pdb @@ -47,12 +48,12 @@ SPDBFLAGS = /pdb:$(SERVER).pdb !endif $(CLIENT)$(EXT): $(COBJS) - $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(SERVER)$(EXT): $(SOBJS) - $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest diff --git a/cpp/test/Ice/invoke/Server.cpp b/cpp/test/Ice/invoke/Server.cpp index 9b2a4573df8..3b318ed9919 100644 --- a/cpp/test/Ice/invoke/Server.cpp +++ b/cpp/test/Ice/invoke/Server.cpp @@ -88,7 +88,7 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) bool array = opts.isSet("array"); bool async = opts.isSet("async"); - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010:udp"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0) + ":udp"); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); adapter->addServantLocator(new ServantLocatorI(array, async), ""); adapter->activate(); diff --git a/cpp/test/Ice/invoke/run.py b/cpp/test/Ice/invoke/run.py index 0b5d905d8d5..21a22307d02 100755 --- a/cpp/test/Ice/invoke/run.py +++ b/cpp/test/Ice/invoke/run.py @@ -20,11 +20,12 @@ if len(path) == 0: sys.path.append(os.path.join(path[0], "scripts")) import TestUtil -print("tests with Blobject server.") -TestUtil.clientServerTest() -print("tests with BlobjectArray server.") -TestUtil.clientServerTest(additionalServerOptions = "--array") -print("tests with BlobjectAsync server.") -TestUtil.clientServerTest(additionalServerOptions = "--async") -print("tests with BlobjectAsyncArray server.") -TestUtil.clientServerTest(additionalServerOptions = "--array --async") +TestUtil.queueClientServerTest(configName = "blobject", message = "Running test with Blobject server.") +TestUtil.queueClientServerTest(configName = "blobjectArray", message = "Running test with BlobjectArray server.", + additionalServerOptions = "--array") +TestUtil.queueClientServerTest(configName = "blobjectAsync", message = "Running test with BlobjectAsync server.", + additionalServerOptions = "--async") +TestUtil.queueClientServerTest(configName = "blobjectAsyncArray", + message = "Running test with BlobjectAsyncArray server.", + additionalServerOptions = "--array --async") +TestUtil.runQueuedTests() diff --git a/cpp/test/Ice/location/Client.cpp b/cpp/test/Ice/location/Client.cpp index 4a440505bd2..6d2126d1f66 100644 --- a/cpp/test/Ice/location/Client.cpp +++ b/cpp/test/Ice/location/Client.cpp @@ -19,7 +19,7 @@ int run(int, char**, const Ice::CommunicatorPtr& communicator) { void allTests(const Ice::CommunicatorPtr&, const string&); - allTests(communicator, "ServerManager:default -p 12010"); + allTests(communicator, "ServerManager:" + getTestEndpoint(communicator, 0)); return EXIT_SUCCESS; } diff --git a/cpp/test/Ice/location/Makefile b/cpp/test/Ice/location/Makefile index 917a7c0cf4c..d59c9ab5992 100644 --- a/cpp/test/Ice/location/Makefile +++ b/cpp/test/Ice/location/Makefile @@ -32,10 +32,12 @@ include $(top_srcdir)/config/Make.rules CPPFLAGS := -I. -I../../include $(CPPFLAGS) +LINKWITH := -lTestCommon $(LIBS) + $(CLIENT): $(COBJS) rm -f $@ - $(call mktest,$@,$(COBJS),$(LIBS)) + $(call mktest,$@,$(COBJS),$(LINKWITH)) $(SERVER): $(SOBJS) rm -f $@ - $(call mktest,$@,$(SOBJS),$(LIBS)) + $(call mktest,$@,$(SOBJS),$(LINKWITH)) diff --git a/cpp/test/Ice/location/Makefile.mak b/cpp/test/Ice/location/Makefile.mak index 603afa95de0..0964b4b8f81 100644 --- a/cpp/test/Ice/location/Makefile.mak +++ b/cpp/test/Ice/location/Makefile.mak @@ -41,6 +41,7 @@ OBJS = $(COBJS) \ !include $(top_srcdir)/config/Make.rules.mak CPPFLAGS = -I. -I../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN +LINKWITH = testcommon$(LIBSUFFIX).lib $(LIBS) !if "$(GENERATE_PDB)" == "yes" CPDBFLAGS = /pdb:$(CLIENT).pdb @@ -48,12 +49,12 @@ SPDBFLAGS = /pdb:$(SERVER).pdb !endif $(CLIENT)$(EXT): $(COBJS) - $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(SERVER)$(EXT): $(SOBJS) - $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest diff --git a/cpp/test/Ice/location/Server.cpp b/cpp/test/Ice/location/Server.cpp index 95c4cde49d3..7a9896ba440 100644 --- a/cpp/test/Ice/location/Server.cpp +++ b/cpp/test/Ice/location/Server.cpp @@ -27,7 +27,7 @@ run(int, char**, const Ice::CommunicatorPtr& communicator, // Ice::PropertiesPtr properties = communicator->getProperties(); properties->setProperty("Ice.ThreadPool.Server.Size", "2"); - properties->setProperty("ServerManager.Endpoints", "default -p 12010:udp"); + properties->setProperty("ServerManager.Endpoints", getTestEndpoint(communicator, 0) + ":udp"); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("ServerManager"); diff --git a/cpp/test/Ice/location/run.py b/cpp/test/Ice/location/run.py index ce8c5dd4b18..c1eec8b731d 100755 --- a/cpp/test/Ice/location/run.py +++ b/cpp/test/Ice/location/run.py @@ -20,4 +20,5 @@ if len(path) == 0: sys.path.append(os.path.join(path[0], "scripts")) import TestUtil -TestUtil.clientServerTest() +TestUtil.queueClientServerTest() +TestUtil.runQueuedTests() diff --git a/cpp/test/Ice/metrics/run.py b/cpp/test/Ice/metrics/run.py index 6d8f4682523..ab0953a3b3a 100755 --- a/cpp/test/Ice/metrics/run.py +++ b/cpp/test/Ice/metrics/run.py @@ -20,9 +20,8 @@ if len(path) == 0: sys.path.append(os.path.join(path[0], "scripts")) import TestUtil -print("tests with regular server.") -TestUtil.clientServerTest() -print("tests with AMD server.") -TestUtil.clientServerTest(server = "serveramd") -print("tests with collocated server.") -TestUtil.collocatedTest() +TestUtil.queueClientServerTest() +TestUtil.queueClientServerTest(configName = "amd", localOnly = True, message = "Running test with AMD server.", + server = "serveramd") +TestUtil.queueCollocatedTest() +TestUtil.runQueuedTests() diff --git a/cpp/test/Ice/objects/AllTests.cpp b/cpp/test/Ice/objects/AllTests.cpp index 6ebfa5d1a0b..7545e2a87b3 100644 --- a/cpp/test/Ice/objects/AllTests.cpp +++ b/cpp/test/Ice/objects/AllTests.cpp @@ -35,7 +35,7 @@ public: void testUOE(const Ice::CommunicatorPtr& communicator) { - string ref = "uoet:default -p 12010"; + string ref = "uoet:" + getTestEndpoint(communicator, 0); Ice::ObjectPrxPtr base = communicator->stringToProxy(ref); test(base); UnexpectedObjectExceptionTestPrxPtr uoet = ICE_UNCHECKED_CAST(UnexpectedObjectExceptionTestPrx, base); @@ -65,7 +65,7 @@ InitialPrxPtr allTests(const Ice::CommunicatorPtr& communicator) { cout << "testing stringToProxy... " << flush; - string ref = "initial:default -p 12010"; + string ref = "initial:" + getTestEndpoint(communicator, 0); Ice::ObjectPrxPtr base = communicator->stringToProxy(ref); test(base); cout << "ok" << endl; diff --git a/cpp/test/Ice/objects/Client.cpp b/cpp/test/Ice/objects/Client.cpp index a0e27474c25..21bc3e9d4a7 100644 --- a/cpp/test/Ice/objects/Client.cpp +++ b/cpp/test/Ice/objects/Client.cpp @@ -144,16 +144,22 @@ main(int argc, char* argv[]) { #ifdef ICE_STATIC_LIBS Ice::registerIceSSL(); +# if defined(__linux) + Ice::registerIceBT(); +# endif #endif try { Ice::CommunicatorHolder ich = Ice::initialize(argc, argv); - return run(argc, argv, ich.communicator()); + RemoteConfig rc("Ice/objects", argc, argv, ich.communicator()); + int status = run(argc, argv, ich.communicator()); + rc.finished(status); + return status; } catch(const Ice::Exception& ex) { cerr << ex << endl; - return EXIT_FAILURE; + return EXIT_FAILURE; } } diff --git a/cpp/test/Ice/objects/Collocated.cpp b/cpp/test/Ice/objects/Collocated.cpp index 01c19b84396..d69ab681967 100644 --- a/cpp/test/Ice/objects/Collocated.cpp +++ b/cpp/test/Ice/objects/Collocated.cpp @@ -132,7 +132,7 @@ run(int, char**, const Ice::CommunicatorPtr& communicator) communicator->addObjectFactory(new MyObjectFactory(), "TestOF"); #endif - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0)); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); adapter->add(ICE_MAKE_SHARED(InitialI, adapter), communicator->stringToIdentity("initial")); #ifndef ICE_CPP11_MAPPING diff --git a/cpp/test/Ice/objects/Makefile b/cpp/test/Ice/objects/Makefile index 0031a2e7ccd..29b87ebe56f 100644 --- a/cpp/test/Ice/objects/Makefile +++ b/cpp/test/Ice/objects/Makefile @@ -39,14 +39,16 @@ include $(top_srcdir)/config/Make.rules CPPFLAGS := -I. -I../../include $(CPPFLAGS) +LINKWITH := -lTestCommon $(LIBS) + $(CLIENT): $(COBJS) rm -f $@ - $(call mktest,$@,$(COBJS) $(LIBS)) + $(call mktest,$@,$(COBJS) $(LINKWITH)) $(SERVER): $(SOBJS) rm -f $@ - $(call mktest,$@,$(SOBJS) $(LIBS)) + $(call mktest,$@,$(SOBJS) $(LINKWITH)) $(COLLOCATED): $(COLOBJS) rm -f $@ - $(call mktest,$@,$(COLOBJS) $(LIBS)) + $(call mktest,$@,$(COLOBJS) $(LINKWITH)) diff --git a/cpp/test/Ice/objects/Makefile.mak b/cpp/test/Ice/objects/Makefile.mak index ac5d261ddb5..31d808c0ba5 100644 --- a/cpp/test/Ice/objects/Makefile.mak +++ b/cpp/test/Ice/objects/Makefile.mak @@ -48,6 +48,7 @@ OBJS = $(COBJS) \ !include $(top_srcdir)/config/Make.rules.mak CPPFLAGS = -I. -I../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN +LINKWITH = testcommon$(LIBSUFFIX).lib $(LIBS) !if "$(GENERATE_PDB)" == "yes" CPDBFLAGS = /pdb:$(CLIENT).pdb @@ -56,17 +57,17 @@ COPDBFLAGS = /pdb:$(COLLOCATED).pdb !endif $(CLIENT)$(EXT): $(COBJS) - $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(SERVER)$(EXT): $(SOBJS) - $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(COLLOCATED)$(EXT): $(COLOBJS) - $(LINK) $(LD_TESTFLAGS) $(COPDBFLAGS) $(COLOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(COPDBFLAGS) $(COLOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest diff --git a/cpp/test/Ice/objects/Server.cpp b/cpp/test/Ice/objects/Server.cpp index 39bfa39e1ed..ead9c04686d 100644 --- a/cpp/test/Ice/objects/Server.cpp +++ b/cpp/test/Ice/objects/Server.cpp @@ -66,7 +66,7 @@ run(int, char**, const Ice::CommunicatorPtr& communicator) communicator->addValueFactory(factory, "::Test::H"); #endif - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0)); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); adapter->add(ICE_MAKE_SHARED(InitialI, adapter), communicator->stringToIdentity("initial")); diff --git a/cpp/test/Ice/objects/run.py b/cpp/test/Ice/objects/run.py index 6014ec1878d..bb0c4f5e11e 100755 --- a/cpp/test/Ice/objects/run.py +++ b/cpp/test/Ice/objects/run.py @@ -20,16 +20,15 @@ if len(path) == 0: sys.path.append(os.path.join(path[0], "scripts")) import TestUtil -print("Running test with compact (default) format.") -TestUtil.clientServerTest() +TestUtil.queueClientServerTest(configName = "compact", message = "Running test with compact (default) format.") -print("Running test with sliced format.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.SlicedFormat", - additionalServerOptions="--Ice.Default.SlicedFormat") +TestUtil.queueClientServerTest(configName = "sliced", message = "Running test with sliced format.", + additionalClientOptions="--Ice.Default.SlicedFormat", + additionalServerOptions="--Ice.Default.SlicedFormat") -print("Running test with 1.0 encoding.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", - additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.queueClientServerTest(configName = "1.0", message = "Running test with 1.0 encoding.", + additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") -print("Running collocated test.") -TestUtil.collocatedTest() +TestUtil.queueCollocatedTest() +TestUtil.runQueuedTests() diff --git a/cpp/test/Ice/operations/AllTests.cpp b/cpp/test/Ice/operations/AllTests.cpp index 45e9f666ba3..fa8c84ef772 100644 --- a/cpp/test/Ice/operations/AllTests.cpp +++ b/cpp/test/Ice/operations/AllTests.cpp @@ -17,7 +17,7 @@ using namespace std; Test::MyClassPrxPtr allTests(const Ice::CommunicatorPtr& communicator) { - string ref = "test:default -p 12010"; + string ref = "test:" + getTestEndpoint(communicator, 0); Ice::ObjectPrxPtr base = communicator->stringToProxy(ref); Test::MyClassPrxPtr cl = ICE_CHECKED_CAST(Test::MyClassPrx, base); Test::MyDerivedClassPrxPtr derived = ICE_CHECKED_CAST(Test::MyDerivedClassPrx, cl); diff --git a/cpp/test/Ice/operations/BatchOneways.cpp b/cpp/test/Ice/operations/BatchOneways.cpp index 2776f8cf445..6e9ff288ff8 100644 --- a/cpp/test/Ice/operations/BatchOneways.cpp +++ b/cpp/test/Ice/operations/BatchOneways.cpp @@ -108,7 +108,8 @@ batchOneways(const Test::MyClassPrxPtr& p) IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(10)); } - if(batch->ice_getConnection()) + if(batch->ice_getConnection() && + p->ice_getCommunicator()->getProperties()->getProperty("Ice.Default.Protocol") != "bt") { Test::MyClassPrxPtr batch1 = ICE_UNCHECKED_CAST(Test::MyClassPrx, p->ice_batchOneway()); Test::MyClassPrxPtr batch2 = ICE_UNCHECKED_CAST(Test::MyClassPrx, p->ice_batchOneway()); @@ -141,7 +142,8 @@ batchOneways(const Test::MyClassPrxPtr& p) batch->ice_flushBatchRequests(); batch->ice_ping(); - if(batch->ice_getConnection()) + if(batch->ice_getConnection() && + p->ice_getCommunicator()->getProperties()->getProperty("Ice.Default.Protocol") != "bt") { Ice::InitializationData initData; initData.properties = p->ice_getCommunicator()->getProperties()->clone(); diff --git a/cpp/test/Ice/operations/BatchOnewaysAMI.cpp b/cpp/test/Ice/operations/BatchOnewaysAMI.cpp index ed7ad110e23..d3ea9815258 100644 --- a/cpp/test/Ice/operations/BatchOnewaysAMI.cpp +++ b/cpp/test/Ice/operations/BatchOnewaysAMI.cpp @@ -93,7 +93,7 @@ public: void batchOnewaysAMI(const Test::MyClassPrxPtr& p) { - const Test::ByteS bs1(10 * 1024); + const Test::ByteS bs1(10 * 1024); Test::MyClassPrxPtr batch = ICE_UNCHECKED_CAST(Test::MyClassPrx, p->ice_batchOneway()); #ifdef ICE_CPP11_MAPPING @@ -106,7 +106,7 @@ batchOnewaysAMI(const Test::MyClassPrxPtr& p) }); // Empty flush prom.get_future().get(); - for(int i = 0 ; i < 30 ; ++i) + for(int i = 0; i < 30; ++i) { batch->opByteSOneway_async(bs1, nullptr, [](exception_ptr){ test(false); }); } @@ -118,7 +118,8 @@ batchOnewaysAMI(const Test::MyClassPrxPtr& p) IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(10)); } - if(batch->ice_getConnection()) + if(batch->ice_getConnection() && + p->ice_getCommunicator()->getProperties()->getProperty("Ice.Default.Protocol") != "bt") { shared_ptr<Test::MyClassPrx> batch1 = Ice::uncheckedCast<Test::MyClassPrx>(p->ice_batchOneway()); shared_ptr<Test::MyClassPrx> batch2 = Ice::uncheckedCast<Test::MyClassPrx>(p->ice_batchOneway()); @@ -158,7 +159,7 @@ batchOnewaysAMI(const Test::MyClassPrxPtr& p) test(batch->begin_ice_flushBatchRequests()->isCompleted()); // Empty flush test(batch->begin_ice_flushBatchRequests()->sentSynchronously()); // Empty flush - for(int i = 0 ; i < 30 ; ++i) + for(int i = 0; i < 30; ++i) { batch->begin_opByteSOneway(bs1, Test::newCallback_MyClass_opByteSOneway(new Callback_ByteSOneway(), &Callback_ByteSOneway::response, @@ -172,7 +173,8 @@ batchOnewaysAMI(const Test::MyClassPrxPtr& p) IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(10)); } - if(batch->ice_getConnection()) + if(batch->ice_getConnection() && + p->ice_getCommunicator()->getProperties()->getProperty("Ice.Default.Protocol") != "bt") { Test::MyClassPrx batch1 = Test::MyClassPrx::uncheckedCast(p->ice_batchOneway()); Test::MyClassPrx batch2 = Test::MyClassPrx::uncheckedCast(p->ice_batchOneway()); diff --git a/cpp/test/Ice/operations/Client.cpp b/cpp/test/Ice/operations/Client.cpp index 1ab648ca9cd..b448e20094d 100644 --- a/cpp/test/Ice/operations/Client.cpp +++ b/cpp/test/Ice/operations/Client.cpp @@ -16,30 +16,34 @@ DEFINE_TEST("client") using namespace std; int -run(int, char**, const Ice::CommunicatorPtr& communicator) +run(int, char**, const Ice::CommunicatorPtr& communicator, bool remote) { Test::MyClassPrxPtr allTests(const Ice::CommunicatorPtr&); Test::MyClassPrxPtr myClass = allTests(communicator); #ifndef ICE_OS_WINRT - cout << "testing server shutdown... " << flush; myClass->shutdown(); - try - { - myClass->opVoid(); - test(false); - } - catch(const Ice::LocalException&) + if(!remote) { - cout << "ok" << endl; + cout << "testing server shutdown... " << flush; + try + { + myClass->opVoid(); + test(false); + } + catch(const Ice::LocalException&) + { + cout << "ok" << endl; + } } #else // // When using SSL the run.py script starts a new server after shutdown - // and the call to opVoid will success. + // and the call to opVoid will succeed. // myClass->shutdown(); #endif + return EXIT_SUCCESS; } @@ -48,6 +52,9 @@ main(int argc, char* argv[]) { #ifdef ICE_STATIC_LIBS Ice::registerIceSSL(); +# if defined(__linux) + Ice::registerIceBT(); +# endif #endif try @@ -64,11 +71,14 @@ main(int argc, char* argv[]) initData.properties->setProperty("Ice.BatchAutoFlushSize", "100"); Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData); - return run(argc, argv, ich.communicator()); + RemoteConfig rc("Ice/operations", argc, argv, ich.communicator()); + int status = run(argc, argv, ich.communicator(), rc.isRemote()); + rc.finished(status); + return status; } catch(const Ice::Exception& ex) { cerr << ex << endl; - return EXIT_FAILURE; + return EXIT_FAILURE; } } diff --git a/cpp/test/Ice/operations/Collocated.cpp b/cpp/test/Ice/operations/Collocated.cpp index 0564f696cb5..dc061fcc2fe 100644 --- a/cpp/test/Ice/operations/Collocated.cpp +++ b/cpp/test/Ice/operations/Collocated.cpp @@ -18,7 +18,7 @@ using namespace std; int run(int, char**, const Ice::CommunicatorPtr& communicator) { - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0)); communicator->getProperties()->setProperty("TestAdapter.AdapterId", "test"); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); Ice::ObjectPrxPtr prx = adapter->add(ICE_MAKE_SHARED(MyDerivedClassI), communicator->stringToIdentity("test")); diff --git a/cpp/test/Ice/operations/Makefile b/cpp/test/Ice/operations/Makefile index 819e9b236af..32029e29461 100644 --- a/cpp/test/Ice/operations/Makefile +++ b/cpp/test/Ice/operations/Makefile @@ -56,18 +56,20 @@ include $(top_srcdir)/config/Make.rules CPPFLAGS := -I. -I../../include $(CPPFLAGS) +LINKWITH := -lTestCommon $(LIBS) + $(CLIENT): $(COBJS) rm -f $@ - $(call mktest,$@,$(COBJS),$(LIBS)) + $(call mktest,$@,$(COBJS),$(LINKWITH)) $(SERVER): $(SOBJS) rm -f $@ - $(call mktest,$@,$(SOBJS),$(LIBS)) + $(call mktest,$@,$(SOBJS),$(LINKWITH)) $(SERVERAMD): $(SAMDOBJS) rm -f $@ - $(call mktest,$@,$(SAMDOBJS),$(LIBS)) + $(call mktest,$@,$(SAMDOBJS),$(LINKWITH)) $(COLLOCATED): $(COLOBJS) rm -f $@ - $(call mktest,$@,$(COLOBJS),$(LIBS)) + $(call mktest,$@,$(COLOBJS),$(LINKWITH)) diff --git a/cpp/test/Ice/operations/Makefile.mak b/cpp/test/Ice/operations/Makefile.mak index dd451321bf9..285840a9c2c 100644 --- a/cpp/test/Ice/operations/Makefile.mak +++ b/cpp/test/Ice/operations/Makefile.mak @@ -65,6 +65,7 @@ OBJS = $(COBJS) \ !include $(top_srcdir)/config/Make.rules.mak CPPFLAGS = -I. -I../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN -Zm200 -bigobj /wd4503 +LINKWITH = testcommon$(LIBSUFFIX).lib $(LIBS) !if "$(GENERATE_PDB)" == "yes" CPDBFLAGS = /pdb:$(CLIENT).pdb @@ -74,22 +75,22 @@ COPDBFLAGS = /pdb:$(COLLOCATED).pdb !endif $(CLIENT)$(EXT): $(COBJS) - $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(SERVER)$(EXT): $(SOBJS) - $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(SERVERAMD)$(EXT): $(SAMDOBJS) - $(LINK) $(LD_TESTFLAGS) $(SAPDBFLAGS) $(SAMDOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(SAPDBFLAGS) $(SAMDOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(COLLOCATED)$(EXT): $(COLOBJS) - $(LINK) $(LD_TESTFLAGS) $(COPDBFLAGS) $(COLOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(COPDBFLAGS) $(COLOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest diff --git a/cpp/test/Ice/operations/Server.cpp b/cpp/test/Ice/operations/Server.cpp index 862663895f6..7c52538ef41 100644 --- a/cpp/test/Ice/operations/Server.cpp +++ b/cpp/test/Ice/operations/Server.cpp @@ -18,7 +18,8 @@ using namespace std; int run(int, char**, const Ice::CommunicatorPtr& communicator) { - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010:udp"); + string endpt = getTestEndpoint(communicator, 0); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", endpt + ":udp"); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); adapter->add(ICE_MAKE_SHARED(MyDerivedClassI), communicator->stringToIdentity("test")); adapter->activate(); diff --git a/cpp/test/Ice/operations/ServerAMD.cpp b/cpp/test/Ice/operations/ServerAMD.cpp index 2fae05b708d..32384261554 100644 --- a/cpp/test/Ice/operations/ServerAMD.cpp +++ b/cpp/test/Ice/operations/ServerAMD.cpp @@ -18,7 +18,8 @@ using namespace std; int run(int, char**, const Ice::CommunicatorPtr& communicator) { - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010:udp"); + string endpt = getTestEndpoint(communicator, 0); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", endpt + ":udp"); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); adapter->add(ICE_MAKE_SHARED(MyDerivedClassI), communicator->stringToIdentity("test")); adapter->activate(); diff --git a/cpp/test/Ice/operations/Twoways.cpp b/cpp/test/Ice/operations/Twoways.cpp index 50711ad105e..dce362937ca 100644 --- a/cpp/test/Ice/operations/Twoways.cpp +++ b/cpp/test/Ice/operations/Twoways.cpp @@ -1575,7 +1575,7 @@ twoways(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& p) } #ifndef ICE_OS_WINRT - if(p->ice_getConnection()) + if(p->ice_getConnection() && communicator->getProperties()->getProperty("Ice.Default.Protocol") != "bt") { // // Test implicit context propagation @@ -1596,7 +1596,7 @@ twoways(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& p) ctx["three"] = "THREE"; Test::MyClassPrxPtr p = ICE_UNCHECKED_CAST(Test::MyClassPrx, - ic->stringToProxy("test:default -p 12010 -t 10000")); + ic->stringToProxy("test:" + getTestEndpoint(ic, 0))); ic->getImplicitContext()->setContext(ctx); test(ic->getImplicitContext()->getContext() == ctx); diff --git a/cpp/test/Ice/operations/TwowaysAMI.cpp b/cpp/test/Ice/operations/TwowaysAMI.cpp index f6606431f9a..95c72642fcf 100644 --- a/cpp/test/Ice/operations/TwowaysAMI.cpp +++ b/cpp/test/Ice/operations/TwowaysAMI.cpp @@ -2456,7 +2456,7 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& } #ifndef ICE_OS_WINRT - if(p->ice_getConnection()) + if(p->ice_getConnection() && communicator->getProperties()->getProperty("Ice.Default.Protocol") != "bt") { // // Test implicit context propagation @@ -2476,8 +2476,8 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& ctx["two"] = "TWO"; ctx["three"] = "THREE"; - - Test::MyClassPrxPtr p = ICE_UNCHECKED_CAST(Test::MyClassPrx, ic->stringToProxy("test:default -p 12010")); + Test::MyClassPrxPtr p = + ICE_UNCHECKED_CAST(Test::MyClassPrx, ic->stringToProxy("test:" + getTestEndpoint(ic, 0))); ic->getImplicitContext()->setContext(ctx); test(ic->getImplicitContext()->getContext() == ctx); { diff --git a/cpp/test/Ice/operations/run.py b/cpp/test/Ice/operations/run.py index 996d09d4d36..d69e9be2733 100755 --- a/cpp/test/Ice/operations/run.py +++ b/cpp/test/Ice/operations/run.py @@ -20,9 +20,9 @@ if len(path) == 0: sys.path.append(os.path.join(path[0], "scripts")) import TestUtil -print("tests with regular server.") -TestUtil.clientServerTest(additionalClientOptions = "--Ice.Warn.AMICallback=0") -print("tests with AMD server.") -TestUtil.clientServerTest(additionalClientOptions = "--Ice.Warn.AMICallback=0", server = "serveramd") -print("tests with collocated server.") -TestUtil.collocatedTest() +TestUtil.queueClientServerTest(additionalClientOptions = "--Ice.Warn.AMICallback=0") +TestUtil.queueClientServerTest(configName = "amd", localOnly = True, message = "Running test with AMD server.", + additionalClientOptions = "--Ice.Warn.AMICallback=0", + server = "serveramd") +TestUtil.queueCollocatedTest() +TestUtil.runQueuedTests() diff --git a/cpp/test/Ice/optional/AllTests.cpp b/cpp/test/Ice/optional/AllTests.cpp index 9a4b3bae2aa..4523f3e62ac 100644 --- a/cpp/test/Ice/optional/AllTests.cpp +++ b/cpp/test/Ice/optional/AllTests.cpp @@ -238,7 +238,7 @@ allTests(const Ice::CommunicatorPtr& communicator, bool) communicator->addValueFactory(factory, ""); cout << "testing stringToProxy... " << flush; - string ref = "initial:default -p 12010"; + string ref = "initial:" + getTestEndpoint(communicator, 0); Ice::ObjectPrx base = communicator->stringToProxy(ref); test(base); cout << "ok" << endl; diff --git a/cpp/test/Ice/optional/Client.cpp b/cpp/test/Ice/optional/Client.cpp index 6db3cf0cce2..9f3088c78ad 100644 --- a/cpp/test/Ice/optional/Client.cpp +++ b/cpp/test/Ice/optional/Client.cpp @@ -30,34 +30,22 @@ main(int argc, char* argv[]) { #ifdef ICE_STATIC_LIBS Ice::registerIceSSL(); +# if defined(__linux) + Ice::registerIceBT(); +# endif #endif - int status; - Ice::CommunicatorPtr communicator; - try { - communicator = Ice::initialize(argc, argv); - status = run(argc, argv, communicator); + Ice::CommunicatorHolder ich = Ice::initialize(argc, argv); + RemoteConfig rc("Ice/optional", argc, argv, ich.communicator()); + int status = run(argc, argv, ich.communicator()); + rc.finished(status); + return status; } catch(const Ice::Exception& ex) { cerr << ex << endl; - status = EXIT_FAILURE; + return EXIT_FAILURE; } - - if(communicator) - { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } - } - - return status; } diff --git a/cpp/test/Ice/optional/Makefile b/cpp/test/Ice/optional/Makefile index 2facb4f0064..b56991dd6a8 100644 --- a/cpp/test/Ice/optional/Makefile +++ b/cpp/test/Ice/optional/Makefile @@ -39,14 +39,16 @@ include $(top_srcdir)/config/Make.rules CPPFLAGS := -I. -I../../include $(CPPFLAGS) +LINKWITH := -lTestCommon $(LIBS) + $(CLIENT): $(COBJS) rm -f $@ - $(call mktest,$@,$(COBJS) $(LIBS)) + $(call mktest,$@,$(COBJS) $(LINKWITH)) $(SERVER): $(SOBJS) rm -f $@ - $(call mktest,$@,$(SOBJS) $(LIBS)) + $(call mktest,$@,$(SOBJS) $(LINKWITH)) $(SERVERAMD): $(SAMDOBJS) rm -f $@ - $(call mktest,$@,$(SAMDOBJS) $(LIBS)) + $(call mktest,$@,$(SAMDOBJS) $(LINKWITH)) diff --git a/cpp/test/Ice/optional/Makefile.mak b/cpp/test/Ice/optional/Makefile.mak index 52326987214..ce169f5e2d3 100644 --- a/cpp/test/Ice/optional/Makefile.mak +++ b/cpp/test/Ice/optional/Makefile.mak @@ -47,6 +47,7 @@ OBJS = $(COBJS) \ !include $(top_srcdir)/config/Make.rules.mak CPPFLAGS = -I. -I../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN +LINKWITH = testcommon$(LIBSUFFIX).lib $(LIBS) !if "$(GENERATE_PDB)" == "yes" CPDBFLAGS = /pdb:$(CLIENT).pdb @@ -55,17 +56,17 @@ SAPDBFLAGS = /pdb:$(SERVERAMD).pdb !endif $(CLIENT)$(EXT): $(COBJS) - $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(SERVER)$(EXT): $(SOBJS) - $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(SERVERAMD)$(EXT): $(SAMDOBJS) - $(LINK) $(LD_TESTFLAGS) $(SAPDBFLAGS) $(SAMDOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(SAPDBFLAGS) $(SAMDOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest diff --git a/cpp/test/Ice/optional/Server.cpp b/cpp/test/Ice/optional/Server.cpp index 48d5017f48b..8460539df79 100644 --- a/cpp/test/Ice/optional/Server.cpp +++ b/cpp/test/Ice/optional/Server.cpp @@ -19,7 +19,7 @@ using namespace Test; int run(int, char**, const Ice::CommunicatorPtr& communicator) { - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0)); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); adapter->add(new InitialI(), communicator->stringToIdentity("initial")); adapter->activate(); diff --git a/cpp/test/Ice/optional/ServerAMD.cpp b/cpp/test/Ice/optional/ServerAMD.cpp index a541b269137..debdcd6d684 100644 --- a/cpp/test/Ice/optional/ServerAMD.cpp +++ b/cpp/test/Ice/optional/ServerAMD.cpp @@ -18,7 +18,7 @@ using namespace std; int run(int, char**, const Ice::CommunicatorPtr& communicator) { - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0)); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); adapter->add(new InitialI(), communicator->stringToIdentity("initial")); adapter->activate(); diff --git a/cpp/test/Ice/optional/run.py b/cpp/test/Ice/optional/run.py index 54cbcb67bee..a9baaa0b508 100755 --- a/cpp/test/Ice/optional/run.py +++ b/cpp/test/Ice/optional/run.py @@ -20,9 +20,10 @@ if len(path) == 0: sys.path.append(os.path.join(path[0], "scripts")) import TestUtil -print("Running test with compact (default) format.") -TestUtil.clientServerTest() -print("Running test with sliced format.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.SlicedFormat", additionalServerOptions="--Ice.Default.SlicedFormat") -print("Running test with AMD server.") -TestUtil.clientServerTest(server = "serveramd") +TestUtil.queueClientServerTest(configName = "compact", message = "Running test with compact (default) format.") +TestUtil.queueClientServerTest(configName = "sliced", message = "Running test with sliced format.", + additionalClientOptions="--Ice.Default.SlicedFormat", + additionalServerOptions="--Ice.Default.SlicedFormat") +TestUtil.queueClientServerTest(configName = "amd", localOnly = True, message = "Running test with AMD server.", + server = "serveramd") +TestUtil.runQueuedTests() diff --git a/cpp/test/Ice/proxy/AllTests.cpp b/cpp/test/Ice/proxy/AllTests.cpp index d324135ac83..405c53e4ab2 100644 --- a/cpp/test/Ice/proxy/AllTests.cpp +++ b/cpp/test/Ice/proxy/AllTests.cpp @@ -19,8 +19,9 @@ using namespace std; Test::MyClassPrxPtr allTests(const Ice::CommunicatorPtr& communicator) { + const string endp = getTestEndpoint(communicator, 0); cout << "testing stringToProxy... " << flush; - string ref = "test:default -p 12010"; + string ref = "test:" + endp; Ice::ObjectPrxPtr base = communicator->stringToProxy(ref); test(base); @@ -271,7 +272,7 @@ allTests(const Ice::CommunicatorPtr& communicator) cout << "testing propertyToProxy... " << flush; Ice::PropertiesPtr prop = communicator->getProperties(); string propertyPrefix = "Foo.Proxy"; - prop->setProperty(propertyPrefix, "test:default -p 12010"); + prop->setProperty(propertyPrefix, "test:" + endp); b1 = communicator->propertyToProxy(propertyPrefix); test(b1->ice_getIdentity().name == "test" && b1->ice_getIdentity().category.empty() && b1->ice_getAdapterId().empty() && b1->ice_getFacet().empty()); @@ -280,7 +281,7 @@ allTests(const Ice::CommunicatorPtr& communicator) property = propertyPrefix + ".Locator"; test(!b1->ice_getLocator()); - prop->setProperty(property, "locator:default -p 10000"); + prop->setProperty(property, "locator:" + endp); b1 = communicator->propertyToProxy(propertyPrefix); test(b1->ice_getLocator() && b1->ice_getLocator()->ice_getIdentity().name == "locator"); prop->setProperty(property, ""); @@ -295,7 +296,7 @@ allTests(const Ice::CommunicatorPtr& communicator) // Now retest with an indirect proxy. prop->setProperty(propertyPrefix, "test"); property = propertyPrefix + ".Locator"; - prop->setProperty(property, "locator:default -p 10000"); + prop->setProperty(property, "locator:" + endp); b1 = communicator->propertyToProxy(propertyPrefix); test(b1->ice_getLocator() && b1->ice_getLocator()->ice_getIdentity().name == "locator"); prop->setProperty(property, ""); @@ -315,11 +316,11 @@ allTests(const Ice::CommunicatorPtr& communicator) //test(b1->ice_getLocatorCacheTimeout() == 60); //prop->setProperty("Ice.Default.LocatorCacheTimeout", ""); - prop->setProperty(propertyPrefix, "test:default -p 12010"); + prop->setProperty(propertyPrefix, "test:" + endp); property = propertyPrefix + ".Router"; test(!b1->ice_getRouter()); - prop->setProperty(property, "router:default -p 10000"); + prop->setProperty(property, "router:" + endp); b1 = communicator->propertyToProxy(propertyPrefix); test(b1->ice_getRouter() && b1->ice_getRouter()->ice_getIdentity().name == "router"); prop->setProperty(property, ""); @@ -787,8 +788,8 @@ allTests(const Ice::CommunicatorPtr& communicator) test(compObj->ice_timeout(10) < compObj->ice_timeout(20)); test(!(compObj->ice_timeout(20) < compObj->ice_timeout(10))); - Ice::LocatorPrxPtr loc1 = ICE_UNCHECKED_CAST(Ice::LocatorPrx, communicator->stringToProxy("loc1:default -p 10000")); - Ice::LocatorPrxPtr loc2 = ICE_UNCHECKED_CAST(Ice::LocatorPrx, communicator->stringToProxy("loc2:default -p 10000")); + Ice::LocatorPrxPtr loc1 = ICE_UNCHECKED_CAST(Ice::LocatorPrx, communicator->stringToProxy("loc1:" + endp)); + Ice::LocatorPrxPtr loc2 = ICE_UNCHECKED_CAST(Ice::LocatorPrx, communicator->stringToProxy("loc2:" + endp)); test(compObj->ice_locator(0) == compObj->ice_locator(0)); test(compObj->ice_locator(loc1) == compObj->ice_locator(loc1)); test(compObj->ice_locator(loc1) != compObj->ice_locator(0)); @@ -799,8 +800,8 @@ allTests(const Ice::CommunicatorPtr& communicator) test(compObj->ice_locator(loc1) < compObj->ice_locator(loc2)); test(!(compObj->ice_locator(loc2) < compObj->ice_locator(loc1))); - Ice::RouterPrxPtr rtr1 = ICE_UNCHECKED_CAST(Ice::RouterPrx, communicator->stringToProxy("rtr1:default -p 10000")); - Ice::RouterPrxPtr rtr2 = ICE_UNCHECKED_CAST(Ice::RouterPrx, communicator->stringToProxy("rtr2:default -p 10000")); + Ice::RouterPrxPtr rtr1 = ICE_UNCHECKED_CAST(Ice::RouterPrx, communicator->stringToProxy("rtr1:" + endp)); + Ice::RouterPrxPtr rtr2 = ICE_UNCHECKED_CAST(Ice::RouterPrx, communicator->stringToProxy("rtr2:" + endp)); test(compObj->ice_router(0) == compObj->ice_router(0)); test(compObj->ice_router(rtr1) == compObj->ice_router(rtr1)); test(compObj->ice_router(rtr1) != compObj->ice_router(0)); @@ -949,7 +950,7 @@ allTests(const Ice::CommunicatorPtr& communicator) cout << "ok" << endl; cout << "testing encoding versioning... " << flush; - string ref20 = "test -e 2.0:default -p 12010"; + string ref20 = "test -e 2.0:" + endp; Test::MyClassPrxPtr cl20 = ICE_UNCHECKED_CAST(Test::MyClassPrx, communicator->stringToProxy(ref20)); try { @@ -961,7 +962,7 @@ allTests(const Ice::CommunicatorPtr& communicator) // Server 2.0 endpoint doesn't support 1.1 version. } - string ref10 = "test -e 1.0:default -p 12010"; + string ref10 = "test -e 1.0:" + endp; Test::MyClassPrxPtr cl10 = ICE_UNCHECKED_CAST(Test::MyClassPrx, communicator->stringToProxy(ref10)); cl10->ice_ping(); cl10->ice_encodingVersion(Ice::Encoding_1_0)->ice_ping(); @@ -969,7 +970,7 @@ allTests(const Ice::CommunicatorPtr& communicator) // 1.3 isn't supported but since a 1.3 proxy supports 1.1, the // call will use the 1.1 encoding - string ref13 = "test -e 1.3:default -p 12010"; + string ref13 = "test -e 1.3:" + endp; Test::MyClassPrxPtr cl13 = ICE_UNCHECKED_CAST(Test::MyClassPrx, communicator->stringToProxy(ref13)); cl13->ice_ping(); #ifdef ICE_CPP11_MAPPING @@ -1029,7 +1030,7 @@ allTests(const Ice::CommunicatorPtr& communicator) cout << "testing protocol versioning... " << flush; - ref20 = "test -p 2.0:default -p 12010"; + ref20 = "test -p 2.0:" + endp; cl20 = ICE_UNCHECKED_CAST(Test::MyClassPrx, communicator->stringToProxy(ref20)); try { @@ -1041,13 +1042,13 @@ allTests(const Ice::CommunicatorPtr& communicator) // Server 2.0 proxy doesn't support 1.0 version. } - ref10 = "test -p 1.0:default -p 12010"; + ref10 = "test -p 1.0:" + endp; cl10 = ICE_UNCHECKED_CAST(Test::MyClassPrx, communicator->stringToProxy(ref10)); cl10->ice_ping(); // 1.3 isn't supported but since a 1.3 proxy supports 1.0, the // call will use the 1.0 encoding - ref13 = "test -p 1.3:default -p 12010"; + ref13 = "test -p 1.3:" + endp; cl13 = ICE_UNCHECKED_CAST(Test::MyClassPrx, communicator->stringToProxy(ref13)); cl13->ice_ping(); #ifdef ICE_CPP11_MAPPING diff --git a/cpp/test/Ice/proxy/Client.cpp b/cpp/test/Ice/proxy/Client.cpp index a437557679e..4ae9f5e19d9 100644 --- a/cpp/test/Ice/proxy/Client.cpp +++ b/cpp/test/Ice/proxy/Client.cpp @@ -31,16 +31,22 @@ main(int argc, char* argv[]) { #ifdef ICE_STATIC_LIBS Ice::registerIceSSL(); +# if defined(__linux) + Ice::registerIceBT(); +# endif #endif try { Ice::CommunicatorHolder ich = Ice::initialize(argc, argv); - return run(argc, argv, ich.communicator()); + RemoteConfig rc("Ice/proxy", argc, argv, ich.communicator()); + int status = run(argc, argv, ich.communicator()); + rc.finished(status); + return status; } catch(const Ice::Exception& ex) { cerr << ex << endl; - return EXIT_FAILURE; + return EXIT_FAILURE; } } diff --git a/cpp/test/Ice/proxy/Collocated.cpp b/cpp/test/Ice/proxy/Collocated.cpp index c2310bf36b7..ae131a1478b 100644 --- a/cpp/test/Ice/proxy/Collocated.cpp +++ b/cpp/test/Ice/proxy/Collocated.cpp @@ -18,7 +18,7 @@ using namespace std; int run(int, char**, const Ice::CommunicatorPtr& communicator) { - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0)); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); adapter->add(ICE_MAKE_SHARED(MyDerivedClassI), communicator->stringToIdentity("test")); //adapter->activate(); // Don't activate OA to ensure collocation is used. diff --git a/cpp/test/Ice/proxy/Makefile b/cpp/test/Ice/proxy/Makefile index 803fb4d002d..da6458f658a 100644 --- a/cpp/test/Ice/proxy/Makefile +++ b/cpp/test/Ice/proxy/Makefile @@ -51,18 +51,20 @@ include $(top_srcdir)/config/Make.rules CPPFLAGS := -I. -I../../include -I../../../src $(CPPFLAGS) +LINKWITH := -lTestCommon $(LIBS) + $(CLIENT): $(COBJS) rm -f $@ - $(call mktest,$@,$(COBJS),$(LIBS)) + $(call mktest,$@,$(COBJS),$(LINKWITH)) $(SERVER): $(SOBJS) rm -f $@ - $(call mktest,$@,$(SOBJS),$(LIBS)) + $(call mktest,$@,$(SOBJS),$(LINKWITH)) $(SERVERAMD): $(SAMDOBJS) rm -f $@ - $(call mktest,$@,$(SAMDOBJS),$(LIBS)) + $(call mktest,$@,$(SAMDOBJS),$(LINKWITH)) $(COLLOCATED): $(COLOBJS) rm -f $@ - $(call mktest,$@,$(COLOBJS),$(LIBS)) + $(call mktest,$@,$(COLOBJS),$(LINKWITH)) diff --git a/cpp/test/Ice/proxy/Makefile.mak b/cpp/test/Ice/proxy/Makefile.mak index 55b8cc66b0f..ab98662bdb0 100644 --- a/cpp/test/Ice/proxy/Makefile.mak +++ b/cpp/test/Ice/proxy/Makefile.mak @@ -53,6 +53,7 @@ OBJS = $(COBJS) \ !include $(top_srcdir)/config/Make.rules.mak CPPFLAGS = -I. -I../../include -I../../../src $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN +LINKWITH = testcommon$(LIBSUFFIX).lib $(LIBS) !if "$(GENERATE_PDB)" == "yes" CPDBFLAGS = /pdb:$(CLIENT).pdb @@ -62,22 +63,22 @@ COPDBFLAGS = /pdb:$(COLLOCATED).pdb !endif $(CLIENT)$(EXT): $(COBJS) - $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(SERVER)$(EXT): $(SOBJS) - $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(SERVERAMD)$(EXT): $(SAMDOBJS) - $(LINK) $(LD_TESTFLAGS) $(SAPDBFLAGS) $(SAMDOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(SAPDBFLAGS) $(SAMDOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(COLLOCATED)$(EXT): $(COLOBJS) - $(LINK) $(LD_TESTFLAGS) $(COPDBFLAGS) $(COLOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(COPDBFLAGS) $(COLOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest diff --git a/cpp/test/Ice/proxy/Server.cpp b/cpp/test/Ice/proxy/Server.cpp index b2069a3ac1c..ed328427f86 100644 --- a/cpp/test/Ice/proxy/Server.cpp +++ b/cpp/test/Ice/proxy/Server.cpp @@ -18,7 +18,7 @@ using namespace std; int run(int, char**, const Ice::CommunicatorPtr& communicator) { - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010:udp"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0)); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); adapter->add(ICE_MAKE_SHARED(MyDerivedClassI), communicator->stringToIdentity("test")); adapter->activate(); diff --git a/cpp/test/Ice/proxy/ServerAMD.cpp b/cpp/test/Ice/proxy/ServerAMD.cpp index fa2043f2c2f..db3c70012dc 100644 --- a/cpp/test/Ice/proxy/ServerAMD.cpp +++ b/cpp/test/Ice/proxy/ServerAMD.cpp @@ -18,7 +18,7 @@ using namespace std; int run(int, char**, const Ice::CommunicatorPtr& communicator) { - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010:udp"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0)); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); adapter->add(ICE_MAKE_SHARED(MyDerivedClassI), communicator->stringToIdentity("test")); adapter->activate(); diff --git a/cpp/test/Ice/proxy/run.py b/cpp/test/Ice/proxy/run.py index 6d8f4682523..ab0953a3b3a 100755 --- a/cpp/test/Ice/proxy/run.py +++ b/cpp/test/Ice/proxy/run.py @@ -20,9 +20,8 @@ if len(path) == 0: sys.path.append(os.path.join(path[0], "scripts")) import TestUtil -print("tests with regular server.") -TestUtil.clientServerTest() -print("tests with AMD server.") -TestUtil.clientServerTest(server = "serveramd") -print("tests with collocated server.") -TestUtil.collocatedTest() +TestUtil.queueClientServerTest() +TestUtil.queueClientServerTest(configName = "amd", localOnly = True, message = "Running test with AMD server.", + server = "serveramd") +TestUtil.queueCollocatedTest() +TestUtil.runQueuedTests() diff --git a/cpp/test/Ice/retry/Client.cpp b/cpp/test/Ice/retry/Client.cpp index 4a125e812d3..4b856f2c039 100644 --- a/cpp/test/Ice/retry/Client.cpp +++ b/cpp/test/Ice/retry/Client.cpp @@ -21,7 +21,7 @@ int run(int, char**, const Ice::CommunicatorPtr& communicator, const Ice::CommunicatorPtr& communicator2) { RetryPrxPtr allTests(const Ice::CommunicatorPtr&, const Ice::CommunicatorPtr&, const string&); - RetryPrxPtr retry = allTests(communicator, communicator2, "retry:default -p 12010"); + RetryPrxPtr retry = allTests(communicator, communicator2, "retry:" + getTestEndpoint(communicator, 0)); retry->shutdown(); return EXIT_SUCCESS; } diff --git a/cpp/test/Ice/retry/Makefile b/cpp/test/Ice/retry/Makefile index a3dbf5cb6cb..655dae50038 100644 --- a/cpp/test/Ice/retry/Makefile +++ b/cpp/test/Ice/retry/Makefile @@ -40,14 +40,16 @@ include $(top_srcdir)/config/Make.rules CPPFLAGS := -I. -I../../include $(CPPFLAGS) +LINKWITH := -lTestCommon $(LIBS) + $(CLIENT): $(COBJS) rm -f $@ - $(call mktest,$@,$(COBJS),$(LIBS)) + $(call mktest,$@,$(COBJS),$(LINKWITH)) $(SERVER): $(SOBJS) rm -f $@ - $(call mktest,$@,$(SOBJS),$(LIBS)) + $(call mktest,$@,$(SOBJS),$(LINKWITH)) $(COLLOCATED): $(COLOBJS) rm -f $@ - $(call mktest,$@,$(COLOBJS),$(LIBS)) + $(call mktest,$@,$(COLOBJS),$(LINKWITH)) diff --git a/cpp/test/Ice/retry/Makefile.mak b/cpp/test/Ice/retry/Makefile.mak index be45955bcc3..4a29f604b83 100644 --- a/cpp/test/Ice/retry/Makefile.mak +++ b/cpp/test/Ice/retry/Makefile.mak @@ -49,6 +49,7 @@ OBJS = $(COBJS) \ !include $(top_srcdir)/config/Make.rules.mak CPPFLAGS = -I. -I../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN +LINKWITH = testcommon$(LIBSUFFIX).lib $(LIBS) !if "$(GENERATE_PDB)" == "yes" CPDBFLAGS = /pdb:$(CLIENT).pdb @@ -57,17 +58,17 @@ COPDBFLAGS = /pdb:$(COLLOCATED).pdb !endif $(CLIENT)$(EXT): $(COBJS) - $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(SERVER)$(EXT): $(SOBJS) - $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(COLLOCATED)$(EXT): $(COLOBJS) - $(LINK) $(LD_TESTFLAGS) $(COPDBFLAGS) $(COLOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(COPDBFLAGS) $(COLOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest diff --git a/cpp/test/Ice/retry/Server.cpp b/cpp/test/Ice/retry/Server.cpp index 905eb6d3bd9..ab6b4c34aa3 100644 --- a/cpp/test/Ice/retry/Server.cpp +++ b/cpp/test/Ice/retry/Server.cpp @@ -18,7 +18,7 @@ using namespace std; int run(int, char**, const Ice::CommunicatorPtr& communicator) { - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010:udp"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0) + ":udp"); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); adapter->add(ICE_MAKE_SHARED(RetryI), communicator->stringToIdentity("retry")); adapter->activate(); diff --git a/cpp/test/Ice/retry/run.py b/cpp/test/Ice/retry/run.py index 0816938a196..eb52f00447a 100755 --- a/cpp/test/Ice/retry/run.py +++ b/cpp/test/Ice/retry/run.py @@ -20,7 +20,6 @@ if len(path) == 0: sys.path.append(os.path.join(path[0], "scripts")) import TestUtil -print("tests with regular server.") -TestUtil.clientServerTest() -print("tests with collocated server.") -TestUtil.collocatedTest() +TestUtil.queueClientServerTest() +TestUtil.queueCollocatedTest() +TestUtil.runQueuedTests() diff --git a/cpp/test/Ice/servantLocator/AllTests.cpp b/cpp/test/Ice/servantLocator/AllTests.cpp index edc1c6d165e..fab408d7368 100644 --- a/cpp/test/Ice/servantLocator/AllTests.cpp +++ b/cpp/test/Ice/servantLocator/AllTests.cpp @@ -216,8 +216,9 @@ testExceptions(const TestIntfPrxPtr& obj) TestIntfPrxPtr allTests(const CommunicatorPtr& communicator) { + const string endp = getTestEndpoint(communicator, 0); cout << "testing stringToProxy... " << flush; - ObjectPrxPtr base = communicator->stringToProxy("asm:default -p 12010"); + ObjectPrxPtr base = communicator->stringToProxy("asm:" + endp); test(base); cout << "ok" << endl; @@ -234,7 +235,7 @@ allTests(const CommunicatorPtr& communicator) cout << "testing ice_ids... " << flush; try { - ObjectPrxPtr o = communicator->stringToProxy("category/locate:default -p 12010"); + ObjectPrxPtr o = communicator->stringToProxy("category/locate:" + endp); o->ice_ids(); test(false); } @@ -249,7 +250,7 @@ allTests(const CommunicatorPtr& communicator) try { - ObjectPrxPtr o = communicator->stringToProxy("category/finished:default -p 12010"); + ObjectPrxPtr o = communicator->stringToProxy("category/finished:" + endp); o->ice_ids(); test(false); } @@ -264,7 +265,7 @@ allTests(const CommunicatorPtr& communicator) cout << "ok" << endl; cout << "testing servant locator..." << flush; - base = communicator->stringToProxy("category/locate:default -p 12010"); + base = communicator->stringToProxy("category/locate:" + endp); obj = ICE_CHECKED_CAST(TestIntfPrx, base); try { @@ -276,9 +277,9 @@ allTests(const CommunicatorPtr& communicator) cout << "ok" << endl; cout << "testing default servant locator..." << flush; - base = communicator->stringToProxy("anothercategory/locate:default -p 12010"); + base = communicator->stringToProxy("anothercategory/locate:" + endp); obj = ICE_CHECKED_CAST(TestIntfPrx, base); - base = communicator->stringToProxy("locate:default -p 12010"); + base = communicator->stringToProxy("locate:" + endp); obj = ICE_CHECKED_CAST(TestIntfPrx, base); try { @@ -289,7 +290,7 @@ allTests(const CommunicatorPtr& communicator) } try { - ICE_CHECKED_CAST(TestIntfPrx, communicator->stringToProxy("unknown:default -p 12010")); + ICE_CHECKED_CAST(TestIntfPrx, communicator->stringToProxy("unknown:" + endp)); } catch(const Ice::ObjectNotExistException&) { @@ -297,13 +298,13 @@ allTests(const CommunicatorPtr& communicator) cout << "ok" << endl; cout << "testing locate exceptions... " << flush; - base = communicator->stringToProxy("category/locate:default -p 12010"); + base = communicator->stringToProxy("category/locate:" + endp); obj = ICE_CHECKED_CAST(TestIntfPrx, base); testExceptions(obj); cout << "ok" << endl; cout << "testing finished exceptions... " << flush; - base = communicator->stringToProxy("category/finished:default -p 12010"); + base = communicator->stringToProxy("category/finished:" + endp); obj = ICE_CHECKED_CAST(TestIntfPrx, base); testExceptions(obj); @@ -343,7 +344,7 @@ allTests(const CommunicatorPtr& communicator) cout << "ok" << endl; cout << "testing servant locator removal... " << flush; - base = communicator->stringToProxy("test/activation:default -p 12010"); + base = communicator->stringToProxy("test/activation:" + endp); TestActivationPrxPtr activation = ICE_CHECKED_CAST(TestActivationPrx, base); activation->activateServantLocator(false); try diff --git a/cpp/test/Ice/servantLocator/Client.cpp b/cpp/test/Ice/servantLocator/Client.cpp index 70ac931e8cb..27f539823a6 100644 --- a/cpp/test/Ice/servantLocator/Client.cpp +++ b/cpp/test/Ice/servantLocator/Client.cpp @@ -30,13 +30,20 @@ main(int argc, char* argv[]) { #ifdef ICE_STATIC_LIBS Ice::registerIceSSL(); +# if defined(__linux) + Ice::registerIceBT(); +# endif #endif + try { Ice::InitializationData initData; initData.properties = Ice::createProperties(argc, argv); Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData); - return run(argc, argv, ich.communicator()); + RemoteConfig rc("Ice/servantLocator", argc, argv, ich.communicator()); + int status = run(argc, argv, ich.communicator()); + rc.finished(status); + return status; } catch(const Ice::Exception& ex) { diff --git a/cpp/test/Ice/servantLocator/Collocated.cpp b/cpp/test/Ice/servantLocator/Collocated.cpp index 175bb69aa28..c8378b6bf7c 100644 --- a/cpp/test/Ice/servantLocator/Collocated.cpp +++ b/cpp/test/Ice/servantLocator/Collocated.cpp @@ -91,7 +91,7 @@ int run(int, char**, const Ice::CommunicatorPtr& communicator) { communicator->getProperties()->setProperty("Ice.Warn.Dispatch", "0"); - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0)); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); adapter->addServantLocator(ICE_MAKE_SHARED(ServantLocatorI, ""), ""); diff --git a/cpp/test/Ice/servantLocator/Makefile b/cpp/test/Ice/servantLocator/Makefile index bafff999078..bd5cd67ea3f 100644 --- a/cpp/test/Ice/servantLocator/Makefile +++ b/cpp/test/Ice/servantLocator/Makefile @@ -48,18 +48,20 @@ include $(top_srcdir)/config/Make.rules CPPFLAGS := -I. -I../../include $(CPPFLAGS) +LINKWITH := -lTestCommon $(LIBS) + $(CLIENT): $(COBJS) rm -f $@ - $(call mktest,$@,$(COBJS),$(LIBS)) + $(call mktest,$@,$(COBJS),$(LINKWITH)) $(SERVER): $(SOBJS) rm -f $@ - $(call mktest,$@,$(SOBJS),$(LIBS)) + $(call mktest,$@,$(SOBJS),$(LINKWITH)) $(SERVERAMD): $(SAMDOBJS) rm -f $@ - $(call mktest,$@,$(SAMDOBJS),$(LIBS)) + $(call mktest,$@,$(SAMDOBJS),$(LINKWITH)) $(COLLOCATED): $(COLOBJS) rm -f $@ - $(call mktest,$@,$(COLOBJS),$(LIBS)) + $(call mktest,$@,$(COLOBJS),$(LINKWITH)) diff --git a/cpp/test/Ice/servantLocator/Makefile.mak b/cpp/test/Ice/servantLocator/Makefile.mak index 9b2eb564aaa..e05266c7ef2 100644 --- a/cpp/test/Ice/servantLocator/Makefile.mak +++ b/cpp/test/Ice/servantLocator/Makefile.mak @@ -56,6 +56,7 @@ OBJS = $(COBJS) \ !include $(top_srcdir)/config/Make.rules.mak CPPFLAGS = -I. -I../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN +LINKWITH = testcommon$(LIBSUFFIX).lib $(LIBS) !if "$(GENERATE_PDB)" == "yes" CPDBFLAGS = /pdb:$(CLIENT).pdb @@ -65,22 +66,22 @@ COPDBFLAGS = /pdb:$(COLLOCATED).pdb !endif $(CLIENT)$(EXT): $(COBJS) - $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(SERVER)$(EXT): $(SOBJS) - $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(SERVERAMD)$(EXT): $(SAMDOBJS) - $(LINK) $(LD_TESTFLAGS) $(SAPDBFLAGS) $(SAMDOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(SAPDBFLAGS) $(SAMDOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(COLLOCATED)$(EXT): $(COLOBJS) - $(LINK) $(LD_TESTFLAGS) $(COPDBFLAGS) $(COLOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(COPDBFLAGS) $(COLOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest diff --git a/cpp/test/Ice/servantLocator/Server.cpp b/cpp/test/Ice/servantLocator/Server.cpp index ba2c45b4c7f..f4508f88606 100644 --- a/cpp/test/Ice/servantLocator/Server.cpp +++ b/cpp/test/Ice/servantLocator/Server.cpp @@ -90,7 +90,7 @@ public: int run(int, char**, const Ice::CommunicatorPtr& communicator) { - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010:udp"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0) + ":udp"); communicator->getProperties()->setProperty("Ice.Warn.Dispatch", "0"); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); diff --git a/cpp/test/Ice/servantLocator/ServerAMD.cpp b/cpp/test/Ice/servantLocator/ServerAMD.cpp index 94d7b38a75e..e5da80a16d3 100644 --- a/cpp/test/Ice/servantLocator/ServerAMD.cpp +++ b/cpp/test/Ice/servantLocator/ServerAMD.cpp @@ -89,7 +89,7 @@ public: int run(int, char**, const Ice::CommunicatorPtr& communicator) { - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010:udp"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0) + ":udp"); communicator->getProperties()->setProperty("Ice.Warn.Dispatch", "0"); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); diff --git a/cpp/test/Ice/servantLocator/run.py b/cpp/test/Ice/servantLocator/run.py index 6d8f4682523..ab0953a3b3a 100755 --- a/cpp/test/Ice/servantLocator/run.py +++ b/cpp/test/Ice/servantLocator/run.py @@ -20,9 +20,8 @@ if len(path) == 0: sys.path.append(os.path.join(path[0], "scripts")) import TestUtil -print("tests with regular server.") -TestUtil.clientServerTest() -print("tests with AMD server.") -TestUtil.clientServerTest(server = "serveramd") -print("tests with collocated server.") -TestUtil.collocatedTest() +TestUtil.queueClientServerTest() +TestUtil.queueClientServerTest(configName = "amd", localOnly = True, message = "Running test with AMD server.", + server = "serveramd") +TestUtil.queueCollocatedTest() +TestUtil.runQueuedTests() diff --git a/cpp/test/Ice/services/run.py b/cpp/test/Ice/services/run.py index 1bbd63078e3..1bbd63078e3 100644..100755 --- a/cpp/test/Ice/services/run.py +++ b/cpp/test/Ice/services/run.py diff --git a/cpp/test/Ice/slicing/exceptions/AllTests.cpp b/cpp/test/Ice/slicing/exceptions/AllTests.cpp index 81b05dcb185..38a61807d31 100644 --- a/cpp/test/Ice/slicing/exceptions/AllTests.cpp +++ b/cpp/test/Ice/slicing/exceptions/AllTests.cpp @@ -371,7 +371,7 @@ class RelayI : public Relay TestIntfPrxPtr allTests(const Ice::CommunicatorPtr& communicator) { - Ice::ObjectPrxPtr obj = communicator->stringToProxy("Test:default -p 12010"); + Ice::ObjectPrxPtr obj = communicator->stringToProxy("Test:" + getTestEndpoint(communicator, 0)); TestIntfPrxPtr test = ICE_CHECKED_CAST(TestIntfPrx, obj); cout << "base... " << flush; @@ -1040,8 +1040,21 @@ allTests(const Ice::CommunicatorPtr& communicator) cout << "ok" << endl; cout << "preserved exceptions... " << flush; + string localOAEndpoint; { - Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("Relay", "default"); + ostringstream ostr; + if(communicator->getProperties()->getProperty("Ice.Default.Protocol") == "bt") + { + ostr << "default -a *"; + } + else + { + ostr << "default -h *"; + } + localOAEndpoint = ostr.str(); + } + { + Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("Relay", localOAEndpoint); RelayPrxPtr relay = ICE_UNCHECKED_CAST(RelayPrx, adapter->addWithUUID(ICE_MAKE_SHARED(RelayI))); adapter->activate(); @@ -1059,6 +1072,11 @@ allTests(const Ice::CommunicatorPtr& communicator) catch(const Ice::OperationNotExistException&) { } + catch(const Ice::LocalException& ex) + { + cout << endl << "** OOPS" << endl << ex << endl; + test(false); + } catch(...) { test(false); diff --git a/cpp/test/Ice/slicing/exceptions/Client.cpp b/cpp/test/Ice/slicing/exceptions/Client.cpp index 2af061d744f..680872910b3 100644 --- a/cpp/test/Ice/slicing/exceptions/Client.cpp +++ b/cpp/test/Ice/slicing/exceptions/Client.cpp @@ -30,12 +30,18 @@ main(int argc, char* argv[]) { #ifdef ICE_STATIC_LIBS Ice::registerIceSSL(); +# if defined(__linux) + Ice::registerIceBT(); +# endif #endif try { Ice::CommunicatorHolder ich = Ice::initialize(argc, argv); - return run(argc, argv, ich.communicator()); + RemoteConfig rc("Ice/slicing/exceptions", argc, argv, ich.communicator()); + int status = run(argc, argv, ich.communicator()); + rc.finished(status); + return status; } catch(const Ice::Exception& ex) { diff --git a/cpp/test/Ice/slicing/exceptions/Makefile b/cpp/test/Ice/slicing/exceptions/Makefile index ffda27ccbc3..27543a2717a 100644 --- a/cpp/test/Ice/slicing/exceptions/Makefile +++ b/cpp/test/Ice/slicing/exceptions/Makefile @@ -42,14 +42,16 @@ ICECPPFLAGS := -I. $(ICECPPFLAGS) CPPFLAGS := -I. -I../../../include $(CPPFLAGS) +LINKWITH := -lTestCommon $(LIBS) + $(CLIENT): $(COBJS) rm -f $@ - $(call mktest,$@,$(COBJS),$(LIBS)) + $(call mktest,$@,$(COBJS),$(LINKWITH)) $(SERVER): $(SOBJS) rm -f $@ - $(call mktest,$@,$(SOBJS),$(LIBS)) + $(call mktest,$@,$(SOBJS),$(LINKWITH)) $(SERVERAMD): $(SAMDOBJS) rm -f $@ - $(call mktest,$@,$(SAMDOBJS),$(LIBS)) + $(call mktest,$@,$(SAMDOBJS),$(LINKWITH)) diff --git a/cpp/test/Ice/slicing/exceptions/Makefile.mak b/cpp/test/Ice/slicing/exceptions/Makefile.mak index 78ee9040d09..b1dca2a15d7 100644 --- a/cpp/test/Ice/slicing/exceptions/Makefile.mak +++ b/cpp/test/Ice/slicing/exceptions/Makefile.mak @@ -45,6 +45,7 @@ OBJS = $(COBJS) \ ICECPPFLAGS = -I. $(ICECPPFLAGS) CPPFLAGS = -I. -I../../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN +LINKWITH = testcommon$(LIBSUFFIX).lib $(LIBS) !if "$(GENERATE_PDB)" == "yes" CPDBFLAGS = /pdb:$(CLIENT:.exe=.pdb) @@ -53,17 +54,17 @@ SAPDBFLAGS = /pdb:$(SERVERAMD:.exe=.pdb) !endif $(CLIENT): $(COBJS) - $(LINK) $(LD_EXEFLAGS) $(CPDBFLAGS) $(SETARGV) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_EXEFLAGS) $(CPDBFLAGS) $(SETARGV) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(SERVER): $(SOBJS) - $(LINK) $(LD_EXEFLAGS) $(SPDBFLAGS) $(SETARGV) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_EXEFLAGS) $(SPDBFLAGS) $(SETARGV) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(SERVERAMD): $(SAMDOBJS) - $(LINK) $(LD_EXEFLAGS) $(SAPDBFLAGS) $(SETARGV) $(SAMDOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_EXEFLAGS) $(SAPDBFLAGS) $(SETARGV) $(SAMDOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest diff --git a/cpp/test/Ice/slicing/exceptions/Server.cpp b/cpp/test/Ice/slicing/exceptions/Server.cpp index c4050bfddab..231eaede42b 100644 --- a/cpp/test/Ice/slicing/exceptions/Server.cpp +++ b/cpp/test/Ice/slicing/exceptions/Server.cpp @@ -20,7 +20,7 @@ run(int, char**, const Ice::CommunicatorPtr& communicator) { Ice::PropertiesPtr properties = communicator->getProperties(); properties->setProperty("Ice.Warn.Dispatch", "0"); - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010 -t 2000"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0) + " -t 2000"); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); adapter->add(ICE_MAKE_SHARED(TestI), communicator->stringToIdentity("Test")); adapter->activate(); diff --git a/cpp/test/Ice/slicing/exceptions/ServerAMD.cpp b/cpp/test/Ice/slicing/exceptions/ServerAMD.cpp index 74dac0ae3a8..35dec21d631 100644 --- a/cpp/test/Ice/slicing/exceptions/ServerAMD.cpp +++ b/cpp/test/Ice/slicing/exceptions/ServerAMD.cpp @@ -20,7 +20,7 @@ run(int, char**, const Ice::CommunicatorPtr& communicator) { Ice::PropertiesPtr properties = communicator->getProperties(); properties->setProperty("Ice.Warn.Dispatch", "0"); - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010 -t 2000"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0) + " -t 2000"); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); adapter->add(ICE_MAKE_SHARED(TestI), communicator->stringToIdentity("Test")); adapter->activate(); diff --git a/cpp/test/Ice/slicing/exceptions/run.py b/cpp/test/Ice/slicing/exceptions/run.py index 526c93a88c2..5d1b83e01d8 100755 --- a/cpp/test/Ice/slicing/exceptions/run.py +++ b/cpp/test/Ice/slicing/exceptions/run.py @@ -20,17 +20,18 @@ if len(path) == 0: sys.path.append(os.path.join(path[0], "scripts")) import TestUtil -print("Running test with sliced format.") -TestUtil.clientServerTest() +TestUtil.queueClientServerTest(configName = "sliced", message = "Running test with sliced format.") -print("Running test with 1.0 encoding.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", - additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.queueClientServerTest(configName = "1.0", message = "Running test with 1.0 encoding.", + additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") -print("Running test with sliced format and AMD server.") -TestUtil.clientServerTest(server="serveramd") +TestUtil.queueClientServerTest(configName = "slicedAMD", localOnly = True, + message = "Running test with sliced format and AMD server.", server="serveramd") -print("Running test with 1.0 encoding and AMD server.") -TestUtil.clientServerTest(server="serveramd", - additionalClientOptions="--Ice.Default.EncodingVersion=1.0", - additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.queueClientServerTest(configName = "1.0AMD", localOnly = True, + message = "Running test with 1.0 encoding and AMD server.", + server="serveramd", + additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.runQueuedTests() diff --git a/cpp/test/Ice/slicing/objects/AllTests.cpp b/cpp/test/Ice/slicing/objects/AllTests.cpp index 44172e57669..516f255ce43 100644 --- a/cpp/test/Ice/slicing/objects/AllTests.cpp +++ b/cpp/test/Ice/slicing/objects/AllTests.cpp @@ -597,7 +597,7 @@ testUOO(const TestIntfPrxPtr& test) TestIntfPrxPtr allTests(const Ice::CommunicatorPtr& communicator) { - Ice::ObjectPrxPtr obj = communicator->stringToProxy("Test:default -p 12010"); + Ice::ObjectPrxPtr obj = communicator->stringToProxy("Test:" + getTestEndpoint(communicator, 0)); TestIntfPrxPtr test = ICE_CHECKED_CAST(TestIntfPrx, obj); cout << "base as Object... " << flush; diff --git a/cpp/test/Ice/slicing/objects/Client.cpp b/cpp/test/Ice/slicing/objects/Client.cpp index 0f444a7ff7a..d76b4a46845 100644 --- a/cpp/test/Ice/slicing/objects/Client.cpp +++ b/cpp/test/Ice/slicing/objects/Client.cpp @@ -30,6 +30,9 @@ main(int argc, char* argv[]) { #ifdef ICE_STATIC_LIBS Ice::registerIceSSL(); +# if defined(__linux) + Ice::registerIceBT(); +# endif #endif try @@ -42,7 +45,10 @@ main(int argc, char* argv[]) initData.properties->setProperty("Ice.CollectObjects", "1"); Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData); - return run(argc, argv, ich.communicator()); + RemoteConfig rc("Ice/slicing/objects", argc, argv, ich.communicator()); + int status = run(argc, argv, ich.communicator()); + rc.finished(status); + return status; } catch(const Ice::Exception& ex) { diff --git a/cpp/test/Ice/slicing/objects/Makefile b/cpp/test/Ice/slicing/objects/Makefile index bce7b99450e..4ce5904187c 100644 --- a/cpp/test/Ice/slicing/objects/Makefile +++ b/cpp/test/Ice/slicing/objects/Makefile @@ -48,14 +48,16 @@ ICECPPFLAGS := -I. $(ICECPPFLAGS) CPPFLAGS := -I. -I../../../include $(CPPFLAGS) +LINKWITH := -lTestCommon $(LIBS) + $(CLIENT): $(COBJS) rm -f $@ - $(call mktest,$@,$(COBJS),$(LIBS)) + $(call mktest,$@,$(COBJS),$(LINKWITH)) $(SERVER): $(SOBJS) rm -f $@ - $(call mktest,$@,$(SOBJS),$(LIBS)) + $(call mktest,$@,$(SOBJS),$(LINKWITH)) $(SERVERAMD): $(SAMDOBJS) rm -f $@ - $(call mktest,$@,$(SAMDOBJS),$(LIBS)) + $(call mktest,$@,$(SAMDOBJS),$(LINKWITH)) diff --git a/cpp/test/Ice/slicing/objects/Makefile.mak b/cpp/test/Ice/slicing/objects/Makefile.mak index c708e09ff51..665eece100d 100644 --- a/cpp/test/Ice/slicing/objects/Makefile.mak +++ b/cpp/test/Ice/slicing/objects/Makefile.mak @@ -45,6 +45,7 @@ OBJS = $(COBJS) \ ICECPPFLAGS = -I. $(ICECPPFLAGS) CPPFLAGS = -I. -I../../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN +LINKWITH = testcommon$(LIBSUFFIX).lib $(LIBS) !if "$(GENERATE_PDB)" == "yes" CPDBFLAGS = /pdb:$(CLIENT:.exe=.pdb) @@ -53,17 +54,17 @@ SAPDBFLAGS = /pdb:$(SERVERAMD:.exe=.pdb) !endif $(CLIENT): $(COBJS) - $(LINK) $(LD_EXEFLAGS) $(CPDBFLAGS) $(SETARGV) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_EXEFLAGS) $(CPDBFLAGS) $(SETARGV) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(SERVER): $(SOBJS) - $(LINK) $(LD_EXEFLAGS) $(SPDBFLAGS) $(SETARGV) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_EXEFLAGS) $(SPDBFLAGS) $(SETARGV) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(SERVERAMD): $(SAMDOBJS) - $(LINK) $(LD_EXEFLAGS) $(SAPDBFLAGS) $(SETARGV) $(SAMDOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_EXEFLAGS) $(SAPDBFLAGS) $(SETARGV) $(SAMDOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest diff --git a/cpp/test/Ice/slicing/objects/Server.cpp b/cpp/test/Ice/slicing/objects/Server.cpp index 48de66808d7..7adf4de9644 100644 --- a/cpp/test/Ice/slicing/objects/Server.cpp +++ b/cpp/test/Ice/slicing/objects/Server.cpp @@ -20,7 +20,7 @@ run(int, char**, const Ice::CommunicatorPtr& communicator) { Ice::PropertiesPtr properties = communicator->getProperties(); properties->setProperty("Ice.Warn.Dispatch", "0"); - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010 -t 2000"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0) + " -t 2000"); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); Ice::ObjectPtr object = ICE_MAKE_SHARED(TestI); adapter->add(object, communicator->stringToIdentity("Test")); diff --git a/cpp/test/Ice/slicing/objects/ServerAMD.cpp b/cpp/test/Ice/slicing/objects/ServerAMD.cpp index 7986c9091b6..3d570aac3e3 100644 --- a/cpp/test/Ice/slicing/objects/ServerAMD.cpp +++ b/cpp/test/Ice/slicing/objects/ServerAMD.cpp @@ -20,7 +20,7 @@ run(int, char**, const Ice::CommunicatorPtr& communicator) { Ice::PropertiesPtr properties = communicator->getProperties(); properties->setProperty("Ice.Warn.Dispatch", "0"); - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010 -t 2000"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0) + " -t 2000"); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); Ice::ObjectPtr object = ICE_MAKE_SHARED(TestI); adapter->add(object, communicator->stringToIdentity("Test")); diff --git a/cpp/test/Ice/slicing/objects/run.py b/cpp/test/Ice/slicing/objects/run.py index 7e9990a8753..259f9e67acb 100755 --- a/cpp/test/Ice/slicing/objects/run.py +++ b/cpp/test/Ice/slicing/objects/run.py @@ -20,17 +20,18 @@ if len(path) == 0: sys.path.append(os.path.join(path[0], "scripts")) import TestUtil -print("Running test with sliced format.") -TestUtil.clientServerTest() +TestUtil.queueClientServerTest(configName = "sliced", message = "Running test with sliced format.") -print("Running test with 1.0 encoding.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", - additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.queueClientServerTest(configName = "1.0", message = "Running test with 1.0 encoding.", + additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") -print("Running test with sliced format and AMD server.") -TestUtil.clientServerTest(server="serveramd") +TestUtil.queueClientServerTest(configName = "slicedAMD", localOnly = True, + message = "Running test with sliced format and AMD server.", server="serveramd") -print("Running test with 1.0 encoding and AMD server.") -TestUtil.clientServerTest(server="serveramd", - additionalClientOptions="--Ice.Default.EncodingVersion=1.0", - additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.queueClientServerTest(configName = "1.0AMD", localOnly = True, + message = "Running test with 1.0 encoding and AMD server.", + server="serveramd", + additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.runQueuedTests() diff --git a/cpp/test/Ice/stringConverter/Client.cpp b/cpp/test/Ice/stringConverter/Client.cpp index e1e57d2e7ae..a9c77899608 100644 --- a/cpp/test/Ice/stringConverter/Client.cpp +++ b/cpp/test/Ice/stringConverter/Client.cpp @@ -95,8 +95,9 @@ main(int argc, char* argv[]) int Client::run(int, char*[]) { - Test::MyObjectPrxPtr proxy = ICE_UNCHECKED_CAST(Test::MyObjectPrx, - communicator()->stringToProxy("test:default -p 12010")); + Test::MyObjectPrxPtr proxy = + ICE_UNCHECKED_CAST(Test::MyObjectPrx, + communicator()->stringToProxy("test:" + getTestEndpoint(communicator(), 0))); char oe = char(0xBD); // A single character in ISO Latin 9 string msg = string("tu me fends le c") + oe + "ur!"; diff --git a/cpp/test/Ice/stringConverter/Makefile b/cpp/test/Ice/stringConverter/Makefile index 3482562c297..1a77bb2726e 100644 --- a/cpp/test/Ice/stringConverter/Makefile +++ b/cpp/test/Ice/stringConverter/Makefile @@ -27,7 +27,7 @@ OBJS = $(COBJS) \ include $(top_srcdir)/config/Make.rules -LINKWITH = $(LIBS) $(ICONV_LIBS) +LINKWITH = -lTestCommon $(LIBS) $(ICONV_LIBS) CPPFLAGS := -I. -I../../include $(CPPFLAGS) diff --git a/cpp/test/Ice/stringConverter/Makefile.mak b/cpp/test/Ice/stringConverter/Makefile.mak index 49e2aa4d304..a807550a7cc 100644 --- a/cpp/test/Ice/stringConverter/Makefile.mak +++ b/cpp/test/Ice/stringConverter/Makefile.mak @@ -28,6 +28,7 @@ OBJS = $(COBJS) \ !include $(top_srcdir)/config/Make.rules.mak CPPFLAGS = -I. -I../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN +LINKWITH = testcommon$(LIBSUFFIX).lib $(LIBS) !if "$(GENERATE_PDB)" == "yes" CPDBFLAGS = /pdb:$(CLIENT).pdb @@ -35,12 +36,12 @@ SPDBFLAGS = /pdb:$(SERVER).pdb !endif $(CLIENT): $(COBJS) - $(LINK) $(LD_EXEFLAGS) $(CPDBFLAGS) $(SETARGV) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LIBNAME) $(LIBS) + $(LINK) $(LD_EXEFLAGS) $(CPDBFLAGS) $(SETARGV) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LIBNAME) $(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(SERVER): $(SOBJS) - $(LINK) $(LD_EXEFLAGS) $(SPDBFLAGS) $(SETARGV) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBNAME) $(LIBS) + $(LINK) $(LD_EXEFLAGS) $(SPDBFLAGS) $(SETARGV) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBNAME) $(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest diff --git a/cpp/test/Ice/stringConverter/Server.cpp b/cpp/test/Ice/stringConverter/Server.cpp index 225c54f8f48..0607a4f2d17 100644 --- a/cpp/test/Ice/stringConverter/Server.cpp +++ b/cpp/test/Ice/stringConverter/Server.cpp @@ -50,7 +50,7 @@ public: int run(int, char**, const Ice::CommunicatorPtr& communicator) { - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010:udp -p 12010"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0) + ":udp"); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); adapter->add(ICE_MAKE_SHARED(MyObjectI), communicator->stringToIdentity("test")); adapter->activate(); diff --git a/cpp/test/Ice/stringConverter/run.py b/cpp/test/Ice/stringConverter/run.py index ce8c5dd4b18..c1eec8b731d 100755 --- a/cpp/test/Ice/stringConverter/run.py +++ b/cpp/test/Ice/stringConverter/run.py @@ -20,4 +20,5 @@ if len(path) == 0: sys.path.append(os.path.join(path[0], "scripts")) import TestUtil -TestUtil.clientServerTest() +TestUtil.queueClientServerTest() +TestUtil.runQueuedTests() diff --git a/cpp/test/Ice/threadPoolPriority/AllTests.cpp b/cpp/test/Ice/threadPoolPriority/AllTests.cpp index f610fec2a21..d7750250cbf 100644 --- a/cpp/test/Ice/threadPoolPriority/AllTests.cpp +++ b/cpp/test/Ice/threadPoolPriority/AllTests.cpp @@ -19,7 +19,7 @@ Test::PriorityPrxPtr allTests(const Ice::CommunicatorPtr& communicator) { cout << "testing server priority... " << flush; - string ref = "test:default -p 12010 -t 10000"; + string ref = "test:" + getTestEndpoint(communicator, 0) + " -t 10000"; Ice::ObjectPrxPtr base = communicator->stringToProxy(ref); test(base); diff --git a/cpp/test/Ice/threadPoolPriority/Makefile b/cpp/test/Ice/threadPoolPriority/Makefile index 0043c4a323a..d8f3369fc55 100644 --- a/cpp/test/Ice/threadPoolPriority/Makefile +++ b/cpp/test/Ice/threadPoolPriority/Makefile @@ -37,14 +37,16 @@ include $(top_srcdir)/config/Make.rules CPPFLAGS := -I. -I../../include $(CPPFLAGS) +LINKWITH := -lTestCommon $(LIBS) + $(CLIENT): $(COBJS) rm -f $@ - $(call mktest,$@,$(COBJS),$(LIBS)) + $(call mktest,$@,$(COBJS),$(LINKWITH)) $(SERVER): $(SOBJS) rm -f $@ - $(call mktest,$@,$(SOBJS),$(LIBS)) + $(call mktest,$@,$(SOBJS),$(LINKWITH)) $(SERVERCUSTOM): $(SCOBJS) rm -f $@ - $(call mktest,$@,$(SCOBJS),$(LIBS)) + $(call mktest,$@,$(SCOBJS),$(LINKWITH)) diff --git a/cpp/test/Ice/threadPoolPriority/Makefile.mak b/cpp/test/Ice/threadPoolPriority/Makefile.mak index c7251b62f0d..2d6868798c8 100644 --- a/cpp/test/Ice/threadPoolPriority/Makefile.mak +++ b/cpp/test/Ice/threadPoolPriority/Makefile.mak @@ -36,6 +36,7 @@ OBJS = $(COBJS) \ !include $(top_srcdir)/config/Make.rules.mak CPPFLAGS = -I. -I../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN +LINKWITH = testcommon$(LIBSUFFIX).lib $(LIBS) !if "$(GENERATE_PDB)" == "yes" CPDBFLAGS = /pdb:$(CLIENT:.exe=.pdb) @@ -44,17 +45,17 @@ SCPDBFLAGS = /pdb:$(SERVERCUSTOM:.exe=.pdb) !endif $(CLIENT): $(COBJS) - $(LINK) $(LD_EXEFLAGS) $(CPDBFLAGS) $(SETARGV) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_EXEFLAGS) $(CPDBFLAGS) $(SETARGV) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(SERVER): $(SOBJS) - $(LINK) $(LD_EXEFLAGS) $(SPDBFLAGS) $(SETARGV) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_EXEFLAGS) $(SPDBFLAGS) $(SETARGV) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(SERVERCUSTOM): $(SCOBJS) - $(LINK) $(LD_EXEFLAGS) $(SCPDBFLAGS) $(SETARGV) $(SCOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_EXEFLAGS) $(SCPDBFLAGS) $(SETARGV) $(SCOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest diff --git a/cpp/test/Ice/threadPoolPriority/Server.cpp b/cpp/test/Ice/threadPoolPriority/Server.cpp index 99bade06865..4986a1a2834 100644 --- a/cpp/test/Ice/threadPoolPriority/Server.cpp +++ b/cpp/test/Ice/threadPoolPriority/Server.cpp @@ -17,7 +17,8 @@ int run(int, char**, const Ice::CommunicatorPtr& communicator) { Ice::PropertiesPtr properties = communicator->getProperties(); - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010 -t 10000:udp"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", + getTestEndpoint(communicator, 0) + " -t 10000:udp"); // // First try to use an invalid priority. diff --git a/cpp/test/Ice/threadPoolPriority/ServerCustomThreadPool.cpp b/cpp/test/Ice/threadPoolPriority/ServerCustomThreadPool.cpp index 09712e14add..fc355d75d0d 100644 --- a/cpp/test/Ice/threadPoolPriority/ServerCustomThreadPool.cpp +++ b/cpp/test/Ice/threadPoolPriority/ServerCustomThreadPool.cpp @@ -18,7 +18,8 @@ run(int, char**, const Ice::CommunicatorPtr& communicator) { Ice::PropertiesPtr properties = communicator->getProperties(); properties->setProperty("Ice.Warn.Dispatch", "0"); - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010 -t 10000:udp"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", + getTestEndpoint(communicator, 0) + " -t 10000:udp"); communicator->getProperties()->setProperty("TestAdapter.ThreadPool.Size", "1"); // diff --git a/cpp/test/Ice/threadPoolPriority/run.py b/cpp/test/Ice/threadPoolPriority/run.py index 67a56bb220d..4a6cdf89445 100755 --- a/cpp/test/Ice/threadPoolPriority/run.py +++ b/cpp/test/Ice/threadPoolPriority/run.py @@ -20,7 +20,7 @@ if len(path) == 0: sys.path.append(os.path.join(path[0], "scripts")) import TestUtil -print("tests default server thread pool.") -TestUtil.clientServerTest() -print("tests custom server thread pool.") -TestUtil.clientServerTest(server = "servercustom") +TestUtil.queueClientServerTest(message = "Running test with default server thread pool.") +TestUtil.queueClientServerTest(configName = "custom", message = "Running test with custom server thread pool.", + server = "servercustom") +TestUtil.runQueuedTests() diff --git a/cpp/test/Ice/timeout/AllTests.cpp b/cpp/test/Ice/timeout/AllTests.cpp index 3d46840742d..7bfaa76b00f 100644 --- a/cpp/test/Ice/timeout/AllTests.cpp +++ b/cpp/test/Ice/timeout/AllTests.cpp @@ -83,7 +83,7 @@ typedef IceUtil::Handle<Callback> CallbackPtr; TimeoutPrxPtr allTests(const Ice::CommunicatorPtr& communicator) { - string sref = "timeout:default -p 12010"; + string sref = "timeout:" + getTestEndpoint(communicator, 0); Ice::ObjectPrxPtr obj = communicator->stringToProxy(sref); test(obj); diff --git a/cpp/test/Ice/timeout/Makefile b/cpp/test/Ice/timeout/Makefile index 8645ffcfafe..06612cb534b 100644 --- a/cpp/test/Ice/timeout/Makefile +++ b/cpp/test/Ice/timeout/Makefile @@ -32,10 +32,12 @@ include $(top_srcdir)/config/Make.rules CPPFLAGS := -I. -I../../include $(CPPFLAGS) +LINKWITH := -lTestCommon $(LIBS) + $(CLIENT): $(COBJS) rm -f $@ - $(call mktest,$@,$(COBJS),$(LIBS)) + $(call mktest,$@,$(COBJS),$(LINKWITH)) $(SERVER): $(SOBJS) rm -f $@ - $(call mktest,$@,$(SOBJS),$(LIBS)) + $(call mktest,$@,$(SOBJS),$(LINKWITH)) diff --git a/cpp/test/Ice/timeout/Makefile.mak b/cpp/test/Ice/timeout/Makefile.mak index ed6be9201ec..12f159ea365 100644 --- a/cpp/test/Ice/timeout/Makefile.mak +++ b/cpp/test/Ice/timeout/Makefile.mak @@ -41,6 +41,7 @@ OBJS = $(COBJS) \ !include $(top_srcdir)/config/Make.rules.mak CPPFLAGS = -I. -I../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN +LINKWITH = testcommon$(LIBSUFFIX).lib $(LIBS) !if "$(GENERATE_PDB)" == "yes" CPDBFLAGS = /pdb:$(CLIENT).pdb @@ -48,12 +49,12 @@ SPDBFLAGS = /pdb:$(SERVER).pdb !endif $(CLIENT)$(EXT): $(COBJS) - $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest $(SERVER)$(EXT): $(SOBJS) - $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS) + $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LINKWITH) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest diff --git a/cpp/test/Ice/timeout/Server.cpp b/cpp/test/Ice/timeout/Server.cpp index ba693d08d39..a5b6e8c8d77 100644 --- a/cpp/test/Ice/timeout/Server.cpp +++ b/cpp/test/Ice/timeout/Server.cpp @@ -18,7 +18,7 @@ using namespace std; int run(int, char**, const Ice::CommunicatorPtr& communicator) { - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010:udp"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0) + ":udp"); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); Ice::ObjectPtr object = ICE_MAKE_SHARED(TimeoutI); adapter->add(object, communicator->stringToIdentity("timeout")); diff --git a/cpp/test/Ice/timeout/run.py b/cpp/test/Ice/timeout/run.py index ce8c5dd4b18..c1eec8b731d 100755 --- a/cpp/test/Ice/timeout/run.py +++ b/cpp/test/Ice/timeout/run.py @@ -20,4 +20,5 @@ if len(path) == 0: sys.path.append(os.path.join(path[0], "scripts")) import TestUtil -TestUtil.clientServerTest() +TestUtil.queueClientServerTest() +TestUtil.runQueuedTests() diff --git a/cpp/test/Makefile b/cpp/test/Makefile index ae9994a3c45..791d209ab7a 100644 --- a/cpp/test/Makefile +++ b/cpp/test/Makefile @@ -17,7 +17,8 @@ SUBDIRS = IceUtil \ else -SUBDIRS = IceUtil \ +SUBDIRS = Common \ + IceUtil \ Slice \ Ice \ IceSSL \ diff --git a/cpp/test/Makefile.mak b/cpp/test/Makefile.mak index 650f43b2528..ace4d3a2953 100644 --- a/cpp/test/Makefile.mak +++ b/cpp/test/Makefile.mak @@ -13,7 +13,8 @@ top_srcdir = .. !if "$(WINRT)" == "yes" -SUBDIRS = Ice +SUBDIRS = Common \ + Ice !elseif "$(CPP11_MAPPING)" == "yes" SUBDIRS = IceUtil \ @@ -22,12 +23,14 @@ SUBDIRS = IceUtil \ !elseif "$(CPP_COMPILER)" == "VC100" SUBDIRS = IceUtil \ Slice \ + Common \ Ice \ IceSSL \ IceDiscovery !else SUBDIRS = IceUtil \ Slice \ + Common \ Ice \ IceSSL \ Glacier2 \ diff --git a/cpp/test/TestSuite/Controller.ice b/cpp/test/TestSuite/Controller.ice index 7e4c2b95eda..5178df68660 100644 --- a/cpp/test/TestSuite/Controller.ice +++ b/cpp/test/TestSuite/Controller.ice @@ -29,7 +29,8 @@ sequence<string> StringSeq; interface Controller { - Server* runServer(string lang, string name, string protocol, string host, bool winrt, StringSeq options); + Server* runServer(string lang, string name, string protocol, string host, bool winrt, string configName, + StringSeq options); }; }; diff --git a/cpp/test/TestSuite/MainPage.xaml.cpp b/cpp/test/TestSuite/MainPage.xaml.cpp index cabd8733ad2..13ae68006a6 100755 --- a/cpp/test/TestSuite/MainPage.xaml.cpp +++ b/cpp/test/TestSuite/MainPage.xaml.cpp @@ -98,10 +98,10 @@ static const string noIPv6[] = }; void -addConfiguration(const TestCasePtr& test, const string& name, const vector<string>& options = vector<string>(), - const vector<string>& languages = vector<string>()) +addConfiguration(const TestCasePtr& test, const string& desc, const string& configName, bool localOnly, + const vector<string>& options = vector<string>(), const vector<string>& languages = vector<string>()) { - TestConfigurationPtr configuration(new TestConfiguration(name, options, languages)); + TestConfigurationPtr configuration(new TestConfiguration(desc, configName, localOnly, options, languages)); test->configurations.push_back(configuration); } @@ -125,12 +125,12 @@ vector<TestCasePtr> allTest(bool remoteserver) all.push_back(test); test.reset(new TestCase("Ice", "exceptions", "client.dll", "server.dll", "serveramd.dll", "collocated.dll")); - addConfiguration(test, "compact (default) format"); - addConfiguration(test, "sliced format", { "--Ice.Default.SlicedFormat" }); - addConfiguration(test, "1.0 encoding", { "--Ice.Default.EncodingVersion=1.0" }); - addConfiguration(test, "compact (default) format and AMD server"); - addConfiguration(test, "sliced format and AMD server", { "--Ice.Default.SlicedFormat" }); - addConfiguration(test, "1.0 encoding and AMD server", { "--Ice.Default.EncodingVersion=1.0" }); + addConfiguration(test, "compact (default) format", "compact"); + addConfiguration(test, "sliced format", "sliced", false, { "--Ice.Default.SlicedFormat" }); + addConfiguration(test, "1.0 encoding", "1.0", false, { "--Ice.Default.EncodingVersion=1.0" }); + addConfiguration(test, "compact (default) format and AMD server", "", true); + addConfiguration(test, "sliced format and AMD server", "", true, { "--Ice.Default.SlicedFormat" }); + addConfiguration(test, "1.0 encoding and AMD server", "", true, { "--Ice.Default.EncodingVersion=1.0" }); all.push_back(test); test.reset(new TestCase("Ice", "facets", "client.dll", "server.dll", "", "collocated.dll")); @@ -146,31 +146,31 @@ vector<TestCasePtr> allTest(bool remoteserver) all.push_back(test); test.reset(new TestCase("Ice", "invoke", "client.dll", "server.dll")); - addConfiguration(test, "Blobject server", {}, { "cpp", "java", "csharp" }); - addConfiguration(test, "BlobjectArray server", {}, { "cpp" }); - addConfiguration(test, "BlobjectAsync server", {}, { "cpp", "java", "csharp" }); - addConfiguration(test, "BlobjectAsyncArray server", {}, { "cpp" }); + addConfiguration(test, "Blobject server", "blobject", false, {}, { "cpp", "java", "csharp" }); + addConfiguration(test, "BlobjectArray server", "blobjectArray", false, {}, { "cpp" }); + addConfiguration(test, "BlobjectAsync server", "blobjectAsync", false, {}, { "cpp", "java", "csharp" }); + addConfiguration(test, "BlobjectAsyncArray server", "blobjectAsyncArray", false, {}, { "cpp" }); all.push_back(test); test.reset(new TestCase("Ice", "location", "client.dll", "server.dll")); all.push_back(test); test.reset(new TestCase("Ice", "objects", "client.dll", "server.dll", "", "collocated.dll")); - addConfiguration(test, "compact (default) format"); - addConfiguration(test, "sliced format", { "--Ice.Default.SlicedFormat" }); - addConfiguration(test, "1.0 encoding", { "--Ice.Default.EncodingVersion=1.0" }); + addConfiguration(test, "compact (default) format", "compact"); + addConfiguration(test, "sliced format", "sliced", false, { "--Ice.Default.SlicedFormat" }); + addConfiguration(test, "1.0 encoding", "1.0", false, { "--Ice.Default.EncodingVersion=1.0" }); all.push_back(test); test.reset(new TestCase("Ice", "operations", "client.dll", "server.dll", "serveramd.dll", "collocated.dll")); addConfiguration(test, "regular server"); - addConfiguration(test, "AMD server"); - addConfiguration(test, "TIE server", {}, {"java", "csharp"}); - addConfiguration(test, "AMD TIE server", {}, { "java", "csharp" }); + addConfiguration(test, "AMD server", "", true); + addConfiguration(test, "TIE server", "", true, {}, {"java", "csharp"}); + addConfiguration(test, "AMD TIE server", "", true, {}, { "java", "csharp" }); all.push_back(test); test.reset(new TestCase("Ice", "proxy", "client.dll", "server.dll", "serveramd.dll", "collocated.dll")); addConfiguration(test, "regular server"); - addConfiguration(test, "AMD server"); + addConfiguration(test, "AMD server", "", true); all.push_back(test); test.reset(new TestCase("Ice", "retry", "client.dll", "server.dll")); @@ -201,17 +201,17 @@ vector<TestCasePtr> allTest(bool remoteserver) } test.reset(new TestCase("Ice", "optional", "client.dll", "server.dll")); - addConfiguration(test, "compact (default) format"); - addConfiguration(test, "sliced format", { "--Ice.Default.SlicedFormat" }); - addConfiguration(test, "AMD server"); + addConfiguration(test, "compact (default) format", "compact"); + addConfiguration(test, "sliced format", "sliced", false, { "--Ice.Default.SlicedFormat" }); + addConfiguration(test, "AMD server", "", true); all.push_back(test); test.reset(new TestCase("Ice", "admin", "client.dll", "server.dll")); all.push_back(test); test.reset(new TestCase("Ice", "enums", "client.dll", "server.dll")); - addConfiguration(test, "1.0 encoding", { "--Ice.Default.EncodingVersion=1.0" }); - addConfiguration(test, "1.1 encoding"); + addConfiguration(test, "1.0 encoding", "1.0", false, { "--Ice.Default.EncodingVersion=1.0" }); + addConfiguration(test, "1.1 encoding", "1.1"); all.push_back(test); @@ -225,7 +225,7 @@ class Runnable : public IceUtil::Thread, public Test::MainHelper { public: - Runnable(const TestRunnerPtr&, const string&, DllCache&, const TestConfig&, + Runnable(const TestRunnerPtr&, const string&, DllCache&, const TestConfig&, const vector<string>& options = vector<string>()); virtual ~Runnable(); @@ -243,7 +243,7 @@ private: void completed(int); IceUtil::Monitor<IceUtil::Mutex> _monitor; - TestRunnerPtr _runner; + TestRunnerPtr _runner; string _test; TestConfig _config; bool _started; @@ -261,14 +261,14 @@ class TestRunner : public IceUtil::Thread public: TestRunner(const std::shared_ptr<TestCase>&, const TestConfig&, MainPage^, - const Ice::CommunicatorPtr&, DllCache&); + const Ice::CommunicatorPtr&, DllCache&); virtual void run(); void runClientServerTest(const string&, const string&); void runClientServerTestWithRemoteServer(const string&); void runClientTest(const string&, bool); - void printToConsoleOutput(const std::string&); - void printLineToConsoleOutput(const std::string&); + void printToConsoleOutput(const std::string&); + void printLineToConsoleOutput(const std::string&); private: @@ -281,7 +281,7 @@ private: Runnable::Runnable(const TestRunnerPtr& runner, const string& test, DllCache& dlls, const TestConfig& config, const vector<string>& options) : - _runner(runner), + _runner(runner), _test(test), _config(config), _started(false), @@ -299,7 +299,7 @@ Runnable::~Runnable() void Runnable::run() { - HINSTANCE hnd = _dlls.loadDll(_test); + HINSTANCE hnd = _dlls.loadDll(_test); if(hnd == 0) { ostringstream os; @@ -312,7 +312,7 @@ Runnable::run() _dllTestShutdown = GetProcAddress(hnd, "dllTestShutdown"); if(_dllTestShutdown == 0) { - _runner->printLineToConsoleOutput("failed to find dllTestShutdown function from `" + _test + "'"); + _runner->printLineToConsoleOutput("failed to find dllTestShutdown function from `" + _test + "'"); completed(-1); return; } @@ -320,7 +320,7 @@ Runnable::run() FARPROC dllMain = GetProcAddress(hnd, "dllMain"); if(dllMain == 0) { - _runner->printLineToConsoleOutput("failed to find dllMain function from `" + _test + "'"); + _runner->printLineToConsoleOutput("failed to find dllMain function from `" + _test + "'"); completed(-1); return; } @@ -352,7 +352,7 @@ Runnable::run() { args.push_back("--Ice.ThreadPool.Server.Size=1"); args.push_back("--Ice.ThreadPool.Server.SizeMax=3"); - args.push_back("--Ice.ThreadPool.Server.SizeWarn=0"); + args.push_back("--Ice.ThreadPool.Server.SizeWarn=0"); } args.push_back("--Ice.Default.Host=" + _config.host); @@ -445,7 +445,7 @@ Runnable::redirect() void Runnable::print(const string& message) { - _runner->printToConsoleOutput(message); + _runner->printToConsoleOutput(message); } int @@ -465,7 +465,7 @@ Runnable::completed(int status) } TestRunner::TestRunner(const TestCasePtr& test, const TestConfig& config, MainPage^ page, - const Ice::CommunicatorPtr& communicator, DllCache& dlls) : + const Ice::CommunicatorPtr& communicator, DllCache& dlls) : _test(test), _config(config), _page(page), @@ -477,26 +477,26 @@ TestRunner::TestRunner(const TestCasePtr& test, const TestConfig& config, MainPa void TestRunner::printToConsoleOutput(const std::string& message) { - vector<string> lines; - string::size_type pos = 0; - string data = message; - while((pos = data.find("\n")) != string::npos) - { - lines.push_back(data.substr(0, pos)); - data = data.substr(pos + 1); - } - lines.push_back(data); - - for(vector<string>::const_iterator i = lines.begin(); i != lines.end(); ++i) - { - _page->printToConsoleOutput(ref new String(IceUtil::stringToWstring(*i).c_str()), i != lines.begin()); - } + vector<string> lines; + string::size_type pos = 0; + string data = message; + while((pos = data.find("\n")) != string::npos) + { + lines.push_back(data.substr(0, pos)); + data = data.substr(pos + 1); + } + lines.push_back(data); + + for(vector<string>::const_iterator i = lines.begin(); i != lines.end(); ++i) + { + _page->printToConsoleOutput(ref new String(IceUtil::stringToWstring(*i).c_str()), i != lines.begin()); + } } void TestRunner::printLineToConsoleOutput(const std::string& msg) { - printToConsoleOutput(msg + '\n'); + printToConsoleOutput(msg + '\n'); } void @@ -563,10 +563,10 @@ TestRunner::run() { _page->failed(ex->Message); } - catch (Test::Common::ServerFailedException& ex) - { - _page->failed(ref new String(IceUtil::stringToWstring("Server failed to start:\n\n" + ex.reason).c_str())); - } + catch (Test::Common::ServerFailedException& ex) + { + _page->failed(ref new String(IceUtil::stringToWstring("Server failed to start:\n\n" + ex.reason).c_str())); + } catch(const std::exception& ex) { _page->failed(ref new String(IceUtil::stringToWstring(ex.what()).c_str())); @@ -594,7 +594,7 @@ TestRunner::runClientServerTest(const string& server, const string& client) TestConfig cltConfig = _config; cltConfig.type = TestConfigTypeClient; - RunnablePtr clientRunable = new Runnable(this, _test->prefix + client, _dlls, cltConfig); + RunnablePtr clientRunable = new Runnable(this, _test->prefix + client, _dlls, cltConfig); clientRunable->start(); clientRunable->getThreadControl().detach(); @@ -645,7 +645,6 @@ createProxy(const string id, TestConfig config) void TestRunner::runClientServerTestWithRemoteServer(const string& client) { - RunnablePtr serverRunable; ControllerPrx controller = ControllerPrx::uncheckedCast( _communicator->stringToProxy(createProxy("controller", _config))); StringSeq options; @@ -666,12 +665,6 @@ TestRunner::runClientServerTestWithRemoteServer(const string& client) options.push_back("Ice.IPv6=0"); } - ServerPrx server = - controller->runServer(_config.server, _test->name, _config.protocol, _config.host, true, options); - - server = ServerPrx::uncheckedCast( - _communicator->stringToProxy(createProxy(server->ice_getIdentity().name, _config))); - vector<TestConfigurationPtr> configurations; if(_test->configurations.empty()) { @@ -683,10 +676,10 @@ TestRunner::runClientServerTestWithRemoteServer(const string& client) configurations = _test->configurations; } - for(vector<TestConfigurationPtr>::const_iterator i = configurations.begin(); - i != configurations.end(); ++i) + for(vector<TestConfigurationPtr>::const_iterator i = configurations.begin(); i != configurations.end(); ++i) { TestConfigurationPtr configuration = *i; + if(!configuration->languages.empty() && find(configuration->languages.begin(), configuration->languages.end(), _config.server) == configuration->languages.end()) @@ -694,13 +687,27 @@ TestRunner::runClientServerTestWithRemoteServer(const string& client) continue; } - printLineToConsoleOutput("*** Running test with " + - (configuration->name.empty() ? "regular server" : configuration->name)); + const string desc = configuration->desc.empty() ? "default configuration" : configuration->desc; + + if(configuration->localOnly) + { + printLineToConsoleOutput("*** Skipping remote test with " + desc); + continue; + } + + RunnablePtr serverRunable; + ServerPrx server = controller->runServer(_config.server, _test->name, _config.protocol, _config.host, true, + configuration->configName, options); + + server = ServerPrx::uncheckedCast( + _communicator->stringToProxy(createProxy(server->ice_getIdentity().name, _config))); + + printLineToConsoleOutput("*** Running test with " + desc); server->waitForServer(); TestConfig cltConfig = _config; cltConfig.type = TestConfigTypeClient; - RunnablePtr runnable = new Runnable(this, _test->prefix + client, _dlls, cltConfig, configuration->options); + RunnablePtr runnable = new Runnable(this, _test->prefix + client, _dlls, cltConfig, configuration->options); runnable->start(); runnable->getThreadControl().detach(); @@ -730,7 +737,7 @@ TestRunner::runClientTest(const string& client, bool collocated) { TestConfig cltConfig = _config; cltConfig.type = collocated ? TestConfigTypeColloc : TestConfigTypeClient; - RunnablePtr clientRunable = new Runnable(this, _test->prefix + client, _dlls, cltConfig); + RunnablePtr clientRunable = new Runnable(this, _test->prefix + client, _dlls, cltConfig); clientRunable->start(); clientRunable->getThreadControl().detach(); clientRunable->waitForCompleted(); @@ -738,9 +745,11 @@ TestRunner::runClientTest(const string& client, bool collocated) } -TestConfiguration::TestConfiguration(const string& name, const vector<string>& options, - const vector<string>& languages) : - name(name), +TestConfiguration::TestConfiguration(const string& desc, const string& configName, bool localOnly, + const vector<string>& options, const vector<string>& languages) : + desc(desc), + configName(configName), + localOnly(localOnly), options(options), languages(languages) { @@ -818,7 +827,7 @@ MainPage::Configuration_Loaded(Platform::Object^ sender, Windows::UI::Xaml::Rout _ipv6 = findChild<CheckBox>(this, "IPv6"); _run = findChild<Button>(this, "Run"); _stop = findChild<Button>(this, "Stop"); - _stop->IsEnabled = false; + _stop->IsEnabled = false; initializeSupportedProtocols(); initializeSupportedTests(); @@ -833,9 +842,9 @@ MainPage::OnNavigatedTo(NavigationEventArgs^ e) void MainPage::failed(String^ msg) { - printToConsoleOutput(ref new String(L"Test failed"), false); - printToConsoleOutput(msg, true); - completed(); + printToConsoleOutput(ref new String(L"Test failed"), false); + printToConsoleOutput(msg, true); + completed(); } void @@ -999,27 +1008,27 @@ TestSuite::MainPage::Language_SelectionChanged(Platform::Object^ sender, Selecti void TestSuite::MainPage::printToConsoleOutput(String^ message, bool newline) { - _output->Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler( - [=]() - { - if(newline) - { - _messages->Append(ref new String(L"")); - } - - if(_messages->Size > 0) - { - String^ item = _messages->GetAt(_messages->Size - 1); - wstring s(item->Data()); - s += wstring(message->Data()); - _messages->SetAt(_messages->Size - 1, ref new String(s.c_str())); - } - else - { - _messages->Append(message); - } - - _output->SelectedIndex = _messages->Size - 1; - _output->ScrollIntoView(_output->SelectedItem); - }, CallbackContext::Any)); + _output->Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler( + [=]() + { + if(newline) + { + _messages->Append(ref new String(L"")); + } + + if(_messages->Size > 0) + { + String^ item = _messages->GetAt(_messages->Size - 1); + wstring s(item->Data()); + s += wstring(message->Data()); + _messages->SetAt(_messages->Size - 1, ref new String(s.c_str())); + } + else + { + _messages->Append(message); + } + + _output->SelectedIndex = _messages->Size - 1; + _output->ScrollIntoView(_output->SelectedItem); + }, CallbackContext::Any)); } diff --git a/cpp/test/TestSuite/MainPage.xaml.h b/cpp/test/TestSuite/MainPage.xaml.h index c9106044271..fc113d87f9f 100644 --- a/cpp/test/TestSuite/MainPage.xaml.h +++ b/cpp/test/TestSuite/MainPage.xaml.h @@ -21,11 +21,15 @@ namespace TestSuite struct TestConfiguration { - TestConfiguration(const std::string& name = "", + TestConfiguration(const std::string& desc = "", + const std::string& configName = "", + bool localOnly = false, const std::vector<std::string>& options = std::vector<std::string>(), const std::vector<std::string>& languages = std::vector<std::string>()); - const std::string name; + const std::string desc; + const std::string configName; + const bool localOnly; const std::vector<std::string> options; const std::vector<std::string> languages; }; diff --git a/cpp/test/include/.gitignore b/cpp/test/include/.gitignore new file mode 100644 index 00000000000..05cdd03c294 --- /dev/null +++ b/cpp/test/include/.gitignore @@ -0,0 +1,4 @@ +// Generated by makegitignore.py + +// IMPORTANT: Do not edit this file -- any edits made here will be lost! +Controller.h diff --git a/cpp/test/include/TestCommon.h b/cpp/test/include/TestCommon.h index 1a6261ee080..d5b2585c627 100644 --- a/cpp/test/include/TestCommon.h +++ b/cpp/test/include/TestCommon.h @@ -10,7 +10,8 @@ #ifndef TEST_COMMON_H #define TEST_COMMON_H -#include <IceUtil/IceUtil.h> +#include <Ice/CommunicatorF.h> +#include <Ice/ProxyF.h> #ifdef ICE_CPP11_MAPPING # define ICE_IN(T) T @@ -24,6 +25,18 @@ # include <Ice/LocalException.h> #endif +#include <IceUtil/IceUtil.h> + +#ifndef TEST_API +# ifdef TEST_API_EXPORTS +# define TEST_API ICE_DECLSPEC_EXPORT +# elif defined(ICE_STATIC_LIBS) +# define TEST_API /**/ +# else +# define TEST_API ICE_DECLSPEC_IMPORT +# endif +#endif + void inline print(const std::string& msg) { @@ -36,6 +49,24 @@ inline println(const std::string& msg) std::cout << msg << std::endl; } +TEST_API std::string getTestEndpoint(const Ice::CommunicatorPtr&, int, const std::string = std::string()); + +class TEST_API RemoteConfig +{ +public: + + RemoteConfig(const std::string&, int, char**, const Ice::CommunicatorPtr&); + ~RemoteConfig(); + + bool isRemote() const; + void finished(int); + +private: + + Ice::ObjectPrxPtr _server; + int _status; +}; + #if !defined(ICE_OS_WINRT) && (TARGET_OS_IPHONE == 0) void |