aboutsummaryrefslogtreecommitdiff
path: root/qa/pull-tester/build-tests.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'qa/pull-tester/build-tests.sh.in')
-rwxr-xr-xqa/pull-tester/build-tests.sh.in42
1 files changed, 36 insertions, 6 deletions
diff --git a/qa/pull-tester/build-tests.sh.in b/qa/pull-tester/build-tests.sh.in
index 85d9d55bb2..6ae9e9606a 100755
--- a/qa/pull-tester/build-tests.sh.in
+++ b/qa/pull-tester/build-tests.sh.in
@@ -3,44 +3,74 @@
# Param2: Path to java comparison tool
# Param3: Number of make jobs. Defaults to 1.
+# Exit immediately if anything fails:
set -e
set -o xtrace
MINGWPREFIX=$1
JAVA_COMPARISON_TOOL=$2
JOBS=${3-1}
+OUT_DIR=${4-}
if [ $# -lt 2 ]; then
- echo "Usage: $0 [mingw-prefix] [java-comparison-tool] <make jobs>"
+ echo "Usage: $0 [mingw-prefix] [java-comparison-tool] <make jobs> <save output dir>"
exit 1
fi
DISTDIR=@PACKAGE@-@VERSION@
-# Test win32 build first (it breaks the most often)
+# Cross-compile for windows first (breaking the mingw/windows build is most common)
cd @abs_top_srcdir@
make distdir
mv $DISTDIR win32-build
cd win32-build
./configure --disable-silent-rules --disable-ccache --prefix=$MINGWPREFIX --host=i586-mingw32msvc --with-qt-bindir=$MINGWPREFIX/host/bin --with-qt-plugindir=$MINGWPREFIX/plugins --with-qt-incdir=$MINGWPREFIX/include --with-boost=$MINGWPREFIX --with-protoc-bindir=$MINGWPREFIX/host/bin CPPFLAGS=-I$MINGWPREFIX/include LDFLAGS=-L$MINGWPREFIX/lib
make -j$JOBS
-make check
-# ... then linux build, with blockchain-tester:
+# And compile for Linux:
cd @abs_top_srcdir@
make distdir
mv $DISTDIR linux-build
cd linux-build
-./configure --disable-silent-rules --disable-ccache --with-comparison-tool="$JAVA_COMPARISON_TOOL"
+# TODO: re-enable blockchain tester tool, as of 11 Oct 2013 is it not working properly
+# on the pull-tester machine.
+#./configure --disable-silent-rules --disable-ccache --with-comparison-tool="$JAVA_COMPARISON_TOOL"
+./configure --disable-silent-rules --disable-ccache
make -j$JOBS
+
+# link interesting binaries to parent out/ directory, if it exists. Do this before
+# running unit tests (we want bad binaries to be easy to find)
+if [ -d "$OUT_DIR" -a -w "$OUT_DIR" ]; then
+ set +e
+ # Windows:
+ cp @abs_top_srcdir@/win32-build/src/bitcoind.exe $OUT_DIR/bitcoind.exe
+ cp @abs_top_srcdir@/win32-build/src/test/test_bitcoin.exe $OUT_DIR/test_bitcoin.exe
+ cp @abs_top_srcdir@/win32-build/src/qt/bitcoind-qt.exe $OUT_DIR/bitcoin-qt.exe
+ # Linux:
+ cp @abs_top_srcdir@/linux-build/src/bitcoind $OUT_DIR/bitcoind
+ cp @abs_top_srcdir@/linux-build/src/test/test_bitcoin $OUT_DIR/test_bitcoin
+ cp @abs_top_srcdir@/linux-build/src/qt/bitcoind-qt $OUT_DIR/bitcoin-qt
+ set -e
+fi
+
+# Run unit tests and blockchain-tester on Linux:
+cd @abs_top_srcdir@/linux-build
make check
+# Clean up builds (pull-tester machine doesn't have infinite disk space)
+cd @abs_top_srcdir@/linux-build
+make clean
+cd @abs_top_srcdir@/win32-build
+make clean
+
# Test code coverage
cd @abs_top_srcdir@
make distdir
mv $DISTDIR linux-coverage-build
cd linux-coverage-build
-./configure --enable-lcov --with-comparison-tool="$JAVA_COMPARISON_TOOL"
+# TODO: re-enable blockchain tester tool
+#./configure --enable-lcov --with-comparison-tool="$JAVA_COMPARISON_TOOL"
+./configure --enable-lcov
make -j$JOBS
make cov