I have added a new Go test stub into my project's test tools repo in a folder called "newTest" which contains "newTest.go, util.go and util_test.go". In the parent directory there is a makefile that automates the building of all test tools and then dockerize them. There already exists a separate Go test stub executable that gets built (existingTest) in the test tools repo. This is the current makefile (redacted):
// Set up and do other stuff
existingTest:
env GOPATH=${PWD}/../external_vendor go build existingTest.go
docker:
@if [ -n "$${CI_PIPE}" ]; then \
//...other docker make stuff
My new go test stub has the same external dependencies that is in ${PWD}/../external_vendor and the build process itself is pretty much identical to what's currently being built. Can I do something like this?
// Set up other stuff
GO_PROG= existingTest newTest/newTest
go: ${GO_PROG}
${GO_PROG}:
env GOPATH=${PWD}/../external_vendor go build $@.go
docker:
@if [ -n "$${CI_PIPE}" ]; then \
//...other docker make stuff