mirror of
https://github.com/go-delve/delve.git
synced 2025-11-01 20:20:40 +08:00
all: Use -exec flag to codesign test binary on OSX
Replaces a lot of ugly Makefile nonsense with a script that codesigns the test binary before it runs. Only applicable to OSX test runs.
This commit is contained in:
22
Makefile
22
Makefile
@ -13,7 +13,7 @@ ALL_PACKAGES=$(shell go list ./... | grep -v /vendor/)
|
|||||||
# unable to execute.
|
# unable to execute.
|
||||||
# See https://github.com/golang/go/issues/11887#issuecomment-126117692.
|
# See https://github.com/golang/go/issues/11887#issuecomment-126117692.
|
||||||
ifeq "$(UNAME)" "Darwin"
|
ifeq "$(UNAME)" "Darwin"
|
||||||
FLAGS=-ldflags="-s"
|
FLAGS=-ldflags="-s" -exec=$(shell pwd)/scripts/testsign
|
||||||
DARWIN="true"
|
DARWIN="true"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -40,28 +40,14 @@ ifdef DARWIN
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
test: check-cert
|
test: check-cert
|
||||||
ifdef DARWIN
|
|
||||||
ifeq "$(TRAVIS)" "true"
|
ifeq "$(TRAVIS)" "true"
|
||||||
sudo -E go test -v $(ALL_PACKAGES)
|
sudo -E go test -v $(ALL_PACKAGES)
|
||||||
else
|
else
|
||||||
go test $(PREFIX)/terminal $(PREFIX)/dwarf/frame $(PREFIX)/dwarf/op $(PREFIX)/dwarf/util $(PREFIX)/source $(PREFIX)/dwarf/line
|
go test $(FLAGS) $(ALL_PACKAGES)
|
||||||
go test -c $(FLAGS) $(PREFIX)/proc && codesign -s $(CERT) ./proc.test && ./proc.test $(TESTFLAGS) -test.v && rm ./proc.test
|
|
||||||
go test -c $(FLAGS) $(PREFIX)/service/test && codesign -s $(CERT) ./test.test && ./test.test $(TESTFLAGS) -test.v && rm ./test.test
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
go test -v $(ALL_PACKAGES)
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
test-proc-run:
|
test-proc-run:
|
||||||
ifdef DARWIN
|
go test $(FLAGS) $(PREFIX)/proc -run $(RUN)
|
||||||
go test -c $(FLAGS) $(PREFIX)/proc && codesign -s $(CERT) ./proc.test && ./proc.test -test.run $(RUN) && rm ./proc.test
|
|
||||||
else
|
|
||||||
go test $(PREFIX) -run $(RUN)
|
|
||||||
endif
|
|
||||||
|
|
||||||
test-integration-run:
|
test-integration-run:
|
||||||
ifdef DARWIN
|
go test $(FLAGS) $(PREFIX)/service/test -run $(RUN)
|
||||||
go test -c $(FLAGS) $(PREFIX)/service/test && codesign -s $(CERT) ./test.test && ./test.test -test.run $(RUN) && rm ./test.test
|
|
||||||
else
|
|
||||||
go test $(PREFIX)/service/rest -run $(RUN)
|
|
||||||
endif
|
|
||||||
|
|||||||
3
scripts/testsign
Executable file
3
scripts/testsign
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
codesign -s $CERT $1
|
||||||
|
exec $1
|
||||||
Reference in New Issue
Block a user