diff --git a/.gitignore b/.gitignore index b2e592f497..f521ddee45 100644 --- a/.gitignore +++ b/.gitignore @@ -75,4 +75,7 @@ My Amplifier XE Results - RippleD /out.txt # Build Log -rippled-build.log \ No newline at end of file +rippled-build.log + +# Profiling data +gmon.out diff --git a/Builds/test-all.sh b/Builds/test-all.sh index e81b9b3a4f..6eccb9a488 100755 --- a/Builds/test-all.sh +++ b/Builds/test-all.sh @@ -1,38 +1,36 @@ #/bin/sh +# This file is part of rippled: https://github.com/ripple/rippled +# Copyright (c) 2012 - 2015 Ripple Labs Inc. +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + # Invoke as "sh ./Builds/test-all.sh" -# or first make it executable ("chmod a+rx ./Builds/test-all.sh) +# or first make it executable ("chmod a+rx ./Builds/test-all.sh") # then invoke as "./Builds/test-all.sh" # -# Build must succeed without shell aliases for this to work. +# The build must succeed without shell aliases for this to work. +# +# Common problems: +# 1) Boost not found. Solution: export BOOST_ROOT=[path to boost folder] +# 2) OpenSSL not found. Solution: export OPENSSL_ROOT=[path to OpenSSL folder] +# 3) scons is an alias. Solution: Create a script named "scons" somewhere in +# your $PATH (eg. ~/bin/scons will often work). +# #!/bin/sh +# python /C/Python27/Scripts/scons.py "${@}" -BUILD="debug release all" -success="" -scons ${BUILD} && \ - for dir in ./build/* - do - if [ ! -x ${dir}/rippled ] - then - echo -e "\n\n\n${dir} is not a build dir\n\n\n" - continue - fi - RUN=$( basename ${dir} ) - echo -e "\n\n\nTesting ${RUN}\n\n\n" - RIPPLED=./build/${RUN}/rippled - LOG=unittest.${RUN}.log - ${RIPPLED} --unittest | tee ${LOG} && \ - grep -q "0 failures" ${LOG} && \ - npm test --rippled=${RIPPLED} \ - || break - success="${success} ${RUN}" - RUN= - done +BUILD=( "debug" "release" "all" ) +test=$( dirname $0 ) +test="${test}/test-only.sh" -if [ -n "${RUN}" ] -then - echo "Failed on ${RUN}" -fi -if [ -n "${success}" ] -then - echo "Success on ${success}" -fi +"${test}" "${BUILD[@]}" diff --git a/Builds/test-only.sh b/Builds/test-only.sh new file mode 100755 index 0000000000..3b716cf91c --- /dev/null +++ b/Builds/test-only.sh @@ -0,0 +1,60 @@ +#/bin/sh + +# This file is part of rippled: https://github.com/ripple/rippled +# Copyright (c) 2012 - 2015 Ripple Labs Inc. +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +# Invoke as "sh ./Builds/test-only [build type(s)]" +# or first make it executable ("chmod a+rx ./Builds/test-all.sh") +# then invoke as "./Builds/test-only [build type(s)]" +# +# The build must succeed without shell aliases for this to work. +# +# Common problems: +# 1) Boost not found. Solution: export BOOST_ROOT=[path to boost folder] +# 2) OpenSSL not found. Solution: export OPENSSL_ROOT=[path to OpenSSL folder] +# 3) scons is an alias. Solution: Create a script named "scons" somewhere in +# your $PATH (eg. ~/bin/scons will often work). +# #!/bin/sh +# python /C/Python27/Scripts/scons.py "${@}" + +success="" +scons "${@}" || exit 1 && \ + for RIPPLED in $( scons --tree=derived "${@}" | grep "^ +-" | sed 's/^ +-//' | sort -u ) + do + RUN=$( echo "${RIPPLED}" | sed 's/\\/\//g' | cut -d/ -f2 ) + if [ ! -x "${RIPPLED}" ] + then + echo -e "\n${RIPPLED} is not a build target dir\n" + continue + fi + echo -e "\n\n\nTesting ${RIPPLED}\n\n\n" + LOG=unittest.${RUN}.log + ${RIPPLED} --unittest | tee ${LOG} && \ + grep -q "0 failures" ${LOG} && \ + npm test --rippled=${RIPPLED} \ + || break + success="${success} ${RUN}" + RUN= + done + +if [ -n "${success}" ] +then + echo "Success on ${success}" +fi +if [ -n "${RUN}" ] +then + echo "Failed on ${RUN}" + exit 1 +fi