-
Notifications
You must be signed in to change notification settings - Fork 145
/
test.sh
executable file
·33 lines (26 loc) · 1.31 KB
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
set -xeo pipefail
# A POSIX variable
OPTIND=1 # Reset in case getopts has been used previously in the shell.
while getopts "d:" opt; do
case "$opt" in
d) DOCKER_REPO=$OPTARG
;;
esac
done
shift $((OPTIND-1))
[ "$1" = "--" ] && shift
LINUX_TRIPLES="arm-linux-gnueabihf arm-linux-gnueabi powerpc64le-linux-gnu aarch64-linux-gnu arm-linux-gnueabihf mipsel-linux-gnu"
DARWIN_TRIPLES="x86_64-apple-darwin i386-apple-darwin x86_64h-apple-darwin"
WINDOWS_TRIPLES="x86_64-w64-mingw32 i686-w64-mingw32"
ALIAS_TRIPLES="arm armhf arm64 amd64 x86_64 mips mipsel powerpc powerpc64 powerpc64le osx darwin windows"
DOCKER_TEST_ARGS="--rm -v $(pwd)/test:/test -w /test"
for triple in ${DARWIN_TRIPLES} ${LINUX_TRIPLES} ${WINDOWS_TRIPLES} ${ALIAS_TRIPLES}; do
docker run ${DOCKER_TEST_ARGS} -e CROSS_TRIPLE=${triple} ${DOCKER_REPO} make test;
done
docker run ${DOCKER_TEST_ARGS} -e CROSS_TRIPLE=i386-apple-darwin ${DOCKER_REPO} /usr/osxcross/bin/i386-apple-darwin14-cc helloworld.c -o helloworld
file test/helloworld
docker run ${DOCKER_TEST_ARGS} -e CROSS_TRIPLE=i386-apple-darwin ${DOCKER_REPO} /usr/i386-apple-darwin14/bin/cc helloworld.c -o helloworld
file test/helloworld
docker run ${DOCKER_TEST_ARGS} -e CROSS_TRIPLE=i386-apple-darwin ${DOCKER_REPO} cc helloworld.c -o helloworld
file test/helloworld