summaryrefslogtreecommitdiff
path: root/cpp/test
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2012-10-15 19:08:37 +0200
committerJose <jose@zeroc.com>2012-10-15 19:08:37 +0200
commitb686c08672e2ff3880bfc41c556c8107d16bd0ca (patch)
treeb09ffac533f008b292443a14cff909d0c9acfda5 /cpp/test
parentFixed Windows build (diff)
downloadice-b686c08672e2ff3880bfc41c556c8107d16bd0ca.tar.bz2
ice-b686c08672e2ff3880bfc41c556c8107d16bd0ca.tar.xz
ice-b686c08672e2ff3880bfc41c556c8107d16bd0ca.zip
WinRT fixes
Diffstat (limited to 'cpp/test')
-rw-r--r--cpp/test/Ice/Makefile.mak8
-rw-r--r--cpp/test/Ice/metrics/AllTests.cpp10
-rw-r--r--cpp/test/Ice/optional/Client.cpp2
-rw-r--r--cpp/test/Ice/optional/Makefile.mak32
-rw-r--r--cpp/test/Ice/optional/Server.cpp4
-rw-r--r--cpp/test/Ice/timeout/TestI.cpp3
-rw-r--r--cpp/test/WinRT/TestSuite/MainPage.xaml.cpp13
-rw-r--r--cpp/test/WinRT/TestSuite/MainPage.xaml.h3
-rw-r--r--cpp/test/WinRT/TestSuite/TestSuite.vcxproj25
-rw-r--r--cpp/test/WinRT/TestSuite/TestSuite.vcxproj.filters21
10 files changed, 98 insertions, 23 deletions
diff --git a/cpp/test/Ice/Makefile.mak b/cpp/test/Ice/Makefile.mak
index db9800af705..4965e966b13 100644
--- a/cpp/test/Ice/Makefile.mak
+++ b/cpp/test/Ice/Makefile.mak
@@ -32,7 +32,8 @@ SUBDIRS = proxy \
admin \
plugin \
stream \
- metrics
+ metrics \
+ optional
!if "$(WINRT)" != "yes"
SUBDIRS = $(SUBDIRS) \
@@ -48,10 +49,9 @@ SUBDIRS = $(SUBDIRS) \
servantLocator \
defaultServant \
interceptor \
- defaultValue \
- optional
+ defaultValue
!endif
-
+
$(EVERYTHING)::
@for %i in ( $(SUBDIRS) ) do \
diff --git a/cpp/test/Ice/metrics/AllTests.cpp b/cpp/test/Ice/metrics/AllTests.cpp
index 14f28b19b5e..5d10f2b4e0b 100644
--- a/cpp/test/Ice/metrics/AllTests.cpp
+++ b/cpp/test/Ice/metrics/AllTests.cpp
@@ -390,10 +390,16 @@ allTests(const Ice::CommunicatorPtr& communicator)
props["IceMX.Metrics.View.GroupBy"] = "none";
updateProps(clientProps, serverProps, update, props);
+#ifdef ICE_OS_WINRT
+ int threadCount = 4;
+#else
+ int threadCount = 3;
+#endif
+
Ice::Long timestamp;
IceMX::MetricsView view = clientMetrics->getMetricsView("View", timestamp);
test(view["Connection"].size() == 1 && view["Connection"][0]->current == 1 && view["Connection"][0]->total == 1);
- test(view["Thread"].size() == 1 && view["Thread"][0]->current == 4 && view["Thread"][0]->total == 4);
+ test(view["Thread"].size() == 1 && view["Thread"][0]->current == threadCount && view["Thread"][0]->total == threadCount);
cout << "ok" << endl;
cout << "testing group by id..." << flush;
@@ -408,7 +414,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
metrics->ice_connectionId("Con1")->ice_ping();
view = clientMetrics->getMetricsView("View", timestamp);
- test(view["Thread"].size() == 4);
+ test(view["Thread"].size() == threadCount);
test(view["Connection"].size() == 2);
test(view["Invocation"].size() == 1);
diff --git a/cpp/test/Ice/optional/Client.cpp b/cpp/test/Ice/optional/Client.cpp
index ffb919949ef..e3240a4509d 100644
--- a/cpp/test/Ice/optional/Client.cpp
+++ b/cpp/test/Ice/optional/Client.cpp
@@ -11,6 +11,8 @@
#include <TestCommon.h>
#include <TestI.h>
+DEFINE_TEST("client")
+
using namespace std;
using namespace Test;
diff --git a/cpp/test/Ice/optional/Makefile.mak b/cpp/test/Ice/optional/Makefile.mak
index 6932beaa3e5..4d1be4f1c25 100644
--- a/cpp/test/Ice/optional/Makefile.mak
+++ b/cpp/test/Ice/optional/Makefile.mak
@@ -9,10 +9,18 @@
top_srcdir = ..\..\..
-CLIENT = client.exe
-SERVER = server.exe
+!if "$(WINRT)" != "yes"
+NAME_PREFIX =
+EXT = .exe
+!else
+NAME_PREFIX = Ice_optional_
+EXT = .dll
+!endif
+
+CLIENT = $(NAME_PREFIX)client
+SERVER = $(NAME_PREFIX)server
-TARGETS = $(CLIENT) $(SERVER)
+TARGETS = $(CLIENT)$(EXT) $(SERVER)$(EXT)
COBJS = Test.obj \
TestI.obj \
@@ -30,18 +38,24 @@ SRCS = $(COBJS:.obj=.cpp) \
CPPFLAGS = -I. -I../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN
+!if "$(WINRT)" != "yes"
+LD_TESTFLAGS = $(LD_EXEFLAGS) $(SETARGV)
+!else
+LD_TESTFLAGS = $(LD_DLLFLAGS) /export:dllMain
+!endif
+
!if "$(GENERATE_PDB)" == "yes"
-CPDBFLAGS = /pdb:$(CLIENT:.exe=.pdb)
-SPDBFLAGS = /pdb:$(SERVER:.exe=.pdb)
+CPDBFLAGS = /pdb:$(CLIENT).pdb
+SPDBFLAGS = /pdb:$(SERVER).pdb
!endif
-$(CLIENT): $(COBJS)
- $(LINK) $(LD_EXEFLAGS) $(CPDBFLAGS) $(SETARGV) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS)
+$(CLIENT)$(EXT): $(COBJS) $(OBJS)
+ $(LINK) $(LD_TESTFLAGS) $(CPDBFLAGS) $(COBJS) $(OBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS)
@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)
+$(SERVER)$(EXT): $(SOBJS) $(OBJS)
+ $(LINK) $(LD_TESTFLAGS) $(SPDBFLAGS) $(SOBJS) $(OBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS)
@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 089f0e1ce00..9945edca281 100644
--- a/cpp/test/Ice/optional/Server.cpp
+++ b/cpp/test/Ice/optional/Server.cpp
@@ -8,8 +8,11 @@
// **********************************************************************
#include <Ice/Ice.h>
+#include <TestCommon.h>
#include <TestI.h>
+DEFINE_TEST("server");
+
using namespace std;
using namespace Test;
@@ -20,6 +23,7 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter");
adapter->add(new InitialI(), communicator->stringToIdentity("initial"));
adapter->activate();
+ TEST_READY
communicator->waitForShutdown();
return EXIT_SUCCESS;
}
diff --git a/cpp/test/Ice/timeout/TestI.cpp b/cpp/test/Ice/timeout/TestI.cpp
index 49f69df816f..9d1a2eab7d8 100644
--- a/cpp/test/Ice/timeout/TestI.cpp
+++ b/cpp/test/Ice/timeout/TestI.cpp
@@ -57,7 +57,8 @@ TimeoutI::holdAdapter(Ice::Int to, const Ice::Current& current)
{
current.adapter->hold();
IceUtil::ThreadPtr thread = new ActivateAdapterThread(current.adapter, to);
- thread->start();
+ IceUtil::ThreadControl threadControl = thread->start();
+ threadControl.detach();
}
void
diff --git a/cpp/test/WinRT/TestSuite/MainPage.xaml.cpp b/cpp/test/WinRT/TestSuite/MainPage.xaml.cpp
index 93985a76a52..dcbd69e14f1 100644
--- a/cpp/test/WinRT/TestSuite/MainPage.xaml.cpp
+++ b/cpp/test/WinRT/TestSuite/MainPage.xaml.cpp
@@ -285,7 +285,6 @@ static const TestCase allTest[] =
{"Ice\\adapterDeactivation", "Ice_adapterDeactivation_", "client.dll", "server.dll", 0, "collocated.dll" },
{"Ice\\ami", "Ice_ami_", "client.dll", "server.dll", 0, 0 },
{"Ice\\binding", "Ice_binding_", "client.dll", "server.dll", 0, 0 },
-// {"Ice\\defaultValue", "Ice_defaultValue_", "client.dll", 0, 0, 0 },
{"Ice\\dispatcher", "Ice_dispatcher_", "client.dll", "server.dll", 0, 0 },
{"Ice\\exceptions", "Ice_exceptions_", "client.dll", "server.dll", "serveramd.dll", "collocated.dll" },
{"Ice\\facets", "Ice_facets_", "client.dll", "server.dll", 0, "collocated.dll" },
@@ -302,7 +301,9 @@ static const TestCase allTest[] =
{"Ice\\timeout", "Ice_timeout_", "client.dll", "server.dll", 0, 0 },
{"Ice\\udp", "Ice_udp_", "client.dll", "server.dll", 0, 0 },
{"Ice\\hash", "Ice_hash_", "client.dll", 0, 0, 0},
- {"Ice\\plugin", "Ice_plugin_", "client.dll", 0, 0, 0}
+ {"Ice\\metrics", "Ice_metrics_", "client.dll", "server.dll", "serveramd.dll", 0},
+ {"Ice\\optional", "Ice_optional_", "client.dll", "server.dll", 0, 0},
+ {"Ice\\admin", "Ice_admin_", "client.dll", "server.dll", 0, 0}
};
class TestRunner : public IceUtil::Thread
@@ -377,17 +378,18 @@ public:
serverRunable = new Runnable(_test.prefix + server, svrConfig);
serverRunable->start();
serverRunable->waitForStart();
+ serverRunable->getThreadControl().detach();
}
TestConfig cltConfig = _config;
cltConfig.type = TestConfigTypeClient;
RunnablePtr clientRunable = new Runnable(_test.prefix + client, cltConfig);
clientRunable->start();
+ clientRunable->getThreadControl().detach();
try
{
clientRunable->waitForCompleted();
- clientRunable->getThreadControl().detach();
}
catch(...)
{
@@ -395,7 +397,6 @@ public:
{
serverRunable->shutdown();
serverRunable->waitForCompleted();
- serverRunable->getThreadControl().detach();
}
throw;
}
@@ -403,7 +404,6 @@ public:
if(serverRunable)
{
serverRunable->waitForCompleted();
- serverRunable->getThreadControl().detach();
}
}
@@ -414,8 +414,8 @@ public:
cltConfig.type = collocated ? TestConfigTypeColloc : TestConfigTypeClient;
RunnablePtr clientRunable = new Runnable(_test.prefix + client, cltConfig);
clientRunable->start();
+ clientRunable->getThreadControl().detach();
clientRunable->waitForCompleted();
- clientRunable->getThreadControl().detach();
}
private:
@@ -449,6 +449,7 @@ MainPage::MainPage()
/// </summary>
/// <param name="e">Event data that describes how this page was reached. The Parameter
/// property is typically used to configure the page.</param>
+
void
MainPage::OnNavigatedTo(NavigationEventArgs^ e)
{
diff --git a/cpp/test/WinRT/TestSuite/MainPage.xaml.h b/cpp/test/WinRT/TestSuite/MainPage.xaml.h
index ee23363b5a2..a49f4b546bc 100644
--- a/cpp/test/WinRT/TestSuite/MainPage.xaml.h
+++ b/cpp/test/WinRT/TestSuite/MainPage.xaml.h
@@ -17,6 +17,7 @@ namespace TestSuite
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
+[Windows::Foundation::Metadata::WebHostHidden]
public ref class MainPage sealed
{
public:
@@ -27,7 +28,7 @@ public:
void failed(Platform::String^ reason);
protected:
-
+
virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
private:
diff --git a/cpp/test/WinRT/TestSuite/TestSuite.vcxproj b/cpp/test/WinRT/TestSuite/TestSuite.vcxproj
index ee8bd766392..6f4f090aa41 100644
--- a/cpp/test/WinRT/TestSuite/TestSuite.vcxproj
+++ b/cpp/test/WinRT/TestSuite/TestSuite.vcxproj
@@ -126,6 +126,10 @@
<PrecompiledHeaderFile />
<PrecompiledHeaderOutputFile />
</ClCompile>
+ <PostBuildEvent>
+ <Command>
+ </Command>
+ </PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
@@ -188,6 +192,12 @@
<None Include="..\..\Ice\adapterDeactivation\Ice_adapterDeactivation_server.dll">
<DeploymentContent>true</DeploymentContent>
</None>
+ <None Include="..\..\Ice\admin\Ice_admin_client.dll">
+ <DeploymentContent>true</DeploymentContent>
+ </None>
+ <None Include="..\..\Ice\admin\Ice_admin_server.dll">
+ <DeploymentContent>true</DeploymentContent>
+ </None>
<None Include="..\..\Ice\ami\Ice_ami_client.dll">
<DeploymentContent>true</DeploymentContent>
</None>
@@ -263,6 +273,15 @@
<None Include="..\..\Ice\location\Ice_location_server.dll">
<DeploymentContent>true</DeploymentContent>
</None>
+ <None Include="..\..\Ice\metrics\Ice_metrics_client.dll">
+ <DeploymentContent>true</DeploymentContent>
+ </None>
+ <None Include="..\..\Ice\metrics\Ice_metrics_server.dll">
+ <DeploymentContent>true</DeploymentContent>
+ </None>
+ <None Include="..\..\Ice\metrics\Ice_metrics_serveramd.dll">
+ <DeploymentContent>true</DeploymentContent>
+ </None>
<None Include="..\..\Ice\objects\Ice_objects_client.dll">
<DeploymentContent>true</DeploymentContent>
</None>
@@ -284,6 +303,12 @@
<None Include="..\..\Ice\operations\Ice_operations_serveramd.dll">
<DeploymentContent>true</DeploymentContent>
</None>
+ <None Include="..\..\Ice\optional\Ice_optional_client.dll">
+ <DeploymentContent>true</DeploymentContent>
+ </None>
+ <None Include="..\..\Ice\optional\Ice_optional_server.dll">
+ <DeploymentContent>true</DeploymentContent>
+ </None>
<None Include="..\..\Ice\proxy\Ice_proxy_client.dll">
<DeploymentContent>true</DeploymentContent>
</None>
diff --git a/cpp/test/WinRT/TestSuite/TestSuite.vcxproj.filters b/cpp/test/WinRT/TestSuite/TestSuite.vcxproj.filters
index 05791395699..e01e377f8c6 100644
--- a/cpp/test/WinRT/TestSuite/TestSuite.vcxproj.filters
+++ b/cpp/test/WinRT/TestSuite/TestSuite.vcxproj.filters
@@ -199,6 +199,27 @@
<None Include="..\..\Ice\hash\Ice_hash_client.dll">
<Filter>Tests</Filter>
</None>
+ <None Include="..\..\Ice\metrics\Ice_metrics_client.dll">
+ <Filter>Tests</Filter>
+ </None>
+ <None Include="..\..\Ice\metrics\Ice_metrics_server.dll">
+ <Filter>Tests</Filter>
+ </None>
+ <None Include="..\..\Ice\metrics\Ice_metrics_serveramd.dll">
+ <Filter>Tests</Filter>
+ </None>
+ <None Include="..\..\Ice\optional\Ice_optional_client.dll">
+ <Filter>Tests</Filter>
+ </None>
+ <None Include="..\..\Ice\optional\Ice_optional_server.dll">
+ <Filter>Tests</Filter>
+ </None>
+ <None Include="..\..\Ice\admin\Ice_admin_client.dll">
+ <Filter>Tests</Filter>
+ </None>
+ <None Include="..\..\Ice\admin\Ice_admin_server.dll">
+ <Filter>Tests</Filter>
+ </None>
</ItemGroup>
<ItemGroup>
<Page Include="MainPage.xaml" />