This repository was archived by the owner on Oct 28, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
Copy pathrunalltests.sh
62 lines (55 loc) · 1.73 KB
/
runalltests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env bash
workdir=$(pwd)
#Clean the previous build
rm -rf cpp-ethereum 2>/dev/null || true
rm -rf tests 2>/dev/null || true
exec &> $workdir/buildlog.txt
export ETHEREUM_TEST_PATH="$(pwd)/tests"
#Clonning Repositories
echo "Cloning Repositories"
git clone --depth 1 --single-branch https://github.com/ethereum/tests.git
git clone --recursive --depth 1 --single-branch https://github.com/ethereum/cpp-ethereum.git
cd tests
testHead=$(git rev-parse HEAD)
cd ..
cd tests/RPCTests
npm install
cd $workdir/cpp-ethereum
cppHead=$(git rev-parse HEAD)
#Prepare test results
mkdir build
cd build
echo "Make cpp-ethereum develop:"
cmake .. -DCOVERAGE=On
make -j8
echo "Running all tests:"
echo "cpp-ethereum repository at commit $cppHead"
echo "tests repository at commit $testHead"
exec 2> $workdir/testlog.txt
timestart=$(date +%s.%N)
TMPDIR=/dev/shm
test/testeth -- --all --exectimelog
cd $workdir/tests/RPCTests
echo "#--------------RPC TESTS--------------"
node main.js $workdir/cpp-ethereum/build/eth/eth
timeend=$(date +%s.%N)
date=$(date +%Y-%m-%d)
# Upload coverage report
if [ -z "$CODECOV_TOKEN" ]; then
echo "Warning! CODECOV_TOKEN not set. See https://codecov.io/gh/ethereum/cpp-ethereum/settings."
else
bash <(curl -s https://codecov.io/bash) -n alltests -b "$date" -F alltests -a '>/dev/null 2>&1'
fi
# Make report
cd $workdir
(
echo "REPORT"
exectime=$(echo "$timeend - $timestart" | bc)
echo "Test execution time: $exectime s"
echo "Coverage: https://codecov.io/gh/ethereum/cpp-ethereum/commit/$cppHead"
cat testlog.txt
cat buildlog.txt
) > report.txt
# Send mail
RECIPIENTS="dimitry@ethereum.org pawel@ethereum.org chris@ethereum.org andrei@ethereum.org yoichi@ethereum.org"
mail < report.txt -s "cpp-ethereum alltests $date" $RECIPIENTS