Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
test.sh: use cargo --target for platforms other than linux, win or mac
Browse files Browse the repository at this point in the history
  • Loading branch information
gabreal committed Sep 25, 2018
1 parent cc963d4 commit 3ed80d9
Showing 1 changed file with 56 additions and 28 deletions.
84 changes: 56 additions & 28 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
FEATURES="json-tests,ci-skip-issue"
OPTIONS="--release"
VALIDATE=1
THREADS=8

case $1 in
--no-json)
Expand All @@ -29,31 +30,58 @@ esac

set -e

if [ "$VALIDATE" -eq "1" ]; then
# Validate --no-default-features build
echo "________Validate build________"
time cargo check --no-default-features
time cargo check --manifest-path util/io/Cargo.toml --no-default-features
time cargo check --manifest-path util/io/Cargo.toml --features "mio"

# Validate chainspecs
echo "________Validate chainspecs________"
time ./scripts/validate_chainspecs.sh
fi

# Running the C++ example
echo "________Running the C++ example________"
cd parity-clib-examples/cpp && \
mkdir -p build && \
cd build && \
cmake .. && \
make -j 8 && \
./parity-example && \
cd .. && \
rm -rf build && \
cd ../..

# Running tests
echo "________Running Parity Full Test Suite________"
git submodule update --init --recursive
time cargo test $OPTIONS --features "$FEATURES" --all $1 -- --test-threads 8


case $CARGO_TARGET in
(x86_64-unknown-linux-gnu|x86_64-apple-darwin|x86_64-pc-windows-msvc|'')
# native builds
if [ "$VALIDATE" -eq "1" ]
then
echo "________Validate build________"
time cargo check --no-default-features
time cargo check --manifest-path util/io/Cargo.toml --no-default-features
time cargo check --manifest-path util/io/Cargo.toml --features "mio"

# Validate chainspecs
echo "________Validate chainspecs________"
time ./scripts/validate_chainspecs.sh
fi


# 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 ../..

# Running tests
echo "________Running Parity Full Test Suite________"
git submodule update --init --recursive
time cargo test $OPTIONS --features "$FEATURES" --all $@ -- --test-threads $THREADS
;;
(*)
if [ "$VALIDATE" -eq "1" ]
then
echo "________Validate build________"
time cargo check --target $CARGO_TARGET --no-default-features
time cargo check --target $CARGO_TARGET --manifest-path util/io/Cargo.toml --no-default-features
time cargo check --target $CARGO_TARGET --manifest-path util/io/Cargo.toml --features "mio"

# Validate chainspecs
echo "________Validate chainspecs________"
time ./scripts/validate_chainspecs.sh
fi

# Per default only build but not run the tests
echo "________Building Parity Full Test Suite________"
git submodule update --init --recursive
time cargo test --no-run --target $CARGO_TARGET $OPTIONS --features "$FEATURES" --all $@ -- --test-threads $THREADS
;;
esac

0 comments on commit 3ed80d9

Please sign in to comment.