Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
language: python
os: linux
dist: xenial
cache:
pip: true
ccache: true
directories:
- test/bitcoin

addons:
apt:
sources:
- sourceline: 'ppa:bitcoin/bitcoin'
packages:
- libdb4.8-dev
- libdb4.8++-dev
- build-essential
- curl
- git
- libsdl2-dev
- libsdl2-image-dev
- gcc-arm-none-eabi
- libnewlib-arm-none-eabi
- libudev-dev
- libtool
- autotools-dev
- automake
- pkg-config
- bsdmainutils
- libssl-dev
- libevent-dev
- libboost-system-dev
- libboost-filesystem-dev
- libboost-chrono-dev
- libboost-test-dev
- libboost-thread-dev
- libusb-1.0-0-dev
- protobuf-compiler
- cython3
- ccache

before_install:
- set -o errexit; source ./test/install_bitcoind.sh
script: python -m unittest test.test_wallet
1 change: 1 addition & 0 deletions test/bitcoin_pin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
f4a0d27e85754d60804ffa36e415b67c263180b9
30 changes: 24 additions & 6 deletions test/install_bitcoind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,50 @@
# (copied from HWI)
cd test
bitcoind_setup_needed=false
if [ ! -d "bitcoin" ]; then
if [ ! -d "./bitcoin/.git" ]; then
echo " --> cloning bitcoin"
git clone https://github.com/bitcoin/bitcoin.git
cd bitcoin
bitcoind_setup_needed=true
else
cd bitcoin
echo " --> fetching bitcoin"
git fetch
fi

# Determine if we need to pull. From https://stackoverflow.com/a/3278427
UPSTREAM=${1:-'@{u}'}
LOCAL=$(git rev-parse @)
# Determine if we need to pull. From https://stackoverflow.com/a/3278427
UPSTREAM=${1:-'@{u}'}
LOCAL=$(git rev-parse @)
if [ -f ../bitcoin_pin ]; then
PINNED=$(cat ../bitcoin_pin)
fi
if [ -z PINNED ]; then
REMOTE=$(git rev-parse "$UPSTREAM")
BASE=$(git merge-base @ "$UPSTREAM")

if [ $LOCAL = $REMOTE ]; then
echo "Up-to-date"
elif [ $LOCAL = $BASE ]; then
git pull
bitcoind_setup_needed=true
fi
else
if [ $LOCAL = $PINNED ]; then
echo " --> Pinned: $PINNED! Checkout not needed!"
else
echo " --> Pinned: $PINNED! Checkout needed!"
git pull
git checkout $PINNED
bitcoind_setup_needed=true
fi
fi


# Build bitcoind. This is super slow, but it is cached so it runs fairly quickly.
if [ "$bitcoind_setup_needed" == true ] ; then
if [ "$bitcoind_setup_needed" = "true" ] ; then
./autogen.sh
./configure --with-miniupnpc=no --without-gui --disable-zmq --disable-tests --disable-bench --with-libs=no --with-utils=no
fi
make -j$(nproc) src/bitcoind
cd ../.. #travis is sourcing this script
echo " --> Finished build bitcoind"

2 changes: 2 additions & 0 deletions test/test_wallet.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import unittest
import warnings
import tempfile
import os
import logging
Expand Down Expand Up @@ -84,6 +85,7 @@ def setUp(self):
}
disk.ensure_datadir()
disk.write_json_file(settings, 'settings.json')
warnings.simplefilter("ignore", ResourceWarning)

def test_create_wallet_wrong_parameters(self):
# m > n
Expand Down