简体   繁体   中英

Go test does not find package tests in Makefile

I have following Makefile:

SHELL := /bin/bash

boot:
    @go run main.go

test:
    @go test ./...

test-conf:
    @go test --verbose conf

test-httpd:
    @go test --verbose ./httpd

.PHONY: test test-conf test-httpd

Strangely enough make test works without problems however make test-conf or make test-httpd will both result in "github.com/bodokaiser/foobar [no test files]".

When I run go test ./conf from the working dir it works - shouldn't the makefile work too then?

What do I need to do to get go test working with packages in a Makefile?

PS: I would like to avoid using $(pwd) or something in front of all paths if possible...

test-httpdtest-conf不起作用,因为你不能使用--verbosego test ,只能使用-v

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM