3 Star 0 Fork 0

mirrors_vmware-archive/ghostunnel

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Makefile 2.02 KB
一键复制 编辑 原始数据 按行查看 历史
SOURCE_FILES := $(shell find . \( -name '*.go' -not -path './vendor/*' \))
INTEGRATION_TESTS := $(shell find tests -name 'test-*.py' -exec basename {} .py \;)
VERSION := $(shell git describe --always --dirty)
# Ghostunnel binary
ghostunnel: $(SOURCE_FILES)
go build -ldflags '-X main.version=${VERSION}' -o ghostunnel .
# Ghostunnel binary with certstore enabled
ghostunnel.certstore: $(SOURCE_FILES)
go build -tags certstore -ldflags '-X main.version=${VERSION}' -o ghostunnel.certstore .
# Man page
ghostunnel.man: ghostunnel
./ghostunnel --help-custom-man > $@
# Test binary with coverage instrumentation
ghostunnel.test: $(SOURCE_FILES)
go test -c -covermode=count -coverpkg .,./auth,./certloader,./proxy,./wildcard,./socket
# Clean build output
clean:
rm -rf ghostunnel *.out */*.out ghostunnel.test tests/__pycache__
.PHONY: clean
# Run all tests (unit + integration tests)
test: unit $(INTEGRATION_TESTS)
gocovmerge *.out */*.out > coverage-merged.out
@echo "PASS"
.PHONY: test
# Run unit tests
unit:
go test -v -covermode=count -coverprofile=coverage-unit-test.out ./...
.PHONY: unit
# Run integration tests
$(INTEGRATION_TESTS): ghostunnel.test
@cd tests && ./runner.py $@
.PHONY: $(INTEGRATION_TESTS)
# Import test keys into SoftHSM (v2)
softhsm-import:
softhsm2-util --init-token --slot 0 \
--label ${GHOSTUNNEL_TEST_PKCS11_LABEL} \
--so-pin ${GHOSTUNNEL_TEST_PKCS11_PIN} \
--pin ${GHOSTUNNEL_TEST_PKCS11_PIN}
softhsm2-util --id 01 \
--token ${GHOSTUNNEL_TEST_PKCS11_LABEL} \
--label ${GHOSTUNNEL_TEST_PKCS11_LABEL} \
--so-pin ${GHOSTUNNEL_TEST_PKCS11_PIN} \
--pin ${GHOSTUNNEL_TEST_PKCS11_PIN} \
--import test-keys/server-pkcs8.pem
.PHONY: softhsm-import
# Build Docker image
docker-build:
docker build -t squareup/ghostunnel .
.PHONY: docker-build
# Run unit and integration tests in Docker container
docker-test:
docker build --build-arg GO_VERSION=${GO_VERSION} -t squareup/ghostunnel-test -f Dockerfile-test .
docker run -v ${PWD}:/go/src/github.com/square/ghostunnel squareup/ghostunnel-test
.PHONY: docker-test
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors_vmware-archive/ghostunnel.git
git@gitee.com:mirrors_vmware-archive/ghostunnel.git
mirrors_vmware-archive
ghostunnel
ghostunnel
master

搜索帮助