You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

build-tests.sh.in 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #!/bin/bash
  2. # Copyright (c) 2013-2014 The Bitcoin Core developers
  3. # Distributed under the MIT software license, see the accompanying
  4. # file COPYING or http://www.opensource.org/licenses/mit-license.php.
  5. #
  6. # Param1: The prefix to mingw staging
  7. # Param2: Path to java comparison tool
  8. # Param3: Number of make jobs. Defaults to 1.
  9. # Exit immediately if anything fails:
  10. set -e
  11. set -o xtrace
  12. MINGWPREFIX=$1
  13. JAVA_COMPARISON_TOOL=$2
  14. RUN_EXPENSIVE_TESTS=$3
  15. JOBS=${4-1}
  16. OUT_DIR=${5-}
  17. if [ $# -lt 2 ]; then
  18. echo "Usage: $0 [mingw-prefix] [java-comparison-tool] <make jobs> <save output dir>"
  19. exit 1
  20. fi
  21. DISTDIR=@PACKAGE@-@VERSION@
  22. # Cross-compile for windows first (breaking the mingw/windows build is most common)
  23. cd @abs_top_srcdir@
  24. make distdir
  25. mkdir -p win32-build
  26. rsync -av $DISTDIR/ win32-build/
  27. rm -r $DISTDIR
  28. cd win32-build
  29. if [ $RUN_EXPENSIVE_TESTS = 1 ]; then
  30. ./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 --with-comparison-tool="$JAVA_COMPARISON_TOOL"
  31. else
  32. ./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
  33. fi
  34. make -j$JOBS
  35. # And compile for Linux:
  36. cd @abs_top_srcdir@
  37. make distdir
  38. mkdir -p linux-build
  39. rsync -av $DISTDIR/ linux-build/
  40. rm -r $DISTDIR
  41. cd linux-build
  42. if [ $RUN_EXPENSIVE_TESTS = 1 ]; then
  43. ./configure --disable-silent-rules --disable-ccache --with-comparison-tool="$JAVA_COMPARISON_TOOL" --enable-comparison-tool-reorg-tests
  44. else
  45. ./configure --disable-silent-rules --disable-ccache --with-comparison-tool="$JAVA_COMPARISON_TOOL"
  46. fi
  47. make -j$JOBS
  48. # link interesting binaries to parent out/ directory, if it exists. Do this before
  49. # running unit tests (we want bad binaries to be easy to find)
  50. if [ -d "$OUT_DIR" -a -w "$OUT_DIR" ]; then
  51. set +e
  52. # Windows:
  53. cp @abs_top_srcdir@/win32-build/src/bitcoind.exe $OUT_DIR/bitcoind.exe
  54. cp @abs_top_srcdir@/win32-build/src/test/test_bitcoin.exe $OUT_DIR/test_bitcoin.exe
  55. cp @abs_top_srcdir@/win32-build/src/qt/bitcoind-qt.exe $OUT_DIR/bitcoin-qt.exe
  56. # Linux:
  57. cp @abs_top_srcdir@/linux-build/src/bitcoind $OUT_DIR/bitcoind
  58. cp @abs_top_srcdir@/linux-build/src/test/test_bitcoin $OUT_DIR/test_bitcoin
  59. cp @abs_top_srcdir@/linux-build/src/qt/bitcoind-qt $OUT_DIR/bitcoin-qt
  60. set -e
  61. fi
  62. # Run unit tests and blockchain-tester on Linux:
  63. cd @abs_top_srcdir@/linux-build
  64. make check
  65. # Run RPC integration test on Linux:
  66. @abs_top_srcdir@/qa/rpc-tests/wallet.sh @abs_top_srcdir@/linux-build/src
  67. @abs_top_srcdir@/qa/rpc-tests/listtransactions.py --srcdir @abs_top_srcdir@/linux-build/src
  68. @abs_top_srcdir@/qa/rpc-tests/forknotify.py --srcdir @abs_top_srcdir@/linux-build/src
  69. # Clean up cache/ directory that the python regression tests create
  70. rm -rf cache
  71. if [ $RUN_EXPENSIVE_TESTS = 1 ]; then
  72. # Run unit tests and blockchain-tester on Windows:
  73. cd @abs_top_srcdir@/win32-build
  74. make check
  75. fi
  76. # Clean up builds (pull-tester machine doesn't have infinite disk space)
  77. cd @abs_top_srcdir@/linux-build
  78. make clean
  79. cd @abs_top_srcdir@/win32-build
  80. make clean
  81. # TODO: Fix code coverage builds on pull-tester machine
  82. # # Test code coverage
  83. # cd @abs_top_srcdir@
  84. # make distdir
  85. # mv $DISTDIR linux-coverage-build
  86. # cd linux-coverage-build
  87. # ./configure --enable-lcov --disable-silent-rules --disable-ccache --with-comparison-tool="$JAVA_COMPARISON_TOOL"
  88. # make -j$JOBS
  89. # make cov