-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
72 lines (57 loc) · 3.72 KB
/
Makefile
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
63
64
65
66
67
68
69
70
71
72
SHELL = bash -o pipefail
GITTAG ?= $(shell git describe --exact-match --tags HEAD 2>/dev/null || :)
GITBRANCH ?= $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null || :)
LONGVERSION ?= $(shell git describe --tags --long --abbrev=8 --always HEAD)$(echo -$GITBRANCH | tr / - | grep -v '\-master' || :)
VERSION ?= $(if $(GITTAG),$(GITTAG),$(LONGVERSION))
GITCOMMIT ?= $(shell git log -1 --date=iso --pretty=format:%H)
GITCOMMITDATE ?= $(shell git log -1 --date=iso --pretty=format:%cd)
all:
@echo "make <cmd>"
@echo ""
@echo "commands:"
@echo ""
@echo " - bootstrap"
@echo " - start-testchain"
@echo " - start-testchain-verbose"
@echo ""
#
# Testchain
#
bootstrap:
cd ./testchain && yarn install
start-testchain:
cd ./testchain && yarn start:hardhat
start-testchain-verbose:
cd ./testchain && yarn start:hardhat:verbose
start-testchain-geth:
cd ./testchain && yarn start:geth
start-testchain-geth-verbose:
cd ./testchain && yarn start:geth:verbose
check-testchain-running:
@curl http://localhost:8545 -H"Content-type: application/json" -X POST -d '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' --write-out '%{http_code}' --silent --output /dev/null | grep 200 > /dev/null \
|| { echo "*****"; echo "Oops! testchain is not running. Please run 'make start-testchain' in another terminal or use 'test-concurrently'."; echo "*****"; exit 1; }
test-testchain:
cd ./testchain && (yarn start:hardhat & echo $$! > .pid) && yarn test > ../chaintest.out && cd .. && make stop && cat chaintest.out
stop:
-pkill -F ./testchain/.pid && rm testchain/.pid
test:
rm TestResults*.xml ; cd ./testchain && (yarn start:hardhat & echo $$! > .pid) && cd .. && \
Unity -batchmode -runTests -projectPath "$(pwd)" -testPlatform editmode -testResults TestResults_Edit.xml ; Unity -quit && \
Unity -runTests -projectPath "$(pwd)" -testPlatform playmode -testResults TestResults_Play.xml ; \
make stop && \
echo "Edit mode Test results: " && \
head -n 2 TestResults_Edit.xml | grep -Eo 'result="[^"]+"|total="[^"]+"|passed="[^"]+"|failed="[^"]+"|inconclusive="[^"]+"|skipped="[^"]+"|start-time="[^"]+"|end-time="[^"]+"|duration="[^"]+"' | grep -Ev 'clr-version=|engine-version=|asserts=|id=|testcasecount=' | sed -E 's/^[^"]+"([^"]+)"[^"]+"([^"]+)".*/\1: \2/' && \
echo "" && \
echo "Play mode Test results: " && \
head -n 2 TestResults_Play.xml | grep -Eo 'result="[^"]+"|total="[^"]+"|passed="[^"]+"|failed="[^"]+"|inconclusive="[^"]+"|skipped="[^"]+"|start-time="[^"]+"|end-time="[^"]+"|duration="[^"]+"' | grep -Ev 'clr-version=|engine-version=|asserts=|id=|testcasecount=' | sed -E 's/^[^"]+"([^"]+)"[^"]+"([^"]+)".*/\1: \2/'
test-ui:
rm TestResults*.xml ; \
Unity -runTests -projectPath "$(pwd)" -testPlatform playmode -testResults TestResults_Play.xml ; \
echo "Play mode Test results: " && \
head -n 2 TestResults_Play.xml | grep -Eo 'result="[^"]+"|total="[^"]+"|passed="[^"]+"|failed="[^"]+"|inconclusive="[^"]+"|skipped="[^"]+"|start-time="[^"]+"|end-time="[^"]+"|duration="[^"]+"' | grep -Ev 'clr-version=|engine-version=|asserts=|id=|testcasecount=' | sed -E 's/^[^"]+"([^"]+)"[^"]+"([^"]+)".*/\1: \2/'
test-sdk:
rm TestResults*.xml ; cd ./testchain && (yarn start:hardhat & echo $$! > .pid) && cd .. && \
Unity -batchmode -runTests -projectPath "$(pwd)" -testPlatform editmode -testResults TestResults_Edit.xml ; Unity -quit && \
make stop && \
echo "Edit mode Test results: " && \
head -n 2 TestResults_Edit.xml | grep -Eo 'result="[^"]+"|total="[^"]+"|passed="[^"]+"|failed="[^"]+"|inconclusive="[^"]+"|skipped="[^"]+"|start-time="[^"]+"|end-time="[^"]+"|duration="[^"]+"' | grep -Ev 'clr-version=|engine-version=|asserts=|id=|testcasecount=' | sed -E 's/^[^"]+"([^"]+)"[^"]+"([^"]+)".*/\1: \2/'