Commit c1fe3337 authored by jiangpeng's avatar jiangpeng Committed by vipwzw

add autotest build

parent 960e0451
......@@ -21,10 +21,8 @@ build/main.sh
build/main*
build/para.sh
build/ci
build/tools/autotest/autotest
build/tools/autotest/*.toml
build/tools/autotest/chain33
build/tools/autotest/chain33-cli
build/autotest/*
!build/autotest/build.sh
.DS_Store
logs/
build/wallet
......
......@@ -10,8 +10,6 @@ SRC_CLI := github.com/33cn/plugin/cli
APP := build/chain33
CHAIN33=github.com/33cn/chain33
CHAIN33_PATH=vendor/${CHAIN33}
AUTOTEST := build/autotest/autotest
SRC_AUTOTEST_PLUGIN := ${CHAIN33_PATH}/cmd/autotest/pluginversion
LDFLAGS := -ldflags "-w -s"
PKG_LIST := `go list ./... | grep -v "vendor" | grep -v "chain33/test" | grep -v "mocks" | grep -v "pbft"`
PKG_LIST_Q := `go list ./... | grep -v "vendor" | grep -v "chain33/test" | grep -v "mocks" | grep -v "blockchain" | grep -v "pbft"`
......@@ -39,12 +37,16 @@ para:
autotest:## build autotest binary
@cp -r $(CHAIN33_PATH)/build/autotest build/
@go build -v -i -o $(AUTOTEST) $(SRC_AUTOTEST_PLUGIN)
@cp cmd/autotest/*.toml build/tools/autotest/
@cd build/autotest && bash ./build.sh && cd ../../
@if [ -n "$(dapp)" ]; then \
cd build/tools/autotest && bash ./local-autotest.sh $(dapp) && cd ../../../; \
fi
rm -rf build/autotest/local \
&& cp -r $(CHAIN33_PATH)/build/autotest/local $(CHAIN33_PATH)/build/autotest/*.sh build/autotest/ \
&& cd build/autotest && bash ./copy-autotest.sh local && cd local && bash ./local-autotest.sh $(dapp) && cd ../../../; fi
autotest_ci: autotest ## autotest ci
@rm -rf build/autotest/jerkinsci \
&& cp -r $(CHAIN33_PATH)/build/autotest/jerkinsci $(CHAIN33_PATH)/build/autotest/*.sh build/autotest/ \
&& cd build/autotest && bash ./copy-autotest.sh jerkinsci/temp$(proj) \
&& cd jerkinsci && bash ./jerkins-ci-autotest.sh $(proj) && cd ../../../
update:
rm -rf ${CHAIN33_PATH}
......@@ -143,7 +145,7 @@ clean: ## Remove previous build
@rm -rf build/relayd*
@rm -rf build/*.log
@rm -rf build/logs
@rm -rf build/tools/autotest/autotest
@rm -rf build/autotest/autotest
@rm -rf build/ci
@rm -rf tool
@go clean
......
#!/usr/bin/env bash
set -e
set -o pipefail
#set -o verbose
#set -o xtrace
sedfix=""
if [ "$(uname)" == "Darwin" ]; then
sedfix=".bak"
fi
AutoTestMain="../../vendor/github.com/33cn/chain33/cmd/autotest/main.go"
ImportPlugin='"github.com/33cn/plugin/plugin"'
function build_auto_test() {
rm -rf *.go
cp "${AutoTestMain}" ./
sed -i $sedfix '/^package/a import _ '${ImportPlugin}'' *.go
go build -v -i -o autotest
}
function clean_auto_test() {
rm -rf *.go
}
trap "clean_auto_test" INT TERM EXIT
build_auto_test
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment