1 Star 0 Fork 0

github-bridge/protobuf

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
test.bash 1.41 KB
一键复制 编辑 原始数据 按行查看 历史
Joe Tsai 提交于 2020-01-08 20:52 . all: update to wrap v2
#!/bin/bash
# Copyright 2018 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
cd "$(git rev-parse --show-toplevel)"
BOLD="\x1b[1mRunning: "
PASS="\x1b[32mPASS"
FAIL="\x1b[31mFAIL"
RESET="\x1b[0m"
echo -e "${BOLD}go test ./...${RESET}"
RET_TEST0=$(go test ./... | egrep -v "^(ok|[?])\s+")
if [[ ! -z "$RET_TEST0" ]]; then echo "$RET_TEST0"; echo; fi
echo -e "${BOLD}go test -tags purego ./...${RESET}"
RET_TEST1=$(go test -tags purego ./... | egrep -v "^(ok|[?])\s+")
if [[ ! -z "$RET_TEST1" ]]; then echo "$RET_TEST1"; echo; fi
echo -e "${BOLD}go generate${RESET}"
RET_GEN=$(go run ./internal/cmd/generate-alias 2>&1)
if [[ ! -z "$RET_GEN" ]]; then echo "$RET_GEN"; echo; fi
echo -e "${BOLD}go fmt${RESET}"
RET_FMT=$(gofmt -d $(git ls-files *.go) 2>&1)
if [[ ! -z "$RET_FMT" ]]; then echo "$RET_FMT"; echo; fi
echo -e "${BOLD}git diff${RESET}"
RET_DIFF=$(git diff --no-prefix HEAD 2>&1)
if [[ ! -z "$RET_DIFF" ]]; then echo "$RET_DIFF"; echo; fi
echo -e "${BOLD}git ls-files${RESET}"
RET_FILES=$(git ls-files --others --exclude-standard 2>&1)
if [[ ! -z "$RET_FILES" ]]; then echo "$RET_FILES"; echo; fi
if [[ ! -z "$RET_TEST0" ]] || [[ ! -z "$RET_TEST1" ]] || [[ ! -z "$RET_GEN" ]] || [ ! -z "$RET_FMT" ] || [[ ! -z "$RET_DIFF" ]] || [[ ! -z "$RET_FILES" ]]; then
echo -e "${FAIL}${RESET}"; exit 1
else
echo -e "${PASS}${RESET}"; exit 0
fi
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/github-bridge/protobuf.git
git@gitee.com:github-bridge/protobuf.git
github-bridge
protobuf
protobuf
master

搜索帮助