|
Boost Testing : |
Subject: Re: [Boost-testing] Running boost tests remotely
From: Rene Rivera (grafikrobot_at_[hidden])
Date: 2010-03-18 11:43:49
Stijn Devriendt wrote:
> Is this possible or am I overlooking another option of running the boost tests?
Last time I checked it is possible. I used to do the same for doing
iPhone testing but you need a rather complex test launch script if you
want something other than full static binary testing. The way I got it
to work was to have this in your user-config.jam:
===
using darwin : 4.0.1~iphone~coda
:
/Developer/Xcode-$(xcode)/Platforms/iPhoneOS.platform/Developer/usr/bin/g++
-arch arm
:
<root>/Developer/iPhone-Coda-$(xcode)/Platforms/iPhoneOS.platform/Developer
<striper>
: <architecture>arm <target-os>iphone
;
toolset.add-requirements
<toolset-darwin:version>4.0.1~iphone~coda:<testing.launcher>"itest.sh"
<toolset-darwin:version>4.0.1~iphone~coda:<runtime-link>static
<toolset-darwin:version>4.0.1~iphone~coda:<link>static
;
===
The important part being the "toolset.add-requiremtns" declaration so
that the test script gets used for all targets. In my case since I was
dealing with dynamic libs my script does a nasty dance of running
"otool" and copying the dependent libs along with the executable (see
attached script).
HTH.
-- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org (msn) - grafik/redshift-software.com -- 102708583/icq - grafikrobot/aim,yahoo,skype,efnet,gmail
#!/bin/sh
set -e
remote="mobile_at_192.168.13.200"
target_dir="/private/var/tmp"
xcode="3.1-beta5"
sysroot="/Developer/iPhone-FOSS-Coda-${xcode}/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk"
tools="/Developer/Xcode-${xcode}/Platforms/iPhoneOS.platform/Developer/usr/bin"
scp="scp -BCp"
ssh="ssh -C"
#~ generate temporary subdir in the target
tmp_name=`mktemp -u /tmp/itest.XXXXXXXXXX`
tmp_name=`basename ${tmp_name}`
#~ and repoint the target dir
target_dir="${target_dir}/${tmp_name}"
#~ create the target dir
${ssh} ${remote} mkdir "${target_dir}"
#~ parse the command rewriting it so we can execute it on the iPod
lib_path=`echo ${DYLD_LIBRARY_PATH} | sed 's/[:]/ /g'`
command_pre="export DYLD_LIBRARY_PATH=${target_dir}:/private/var/libs/itest && cd ${target_dir} && ulimit -t 180 && nice"
command=""
for arg in "$@"
do
if test -a "${arg}" ; then
f=`basename "${arg}"`
#~ relable the system libs so we use the local versions
${tools}/install_name_tool \
-change "/usr/lib/libstdc++.6.dylib" "/private/var/lib/itest/libstdc++.6.dylib" \
-change "/usr/lib/libgcc_s.1.dylib" "/private/var/lib/itest/libgcc_s.1.dylib" \
"${arg}"
#~ copy the file to the target dir for later use
sleep 5 && ${scp} "${arg}" "${remote}:${target_dir}/${f}"
if test -x "${arg}" ; then
#~ find any local shared libs, so we can copy them to where they can be found
libs=`${tools}/otool -L "${arg}" | sed -E 's/^[^a-z/]+([^ ]*).*\$/\\1/'`
for lib in ${libs}
do
for p in ${lib_path}
do
if test -a "${p}/${lib}" ; then
echo "Library: ${lib}"
sleep 5 && ${scp} "${p}/${lib}" "${remote}:${target_dir}/${lib}"
fi
done
done
fi
command="${command} ./${f}"
else
command="${command} ${arg}"
fi
done
#~ copy the system libraries from the sdk to the ipod as they
#~ are different. but only just enough for boost testing
#~ ${scp} "${sysroot}/usr/lib/libstdc++.6.0.4.dylib" "${remote}:${target_dir}/libstdc++.6.dylib"
#~ ${scp} "${sysroot}/usr/lib/libSystem.B.dylib" "${remote}:${target_dir}/libSystem.dylib"
set +e
#~ echo "${command_pre} ${command}"
sleep 5 && ${ssh} "${remote}" "${command_pre} ${command}"
result=$?
#~ clean up the target
sleep 5 && ${ssh} "${remote}" rm -rf "/private/var/tmp/itest.*"
exit $result