您是否有必要在您的个人硬件上运行该项目?如果您对 Raspberry Pi 的代码编译和测试感到满意,您可以通过以下方式进行:
汇编
在 Travis 上交叉编译。我得到了以下代码:
Dockerfile
:
FROM mitchallen/pi-cross-compile
# Switch into our apps working directory
WORKDIR /build
COPY . /build
# The base image has more examples how to use make or CMake for the project, directly
# calling the cross-compiler, is the minimal example here.
RUN ["/pitools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-gcc",\
"-o", "hello", "hello.cpp"]
.travis.yml
:
language: cpp
services:
- docker
before_install:
- docker build -t me/image .
script:
# One of those lines is necessary otherwise travis runs 'rake' by default.
- true
- echo "Success"
hello.cpp
:
#include <stdio.h>
int main (int argc, char **argv) {
printf("Hello, world!\n");
return 0;
}
测试
在 travis 上使用 Qemu。这是使用此工具的示例。