【问题标题】:How to properly setup TravisCI For a simple C project如何为一个简单的 C 项目正确设置 TravisCI
【发布时间】:2015-10-26 09:47:15
【问题描述】:

我正在尝试设置 TravisCI 以在 C 项目中为我进行自动构建和测试。

为了学习和理解它,我制作了一个示例 github repo 以使其在将其移至我的最终项目之前运行。

我的Project 基本上由 3 个文件组成:

.travis.yml:

language: C

制作文件:

hellomake: main.c
    gcc -o hellomake main.c -I.

main.c:

#include <stdio.h>

void main() 
{
    printf("Hello World!");
}

由于现在是项目,我在 Travis 中收到以下错误:

0.00s$ ./configure && make && make test
/home/travis/build.sh: line 41: ./configure: No such file or directory
The command "./configure && make && make test" exited with 127.

我错过了什么或做错了什么?

【问题讨论】:

  • ./configure 不是必需的。只需运行make
  • 如何指定?

标签: c makefile travis-ci


【解决方案1】:

根据The Docs,C 项目的默认script./configure &amp;&amp; make &amp;&amp; make test。但是,正如下面几行所指定的,“这可以按照general build configuration 指南中的描述被覆盖。”

例如,对于您的项目(只有Makefile 没有test 目标),您可以使用:

script: make

用于构建它(附加到.travis.yml)。

【讨论】:

  • 如此简单,但我看不到它...如果我想追加测试怎么办?然后脚本:make && make test?
  • @CarstenFarving 是的,script: make &amp;&amp; make test 或类似this (docs)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-11-17
  • 1970-01-01
  • 2011-11-12
  • 1970-01-01
  • 2010-09-22
  • 1970-01-01
相关资源
最近更新 更多