Skip to content

Commit d77a364

Browse files
committed
test: add rpc test executable
1 parent 25f2814 commit d77a364

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

.github/workflows/rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,4 @@ jobs:
143143
- name: Running test script
144144
env:
145145
BITCOINVERSION: ${{ matrix.bitcoinversion }}
146-
run: ./contrib/test.sh
146+
run: ./contrib/test-rpc.sh

contrib/test-rpc.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
2+
set -xe
3+
4+
# Just echo all the relevant env vars to help debug Travis.
5+
echo "RUSTFMTCHECK: \"$RUSTFMTCHECK\""
6+
echo "BITCOINVERSION: \"$BITCOINVERSION\""
7+
echo "PATH: \"$PATH\""
8+
9+
10+
# Pin dependencies for Rust v1.29
11+
if [ -n $"$PIN_VERSIONS" ]; then
12+
cargo generate-lockfile --verbose
13+
14+
cargo update --verbose --package "log" --precise "0.4.13"
15+
cargo update --verbose --package "cc" --precise "1.0.41"
16+
cargo update --verbose --package "cfg-if" --precise "0.1.9"
17+
cargo update --verbose --package "serde_json" --precise "1.0.39"
18+
cargo update --verbose --package "serde" --precise "1.0.98"
19+
cargo update --verbose --package "serde_derive" --precise "1.0.98"
20+
cargo update --verbose --package "byteorder" --precise "1.3.4"
21+
fi
22+
23+
if [ -n "$RUSTFMTCHECK" ]; then
24+
rustup component add rustfmt
25+
cargo fmt --all -- --check
26+
fi
27+
28+
# Integration test.
29+
if [ -n "$BITCOINVERSION" ]; then
30+
wget https://bitcoincore.org/bin/bitcoin-core-$BITCOINVERSION/bitcoin-$BITCOINVERSION-x86_64-linux-gnu.tar.gz
31+
tar -xzvf bitcoin-$BITCOINVERSION-x86_64-linux-gnu.tar.gz
32+
export PATH=$PATH:$(pwd)/bitcoin-$BITCOINVERSION/bin
33+
cd integration_test
34+
./run.sh
35+
exit 0
36+
else
37+
# Regular build/unit test.
38+
cargo build --verbose
39+
cargo test --verbose
40+
cargo build --verbose --examples
41+
fi
42+

0 commit comments

Comments
 (0)