Boost logo

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
-arch arm
        : <architecture>arm <target-os>iphone


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).


-- Grafik - Don't Assume Anything
-- Redshift Software, Inc. -
-- rrivera/ (msn) - grafik/
-- 102708583/icq - grafikrobot/aim,yahoo,skype,efnet,gmail


set -e

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

#~ 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"
for arg in "$@"
        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" \
                #~ 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}
                                for p in ${lib_path}
                                        if test -a "${p}/${lib}" ; then
                                                echo "Library: ${lib}"
                                                sleep 5 && ${scp} "${p}/${lib}" "${remote}:${target_dir}/${lib}"
                command="${command} ./${f}"
                command="${command} ${arg}"

#~ 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}"

#~ clean up the target
sleep 5 && ${ssh} "${remote}" rm -rf "/private/var/tmp/itest.*"

exit $result

Boost-testing list run by mbergal at