| |
@@ -1,20 +1,37 @@
|
| |
#!/bin/sh -eux
|
| |
|
| |
- set pipefail
|
| |
+ env
|
| |
|
| |
- cflags=`rpm -D '%toolchain clang' -E %{build_cflags}`
|
| |
- cxxflags=`rpm -D '%toolchain clang' -E %{build_cxxflags}`
|
| |
- ldflags=`rpm -D '%toolchain clang' -E %{build_ldflags}`
|
| |
+ status=0
|
| |
|
| |
+ arches="aarch64 armhfp i386 ppc64le s390x x86_64"
|
| |
+ chroot_home='/builddir/'
|
| |
|
| |
- # Test a c program
|
| |
- clang $cflags -c hello.c -o hello.o
|
| |
- clang $cflags -c main.c -o main.o
|
| |
- clang $ldflags -o hello main.o hello.o
|
| |
- ./hello | grep "Hello World"
|
| |
+ for arch in $arches; do
|
| |
+ case $arch in
|
| |
+ armhfp)
|
| |
+ koji_arch="armv7hl"
|
| |
+ ;;
|
| |
+ i386)
|
| |
+ koji_arch="i686"
|
| |
+ ;;
|
| |
+ *)
|
| |
+ koji_arch=$arch
|
| |
+ ;;
|
| |
+ esac
|
| |
+ root="fedora-rawhide-$arch"
|
| |
+ mock -r $root --install clang
|
| |
+ mkdir $arch && pushd $arch
|
| |
+ koji download-build --arch $koji_arch --noprogress --task-id $TASK_ID
|
| |
+ popd
|
| |
+ mock -r $root --install $arch/*.rpm
|
| |
+ mock -r $root --copyin main.c main.cpp hello.c hello.cpp test-clang.sh $chroot_home
|
| |
+ if mock -r $root --config-opts="chroothome=$chroot_home" --shell bash test-clang.sh; then
|
| |
+ echo "$arch: PASS"
|
| |
+ else
|
| |
+ echo "$arch: FAIL"
|
| |
+ status=1
|
| |
+ fi
|
| |
+ done
|
| |
|
| |
- # Test a cxx program
|
| |
- clang++ $cxxflags -c hello.cpp -o hello-cpp.o
|
| |
- clang++ $cxxflags -c main.cpp -o main-cpp.o
|
| |
- clang++ $ldflags -o hello-cpp main-cpp.o hello-cpp.o
|
| |
- ./hello-cpp | grep "Hello World"
|
| |
+ exit $status
|
| |