From 4125daf6f5f19e62aaf32b67db47ff95c938313b Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Wed, 19 May 2021 01:25:57 +0000 Subject: [PATCH] Revert "Run fedora-flags test on all architectures" This reverts commit bd66e3d65af3d1c350789b1b706c0fd4237f8f54. This test is wrong, because it tests the current version of clang from rawhide and not from the build being tested. --- tests/fedora-flags/runtest.sh | 30 ++++++++++++++---------------- tests/fedora-flags/test-clang.sh | 30 ------------------------------ tests/tests.yml | 2 -- 3 files changed, 14 insertions(+), 48 deletions(-) delete mode 100644 tests/fedora-flags/test-clang.sh diff --git a/tests/fedora-flags/runtest.sh b/tests/fedora-flags/runtest.sh index 7c63e07..96d1cc8 100755 --- a/tests/fedora-flags/runtest.sh +++ b/tests/fedora-flags/runtest.sh @@ -1,22 +1,20 @@ #!/bin/bash -set -x +set -ex pipefail -status=0 +cflags=`rpm -D '%toolchain clang' -E %{build_cflags}` +cxxflags=`rpm -D '%toolchain clang' -E %{build_cxxflags}` +ldflags=`rpm -D '%toolchain clang' -E %{build_ldflags}` -# arhmfp not tested due to rhbz#1918924. -arches="s390x ppc64le x86_64 i386 aarch64" -for arch in $arches; do - root="fedora-rawhide-$arch" - mock -r $root --install clang - mock -r $root --copyin main.c main.cpp hello.c hello.cpp test-clang.sh . - if mock -r $root --shell bash test-clang.sh; then - echo "$arch: PASS" - else - echo "$arch: FAIL" - status=1 - fi -done +# 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" -exit $status +# 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" diff --git a/tests/fedora-flags/test-clang.sh b/tests/fedora-flags/test-clang.sh deleted file mode 100644 index 2a06dd8..0000000 --- a/tests/fedora-flags/test-clang.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -set -ex pipefail - -function check_flags { - if [ -z "$1" ]; then - echo "FAIL: failed to get rpm flags" - exit 1 - fi -} - -cflags=`rpm -D '%toolchain clang' -E %{build_cflags}` -cxxflags=`rpm -D '%toolchain clang' -E %{build_cxxflags}` -ldflags=`rpm -D '%toolchain clang' -E %{build_ldflags}` - -check_flags "$cflags" -check_flags "$cxxflags" -check_flags "$ldflags" - -# 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" - -# 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" diff --git a/tests/tests.yml b/tests/tests.yml index fc4368a..c720883 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -22,8 +22,6 @@ - glibc-static - gcc # Required for fedora-flags: - - mock - - qemu-user-static - annobin - redhat-rpm-config # Required for clang-format-diff