dongtan6543 2014-07-08 08:30
浏览 121
已采纳

Go测试在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...

  • 写回答

1条回答 默认 最新

  • duai4512 2014-07-08 08:52
    关注

    test-httpd and test-conf don't work, as you can't use --verbose with go test, only -v.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算