Merge branch 'master' into noui

Conflicts:
	.travis.yml
This commit is contained in:
Tomasz Drwięga
2016-07-13 17:19:51 +02:00
10 changed files with 114 additions and 124 deletions

6
scripts/add_license.sh Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/sh
for f in $(find . -name '*.rs'); do
cat license_header $f > $f.new
mv $f.new $f
done

53
scripts/cov.sh Executable file
View File

@@ -0,0 +1,53 @@
#!/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
set -x
KCOV=${1:-kcov}
if ! type $KCOV > /dev/null; then
echo "Install kcov first (details inside this file). Aborting."
exit 1
fi
. ./scripts/targets.sh
cargo test $TARGETS --no-default-features --no-run || exit $?
KCOV_TARGET="target/kcov"
KCOV_FLAGS="--verify"
EXCLUDE="/usr/lib,\
/usr/include,\
$HOME/.cargo,\
$HOME/.multirust,\
rocksdb,\
secp256k1,\
src/tests,\
util/json-tests,\
util/src/network/tests,\
ethcore/src/evm/tests,\
ethstore/tests\
"
rm -rf $KCOV_TARGET
mkdir -p $KCOV_TARGET
for FILE in `find target/debug/deps ! -name "*.*"`
do
$KCOV --exclude-pattern $EXCLUDE $KCOV_FLAGS $KCOV_TARGET $FILE
done
$KCOV --coveralls-id=${TRAVIS_JOB_ID} --exclude-pattern $EXCLUDE $KCOV_FLAGS $KCOV_TARGET target/debug/parity-*
exit 0

7
scripts/doc.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/sh
# generate documentation only for partiy and ethcore libraries
. ./scripts/targets.sh
cargo doc --no-deps --verbose --no-default-features $TARGETS &&
echo '<meta http-equiv=refresh content=0;url=ethcore/index.html>' > target/doc/index.html

16
scripts/fmt.sh Executable file
View File

@@ -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

14
scripts/hook.sh Executable file
View File

@@ -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

14
scripts/targets.sh Normal file
View File

@@ -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 parity \
-p bigint"
# TODO [ToDr] add ethcore-dapps back