forked from openethereum/parity-ethereum
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Tomasz Drwięga
committed
Jul 11, 2016
1 parent
2484286
commit d65a1d2
Showing
7 changed files
with
100 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
|
||
for f in $(find . -name '*.rs'); do | ||
cat license_header $f > $f.new | ||
mv $f.new $f | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/sh | ||
# Installing KCOV under ubuntu | ||
# https://users.rust-lang.org/t/tutorial-how-to-collect-test-coverages-for-rust-project/650# | ||
### Install deps | ||
# $ sudo apt-get install libcurl4-openssl-dev libelf-dev libdw-dev cmake gcc binutils-dev libiberty-dev | ||
# | ||
### Compile kcov | ||
# $ wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz && tar xf master.tar.gz | ||
# $ cd kcov-master && mkdir build && cd build | ||
# $ cmake .. && make && sudo make install | ||
|
||
### Running coverage | ||
|
||
KCOV_CMD=${1:-kcov} | ||
|
||
if ! type $KCOV_CMD > /dev/null; then | ||
echo "Install kcov first (details inside this file). Aborting." | ||
exit 1 | ||
fi | ||
|
||
. ./scripts/targets.sh | ||
|
||
cargo test $TARGETS --no-run || exit $? | ||
rm -rf target/coverage | ||
mkdir -p target/coverage | ||
|
||
EXCLUDE="~/.multirust,rocksdb,secp256k1,/usr/,/.cargo,/root/.multirust,src/tests,util/json-tests,util/src/network/tests,sync/src/tests,ethcore/src/tests,ethcore/src/evm/tests,ethstore/tests target/kcov" | ||
$KCOV_CMD --exclude-pattern $EXCLUDE --include-pattern src --verify target/coverage target/debug/deps/ethkey-* | ||
$KCOV_CMD --exclude-pattern $EXCLUDE --include-pattern src --verify target/coverage target/debug/deps/ethstore-* | ||
$KCOV_CMD --exclude-pattern $EXCLUDE --include-pattern src --verify target/coverage target/debug/deps/ethcore-* | ||
$KCOV_CMD --exclude-pattern $EXCLUDE --include-pattern src --verify target/coverage target/debug/deps/ethash-* | ||
$KCOV_CMD --exclude-pattern $EXCLUDE --include-pattern src --verify target/coverage target/debug/deps/ethcore_util-* | ||
$KCOV_CMD --exclude-pattern $EXCLUDE --include-pattern src --verify target/coverage target/debug/deps/ethsync-* | ||
$KCOV_CMD --exclude-pattern $EXCLUDE --include-pattern src --verify target/coverage target/debug/deps/ethcore_rpc-* | ||
$KCOV_CMD --exclude-pattern $EXCLUDE --include-pattern src --verify target/coverage target/debug/deps/ethcore_signer-* | ||
$KCOV_CMD --exclude-pattern $EXCLUDE --include-pattern src --verify target/coverage target/debug/deps/ethcore_dapps-* | ||
$KCOV_CMD --exclude-pattern $EXCLUDE --include-pattern src --verify target/coverage target/debug/deps/ethjson-* | ||
$KCOV_CMD --exclude-pattern $EXCLUDE --include-pattern src --verify target/coverage target/debug/parity-* | ||
xdg-open target/coverage/index.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
# generate documentation only for partiy and ethcore libraries | ||
|
||
. ./scripts/targets.sh | ||
|
||
cargo doc --no-deps --verbose $TARGETS && | ||
echo '<meta http-equiv=refresh content=0;url=ethcore/index.html>' > target/doc/index.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/sh | ||
|
||
RUSTFMT="rustfmt --write-mode overwrite" | ||
|
||
$RUSTFMT ./ethash/src/lib.rs | ||
$RUSTFMT ./ethcore/src/lib.rs | ||
$RUSTFMT ./evmjit/src/lib.rs | ||
$RUSTFMT ./json/src/lib.rs | ||
$RUSTFMT ./miner/src/lib.rs | ||
$RUSTFMT ./parity/main.rs | ||
$RUSTFMT ./rpc/src/lib.rs | ||
$RUSTFMT ./signer/src/lib.rs | ||
$RUSTFMT ./dapps/src/lib.rs | ||
$RUSTFMT ./sync/src/lib.rs | ||
$RUSTFMT ./util/src/lib.rs | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
FILE=./.git/hooks/pre-push | ||
. ./scripts/targets.sh | ||
|
||
echo "#!/bin/sh\n" > $FILE | ||
# Exit on any error | ||
echo "set -e" >> $FILE | ||
# Run release build | ||
echo "cargo build --features dev" >> $FILE | ||
# Build tests | ||
echo "cargo test --no-run --features dev \\" >> $FILE | ||
echo $TARGETS >> $FILE | ||
echo "" >> $FILE | ||
chmod +x $FILE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
export TARGETS=" | ||
-p ethkey \ | ||
-p ethstore \ | ||
-p ethash \ | ||
-p ethcore-util \ | ||
-p ethcore \ | ||
-p ethsync \ | ||
-p ethcore-rpc \ | ||
-p ethcore-signer \ | ||
-p ethcore-dapps \ | ||
-p parity \ | ||
-p bigint" |