最近需要在一个包含很多语言的项目中对单个 golang 项目进行单测配置,用的是默认和 github 集成的 travis.ci 。根据官方文档:
In case there is a Makefile in the repository root, the default command Travis CI will use to run your project test suite is
make
Bash
In case there is no Makefile, it will be
go test ${gobuild_args} ./...
默认的 .travis.yml 似乎满足不了需求,必须用 makefile 来实现。具体操作起来其实不难,两行就可以解决问题:
all
cd STO && go test
以前有用 VS 写 C++,但项目组织都自动为你封装好。也有用 Qt 写过,但默认的 cmake 基本意味着不用做什么大的更改。以前也修改过 makefile,但也是在已有的基础上改一些目录和变量。今天才突然意识到这是自己人生中第一个写的 makefile ...突然反应过来这个事实,心情稍微有一点复杂诶...