Skip to content

Commit 56a404f

Browse files
committed
Add a way to run tests on non-linux machines
Allow using the `rust-lang/rust:nightly` docker image to run tests in cases where the host rust and cargo cannot be used, such as non-linux hosts.
1 parent 7240849 commit 56a404f

File tree

23 files changed

+130
-39
lines changed

23 files changed

+130
-39
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
*.rs.bk
22
Cargo.lock
33
target
4+
target-docker
5+
compiler-rt
6+
*.tar.gz

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,25 @@ features = ["c"]
7878
[8]: http://en.cppreference.com/w/cpp/language/implicit_conversion
7979
[9]: https://doc.rust-lang.org/std/primitive.i32.html
8080

81+
## Testing
82+
83+
The easiest way to test locally is using Docker. This can be done by running
84+
`./ci/run-docker.sh [target]`.
85+
86+
In order to run the full test suite, you will also need the C compiler runtime
87+
to test against, located in a directory called `compiler-rt`. This can be
88+
obtained with the following:
89+
90+
```sh
91+
curl -L -o rustc-llvm-18.0.tar.gz https://github.com/rust-lang/llvm-project/archive/rustc/18.0-2024-02-13.tar.gz
92+
tar xzf rustc-llvm-18.0.tar.gz --strip-components 1 llvm-project-rustc-18.0-2024-02-13/compiler-rt
93+
````
94+
95+
Local targets may also be tested with `./ci/run.sh [target]`.
96+
97+
Note that testing may not work on all hosts, in which cases it is acceptable to
98+
rely on CI.
99+
81100
## Progress
82101

83102
- [x] adddf3.c

ci/docker/aarch64-unknown-linux-gnu/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM ubuntu:18.04
1+
ARG IMAGE=ubuntu:18.04
2+
FROM $IMAGE
23
RUN apt-get update && \
34
apt-get install -y --no-install-recommends \
45
gcc libc6-dev ca-certificates \

ci/docker/arm-unknown-linux-gnueabi/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM ubuntu:18.04
1+
ARG IMAGE=ubuntu:18.04
2+
FROM $IMAGE
23
RUN apt-get update && \
34
apt-get install -y --no-install-recommends \
45
gcc libc6-dev ca-certificates \

ci/docker/arm-unknown-linux-gnueabihf/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM ubuntu:18.04
1+
ARG IMAGE=ubuntu:18.04
2+
FROM $IMAGE
23
RUN apt-get update && \
34
apt-get install -y --no-install-recommends \
45
gcc libc6-dev ca-certificates \

ci/docker/armv7-unknown-linux-gnueabihf/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM ubuntu:18.04
1+
ARG IMAGE=ubuntu:18.04
2+
FROM $IMAGE
23
RUN apt-get update && \
34
apt-get install -y --no-install-recommends \
45
gcc libc6-dev ca-certificates \
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM ubuntu:18.04
1+
ARG IMAGE=ubuntu:18.04
2+
FROM $IMAGE
23
RUN apt-get update && \
34
apt-get install -y --no-install-recommends \
45
gcc-multilib libc6-dev ca-certificates
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM ubuntu:18.04
1+
ARG IMAGE=ubuntu:18.04
2+
FROM $IMAGE
23
RUN apt-get update && \
34
apt-get install -y --no-install-recommends \
45
gcc-multilib libc6-dev ca-certificates

ci/docker/mips-unknown-linux-gnu/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM ubuntu:18.04
1+
ARG IMAGE=ubuntu:18.04
2+
FROM $IMAGE
23

34
RUN apt-get update && \
45
apt-get install -y --no-install-recommends \

ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM ubuntu:18.04
1+
ARG IMAGE=ubuntu:18.04
2+
FROM $IMAGE
23
RUN apt-get update && \
34
apt-get install -y --no-install-recommends \
45
ca-certificates \

0 commit comments

Comments
 (0)