2016-02-16 11:12:29 +01:00
|
|
|
#!/bin/sh
|
2017-09-12 09:15:37 +02:00
|
|
|
# Running Parity Full Test Suite
|
2019-02-07 18:49:50 +01:00
|
|
|
echo "________Running test.sh________"
|
2016-02-16 11:12:29 +01:00
|
|
|
|
2018-09-25 12:24:40 +02:00
|
|
|
FEATURES="json-tests,ci-skip-issue"
|
2016-12-08 11:31:57 +01:00
|
|
|
OPTIONS="--release"
|
2018-04-02 13:12:52 +02:00
|
|
|
VALIDATE=1
|
2018-10-01 12:55:17 +02:00
|
|
|
THREADS=8
|
2016-07-11 18:17:54 +02:00
|
|
|
|
2017-08-02 12:50:36 +02:00
|
|
|
set -e
|
|
|
|
|
2018-03-28 21:04:08 +02:00
|
|
|
|
2018-10-01 12:55:17 +02:00
|
|
|
validate () {
|
|
|
|
if [ "$VALIDATE" -eq "1" ]
|
|
|
|
then
|
|
|
|
echo "________Validate build________"
|
2018-12-28 10:43:03 +01:00
|
|
|
time cargo check $@ --locked --no-default-features
|
|
|
|
time cargo check $@ --locked --manifest-path util/io/Cargo.toml --no-default-features
|
|
|
|
time cargo check $@ --locked --manifest-path util/io/Cargo.toml --features "mio"
|
2018-10-02 01:03:58 +02:00
|
|
|
|
2018-10-01 12:55:17 +02:00
|
|
|
# Validate chainspecs
|
|
|
|
echo "________Validate chainspecs________"
|
|
|
|
time ./scripts/validate_chainspecs.sh
|
|
|
|
else
|
|
|
|
echo "# not validating due to \$VALIDATE!=1"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
cpp_test () {
|
2018-10-02 01:03:58 +02:00
|
|
|
case $CARGO_TARGET in
|
|
|
|
(x86_64-unknown-linux-gnu)
|
|
|
|
# Running the C++ example
|
|
|
|
echo "________Running the C++ example________"
|
2018-12-28 10:33:49 +01:00
|
|
|
DIR=parity-clib/examples/cpp/build
|
|
|
|
mkdir -p $DIR
|
|
|
|
cd $DIR
|
|
|
|
cmake ..
|
|
|
|
make -j $THREADS
|
2019-02-03 13:23:07 +01:00
|
|
|
# Note: we don't try to run the example because it tries to sync Kovan, and we don't want
|
|
|
|
# that to happen on CI
|
2018-12-28 10:33:49 +01:00
|
|
|
cd -
|
|
|
|
rm -rf $DIR
|
2018-10-02 01:03:58 +02:00
|
|
|
;;
|
|
|
|
(*)
|
|
|
|
echo "________Skipping the C++ example________"
|
|
|
|
;;
|
|
|
|
esac
|
2018-10-01 12:55:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
cargo_test () {
|
|
|
|
echo "________Running Parity Full Test Suite________"
|
|
|
|
git submodule update --init --recursive
|
2018-12-28 10:43:03 +01:00
|
|
|
time cargo test $OPTIONS --features "$FEATURES" --locked --all $@ -- --test-threads $THREADS
|
2018-10-01 12:55:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$CARGO_TARGET" ]
|
|
|
|
then
|
|
|
|
validate --target $CARGO_TARGET
|
|
|
|
else
|
|
|
|
validate
|
|
|
|
fi
|
|
|
|
|
2018-10-02 01:03:58 +02:00
|
|
|
test "${RUN_TESTS}" = "all" && cpp_test
|
2018-10-01 12:55:17 +02:00
|
|
|
|
|
|
|
if [ "$CARGO_TARGET" ]
|
|
|
|
then
|
|
|
|
|
2018-10-02 01:03:58 +02:00
|
|
|
case "${RUN_TESTS}" in
|
|
|
|
(cargo|all)
|
|
|
|
cargo_test --target $CARGO_TARGET $@
|
|
|
|
;;
|
|
|
|
('')
|
|
|
|
cargo_test --no-run --target $CARGO_TARGET $@
|
|
|
|
;;
|
|
|
|
esac
|
2018-10-01 12:55:17 +02:00
|
|
|
else
|
|
|
|
cargo_test $@
|
2018-04-02 13:12:52 +02:00
|
|
|
fi
|