Skip to content

Commit 0381957

Browse files
committed
Merge branch 'development' of https://git01.codeplex.com/casablanca into quickfixes
2 parents f81701d + eb563d3 commit 0381957

File tree

8 files changed

+254
-121
lines changed

8 files changed

+254
-121
lines changed

Build_iOS/configure.sh

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
#!/bin/bash
22
set -e
33

4-
git clone https://git.gitorious.org/boostoniphone/galbraithjosephs-boostoniphone.git boostoniphone
4+
git clone https://gist.github.com/c629ae4c7168216a9856.git boostoniphone
55
pushd boostoniphone
66
git apply ../fix_boost_version.patch
77
./boost.sh
8-
pushd ios/framework/boost.framework/Versions/A
9-
mkdir Headers2
10-
mv Headers Headers2/boost
11-
mv Headers2 Headers
12-
popd
138
popd
149
mv boostoniphone/ios/framework/boost.framework .
1510

Build_iOS/fix_boost_version.patch

Lines changed: 178 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,186 @@
1-
From e5b3bf1392d3dc04f1391c4ad60118a394b5219f Mon Sep 17 00:00:00 2001
2-
From: Steve Gates <[email protected]>
3-
Date: Thu, 30 Oct 2014 17:42:43 -0700
4-
Subject: [PATCH] Fixing boost.sh to use Boost version 1.56 and iOS 8.0.
5-
6-
---
7-
boost.sh | 6 +++---
8-
1 file changed, 3 insertions(+), 3 deletions(-)
9-
101
diff --git a/boost.sh b/boost.sh
11-
index 8847aac..2a76aec 100755
2+
old mode 100644
3+
new mode 100755
4+
index 22b308c..07ef184
125
--- a/boost.sh
136
+++ b/boost.sh
14-
@@ -18,8 +18,8 @@
7+
@@ -1,4 +1,4 @@
8+
-# Builds a Boost framework for the iPhone, iPhone Simulator, and OSX.
9+
+# Builds a Boost framework for the iPhone and iPhone Simulator.
10+
# Creates a set of universal libraries that can be used on an iPhone and in the
11+
# iPhone simulator. Then creates a pseudo-framework to make using boost in Xcode
12+
# less painful.
13+
@@ -6,27 +6,21 @@
14+
# To configure the script, define:
15+
# BOOST_LIBS: which libraries to build
16+
# IPHONE_SDKVERSION: iPhone SDK version (e.g. 8.1)
17+
-# OSX_SDKVERSION: OSX SDK version (e.g. 10.10)
18+
#
19+
# Then go get the source tar.bz of the boost you want to build, shove it in the
1520
# same directory as this script, and run "./boost.sh". Grab a cuppa. And voila.
1621
#===============================================================================
1722

18-
-: ${BOOST_LIBS:="filesystem date_time system"}
19-
-: ${IPHONE_SDKVERSION:=7.0}
23+
-: ${BOOST_VERSION:=1.56.0}
24+
-: ${BOOST_VERSION2:=1_56_0}
25+
+: ${BOOST_VERSION:=1.57.0}
26+
+: ${BOOST_VERSION2:=1_57_0}
27+
28+
-: ${BOOST_LIBS:="atomic chrono date_time exception filesystem program_options random signals system test thread"}
2029
+: ${BOOST_LIBS:="thread chrono filesystem regex locale system random"}
21-
+: ${IPHONE_SDKVERSION:=8.0}
22-
: ${OSX_SDKVERSION:=10.9}
30+
31+
# Current iPhone SDK
32+
: ${IPHONE_SDKVERSION:=`xcodebuild -showsdks | grep iphoneos | egrep "[[:digit:]]+\.[[:digit:]]+" -o | tail -1`}
33+
# Specific iPhone SDK
34+
# : ${IPHONE_SDKVERSION:=8.1}
35+
36+
-# Current OSX SDK
37+
-: ${OSX_SDKVERSION:=`xcodebuild -showsdks | grep macosx | egrep "[[:digit:]]+\.[[:digit:]]+" -o | tail -1`}
38+
-# Specific OSX SDK
39+
-# : ${OSX_SDKVERSION:=10.10}
40+
-
2341
: ${XCODE_ROOT:=`xcode-select -print-path`}
24-
: ${EXTRA_CPPFLAGS:="-DBOOST_AC_USE_PTHREADS -DBOOST_SP_USE_PTHREADS -std=c++11 -stdlib=libc++"}
25-
@@ -84,7 +84,7 @@ updateBoost()
26-
then
27-
git checkout $BOOST_SRC/tools/build/v2/user-config.jam
28-
else
29-
- git clone --recursive https://github.com/boostorg/boost.git $BOOST_SRC
30-
+ git clone --recursive --branch boost-1.56.0 https://github.com/boostorg/boost.git $BOOST_SRC
31-
pushd $BOOST_SRC
32-
./bootstrap.sh
33-
./b2 headers
34-
--
35-
1.9.3 (Apple Git-50)
36-
42+
: ${EXTRA_CPPFLAGS:="-DBOOST_AC_USE_PTHREADS -DBOOST_SP_USE_PTHREADS -g -DNDEBUG -std=c++11 -stdlib=libc++"}
43+
44+
@@ -41,10 +35,8 @@
45+
: ${TARBALLDIR:=`pwd`}
46+
: ${SRCDIR:=`pwd`/src}
47+
: ${IOSBUILDDIR:=`pwd`/ios/build}
48+
-: ${OSXBUILDDIR:=`pwd`/osx/build}
49+
: ${PREFIXDIR:=`pwd`/ios/prefix}
50+
: ${IOSFRAMEWORKDIR:=`pwd`/ios/framework}
51+
-: ${OSXFRAMEWORKDIR:=`pwd`/osx/framework}
52+
53+
BOOST_TARBALL=$TARBALLDIR/boost_$BOOST_VERSION2.tar.bz2
54+
BOOST_SRC=$SRCDIR/boost_${BOOST_VERSION2}
55+
@@ -52,7 +44,6 @@ BOOST_SRC=$SRCDIR/boost_${BOOST_VERSION2}
56+
#===============================================================================
57+
ARM_DEV_CMD="xcrun --sdk iphoneos"
58+
SIM_DEV_CMD="xcrun --sdk iphonesimulator"
59+
-OSX_DEV_CMD="xcrun --sdk macosx"
60+
61+
#===============================================================================
62+
# Functions
63+
@@ -79,12 +70,10 @@ cleanEverythingReadyToStart()
64+
{
65+
echo Cleaning everything before we start to build...
66+
67+
- rm -rf iphone-build iphonesim-build osx-build
68+
+ rm -rf iphone-build iphonesim-build
69+
rm -rf $IOSBUILDDIR
70+
- rm -rf $OSXBUILDDIR
71+
rm -rf $PREFIXDIR
72+
rm -rf $IOSFRAMEWORKDIR/$FRAMEWORK_NAME.framework
73+
- rm -rf $OSXFRAMEWORKDIR/$FRAMEWORK_NAME.framework
74+
75+
doneSection
76+
}
77+
@@ -142,11 +131,6 @@ using darwin : ${IPHONE_SDKVERSION}~iphonesim
78+
: <striper> <root>$XCODE_ROOT/Platforms/iPhoneSimulator.platform/Developer
79+
: <architecture>x86 <target-os>iphone
80+
;
81+
-using darwin : ${OSX_SDKVERSION}
82+
-: g++ -arch i386 -arch x86_64 -fvisibility=hidden -fvisibility-inlines-hidden $EXTRA_CPPFLAGS
83+
-: <striper> <root>$XCODE_ROOT/Platforms/MacOSX.platform/Developer
84+
-: <architecture>x86 <target-os>darwin
85+
-;
86+
EOF
87+
88+
doneSection
89+
@@ -192,10 +176,6 @@ buildBoostForIPhoneOS()
90+
echo Building Boost for iPhoneSimulator
91+
./b2 -j16 --build-dir=iphonesim-build --stagedir=iphonesim-build/stage toolset=darwin-${IPHONE_SDKVERSION}~iphonesim architecture=x86 target-os=iphone macosx-version=iphonesim-${IPHONE_SDKVERSION} link=static stage
92+
doneSection
93+
-
94+
- echo building Boost for OSX
95+
- ./b2 -j16 --build-dir=osx-build --stagedir=osx-build/stage toolset=clang cxxflags="-std=c++11 -stdlib=libc++ -arch i386 -arch x86_64" linkflags="-stdlib=libc++" link=static threading=multi macosx-version=${OSX_SDKVERSION} stage
96+
- doneSection
97+
}
98+
99+
#===============================================================================
100+
@@ -233,10 +213,6 @@ scrunchAllLibsTogetherInOneLibPerPlatform()
101+
mkdir -p $IOSBUILDDIR/i386/obj
102+
mkdir -p $IOSBUILDDIR/x86_64/obj
103+
104+
- # OSX
105+
- mkdir -p $OSXBUILDDIR/i386/obj
106+
- mkdir -p $OSXBUILDDIR/x86_64/obj
107+
-
108+
ALL_LIBS=""
109+
110+
echo Splitting all existing fat binaries...
111+
@@ -254,9 +230,6 @@ scrunchAllLibsTogetherInOneLibPerPlatform()
112+
113+
$SIM_DEV_CMD lipo "iphonesim-build/stage/lib/libboost_$NAME.a" -thin i386 -o $IOSBUILDDIR/i386/libboost_$NAME.a
114+
$SIM_DEV_CMD lipo "iphonesim-build/stage/lib/libboost_$NAME.a" -thin x86_64 -o $IOSBUILDDIR/x86_64/libboost_$NAME.a
115+
-
116+
- $OSX_DEV_CMD lipo "osx-build/stage/lib/libboost_$NAME.a" -thin i386 -o $OSXBUILDDIR/i386/libboost_$NAME.a
117+
- $OSX_DEV_CMD lipo "osx-build/stage/lib/libboost_$NAME.a" -thin x86_64 -o $OSXBUILDDIR/x86_64/libboost_$NAME.a
118+
done
119+
120+
echo "Decomposing each architecture's .a files"
121+
@@ -273,14 +246,10 @@ scrunchAllLibsTogetherInOneLibPerPlatform()
122+
123+
unpackArchive "$IOSBUILDDIR/i386/obj" $NAME
124+
unpackArchive "$IOSBUILDDIR/x86_64/obj" $NAME
125+
-
126+
- unpackArchive "$OSXBUILDDIR/i386/obj" $NAME
127+
- unpackArchive "$OSXBUILDDIR/x86_64/obj" $NAME
128+
done
129+
130+
echo "Linking each architecture into an uberlib ($ALL_LIBS => libboost.a )"
131+
rm $IOSBUILDDIR/*/libboost.a
132+
- rm $OSXBUILDDIR/*/libboost.a
133+
134+
for NAME in $BOOST_LIBS; do
135+
if [ "$NAME" == "test" ]; then
136+
@@ -300,11 +269,6 @@ scrunchAllLibsTogetherInOneLibPerPlatform()
137+
(cd $IOSBUILDDIR/i386; $SIM_DEV_CMD ar crus libboost.a obj/$NAME/*.o; )
138+
echo ...x86_64
139+
(cd $IOSBUILDDIR/x86_64; $SIM_DEV_CMD ar crus libboost.a obj/$NAME/*.o; )
140+
-
141+
- echo ...osx-i386
142+
- (cd $OSXBUILDDIR/i386; $OSX_DEV_CMD ar crus libboost.a obj/$NAME/*.o; )
143+
- echo ...osx-x86_64
144+
- (cd $OSXBUILDDIR/x86_64; $OSX_DEV_CMD ar crus libboost.a obj/$NAME/*.o; )
145+
done
146+
}
147+
148+
@@ -333,6 +297,7 @@ buildFramework()
149+
mkdir -p $FRAMEWORK_BUNDLE/Versions/$FRAMEWORK_VERSION
150+
mkdir -p $FRAMEWORK_BUNDLE/Versions/$FRAMEWORK_VERSION/Resources
151+
mkdir -p $FRAMEWORK_BUNDLE/Versions/$FRAMEWORK_VERSION/Headers
152+
+ mkdir -p $FRAMEWORK_BUNDLE/Versions/$FRAMEWORK_VERSION/Headers/boost
153+
mkdir -p $FRAMEWORK_BUNDLE/Versions/$FRAMEWORK_VERSION/Documentation
154+
155+
echo "Framework: Creating symlinks..."
156+
@@ -348,7 +313,7 @@ buildFramework()
157+
$ARM_DEV_CMD lipo -create $BUILDDIR/*/libboost.a -o "$FRAMEWORK_INSTALL_NAME" || abort "Lipo $1 failed"
158+
159+
echo "Framework: Copying includes..."
160+
- cp -r $PREFIXDIR/include/boost/* $FRAMEWORK_BUNDLE/Headers/
161+
+ cp -r $PREFIXDIR/include/boost/* $FRAMEWORK_BUNDLE/Headers/boost
162+
163+
echo "Framework: Creating plist..."
164+
cat > $FRAMEWORK_BUNDLE/Resources/Info.plist <<EOF
165+
@@ -390,12 +355,9 @@ echo "BOOST_VERSION: $BOOST_VERSION"
166+
echo "BOOST_LIBS: $BOOST_LIBS"
167+
echo "BOOST_SRC: $BOOST_SRC"
168+
echo "IOSBUILDDIR: $IOSBUILDDIR"
169+
-echo "OSXBUILDDIR: $OSXBUILDDIR"
170+
echo "PREFIXDIR: $PREFIXDIR"
171+
echo "IOSFRAMEWORKDIR: $IOSFRAMEWORKDIR"
172+
-echo "OSXFRAMEWORKDIR: $OSXFRAMEWORKDIR"
173+
echo "IPHONE_SDKVERSION: $IPHONE_SDKVERSION"
174+
-echo "OSX_SDKVERSION: $OSX_SDKVERSION"
175+
echo "XCODE_ROOT: $XCODE_ROOT"
176+
echo
177+
178+
@@ -407,8 +369,6 @@ updateBoost
179+
buildBoostForIPhoneOS
180+
scrunchAllLibsTogetherInOneLibPerPlatform
181+
buildFramework $IOSFRAMEWORKDIR $IOSBUILDDIR
182+
-buildFramework $OSXFRAMEWORKDIR $OSXBUILDDIR
183+
-
184+
restoreBoost
185+
186+
echo "Completed successfully"

Release/tests/functional/http/client/authentication_tests.cpp

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -50,36 +50,6 @@ using namespace tests::functional::http::utilities;
5050

5151
namespace tests { namespace functional { namespace http { namespace client {
5252

53-
// helper function to check if failure is due to timeout.
54-
bool is_timeout(const std::string &msg)
55-
{
56-
if (msg.find("The operation timed out") != std::string::npos /* WinHTTP */ ||
57-
msg.find("The operation was timed out") != std::string::npos /* IXmlHttpRequest2 */)
58-
{
59-
return true;
60-
}
61-
return false;
62-
}
63-
64-
template <typename Func>
65-
void handle_timeout(const Func &f)
66-
{
67-
try
68-
{
69-
f();
70-
}
71-
catch (const http_exception &e)
72-
{
73-
if (is_timeout(e.what()))
74-
{
75-
// Since this test depends on an outside server sometimes it sporadically can fail due to timeouts
76-
// especially on our build machines.
77-
return;
78-
}
79-
throw;
80-
}
81-
}
82-
8353
SUITE(authentication_tests)
8454
{
8555

Release/tests/functional/http/client/outside_tests.cpp

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -45,36 +45,6 @@ namespace tests { namespace functional { namespace http { namespace client {
4545
SUITE(outside_tests)
4646
{
4747

48-
// helper function to check if failure is due to timeout.
49-
bool is_timeout(const std::string &msg)
50-
{
51-
if (msg.find("The operation timed out") != std::string::npos /* WinHTTP */ ||
52-
msg.find("The operation was timed out") != std::string::npos /* IXmlHttpRequest2 */)
53-
{
54-
return true;
55-
}
56-
return false;
57-
}
58-
59-
template <typename Func>
60-
void handle_timeout(const Func &f)
61-
{
62-
try
63-
{
64-
f();
65-
}
66-
catch (const http_exception &e)
67-
{
68-
if (is_timeout(e.what()))
69-
{
70-
// Since this test depends on an outside server sometimes it sporadically can fail due to timeouts
71-
// especially on our build machines.
72-
return;
73-
}
74-
throw;
75-
}
76-
}
77-
7848
TEST_FIXTURE(uri_address, outside_cnn_dot_com)
7949
{
8050
handle_timeout([]

Release/tests/functional/http/client/progress_handler_tests.cpp

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -245,20 +245,20 @@ TEST_FIXTURE(uri_address, set_progress_handler_open_failure)
245245
const size_t repeats = 5500;
246246
for (size_t i = 0; i < repeats; ++i)
247247
data.append(U("abcdefghihklmnopqrstuvwxyz"));
248-
248+
249249
utility::size64_t upsize = 4711u, downsize = 4711u;
250250
int calls = 0;
251251

252252
http_request msg(mtd);
253253
// We should never see this handler called.
254254
msg.set_progress_handler(
255-
[&](message_direction::direction direction, utility::size64_t so_far)
256-
{
255+
[&](message_direction::direction direction, utility::size64_t so_far)
256+
{
257257
calls += 1;
258-
if (direction == message_direction::upload)
259-
upsize = so_far;
260-
else
261-
downsize = so_far;
258+
if (direction == message_direction::upload)
259+
upsize = so_far;
260+
else
261+
downsize = so_far;
262262
});
263263

264264
msg.set_body(data);
@@ -406,12 +406,6 @@ TEST_FIXTURE(uri_address, data_download_exception)
406406
int numCalls = 0;
407407
msg.set_progress_handler([&](message_direction::direction, utility::size64_t)
408408
{
409-
// TODO stgates - adding some debugging information to help with hard to reproduce
410-
// sporadic failure.
411-
#if (defined(_MSC_VER) && (_MSC_VER >= 1800))
412-
printf("In progress handler, numCalls:%i\n", numCalls);
413-
#endif
414-
415409
if(++numCalls == 2)
416410
{
417411
// 2rd is for data download
@@ -421,22 +415,15 @@ TEST_FIXTURE(uri_address, data_download_exception)
421415

422416
try
423417
{
424-
client.request(msg).get().content_ready().get();
425-
}
426-
catch (http_exception const &e)
427-
{
428-
printf("http_exception:%s\n", e.what());
429-
VERIFY_IS_TRUE(false);
418+
handle_timeout([&]
419+
{
420+
client.request(msg).get().content_ready().get();
421+
});
430422
}
431423
catch (std::invalid_argument const &)
432424
{
433-
printf("std::invalid_argument\n");
434-
}
435-
catch (std::exception const &e)
436-
{
437-
printf("std::exception:%s\n", e.what());
425+
// Expected.
438426
}
439-
//VERIFY_THROWS(client.request(msg).get().content_ready().get(), std::invalid_argument);
440427
}
441428

442429
}

Release/tests/functional/http/client/proxy_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/***
22
* ==++==
33
*
4-
* Copyright (c) Microsoft Corporation. All rights reserved.
4+
* Copyright (c) Microsoft Corporation. All rights reserved.
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
77
* You may obtain a copy of the License at
88
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
9+
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

Release/tests/functional/http/client/stdafx.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,4 @@
3434
#include "http_test_utilities.h"
3535
#include "unittestpp.h"
3636
#include "os_utilities.h"
37+
#include "timeout_handler.h"

0 commit comments

Comments
 (0)