2016-02-16 11:12:29 +01:00
|
|
|
#!/bin/sh
|
2017-09-12 09:15:37 +02:00
|
|
|
# Running Parity Full Test Suite
|
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
|
|
|
|
|
|
|
case $1 in
|
2018-04-02 13:12:52 +02:00
|
|
|
--no-json)
|
2016-08-10 13:06:24 +02:00
|
|
|
FEATURES="ipc"
|
2016-07-11 18:17:54 +02:00
|
|
|
shift # past argument=value
|
|
|
|
;;
|
2018-04-02 13:12:52 +02:00
|
|
|
--no-release)
|
|
|
|
OPTIONS=""
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
--no-validate)
|
|
|
|
VALIDATE=0
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
--no-run)
|
|
|
|
OPTIONS="--no-run"
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
# unknown option
|
2016-07-11 18:17:54 +02:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
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-19 13:23:26 +01:00
|
|
|
time cargo check $@ --frozen --no-default-features
|
|
|
|
time cargo check $@ --frozen --manifest-path util/io/Cargo.toml --no-default-features
|
|
|
|
time cargo check $@ --frozen --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________"
|
|
|
|
cd parity-clib-examples/cpp && \
|
|
|
|
mkdir -p build && \
|
|
|
|
cd build && \
|
|
|
|
cmake .. && \
|
|
|
|
make -j $THREADS && \
|
|
|
|
./parity-example && \
|
|
|
|
cd .. && \
|
|
|
|
rm -rf build && \
|
|
|
|
cd ../..
|
|
|
|
;;
|
|
|
|
(*)
|
|
|
|
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-19 13:23:26 +01:00
|
|
|
time cargo test $OPTIONS --features "$FEATURES" --frozen --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
|