diff --git a/Sanity/gcc-fedora-flags/hello.c b/Sanity/gcc-fedora-flags/hello.c new file mode 100644 index 0000000..51b259b --- /dev/null +++ b/Sanity/gcc-fedora-flags/hello.c @@ -0,0 +1,5 @@ +#include + +void hello() { + printf("Hello World\n"); +} diff --git a/Sanity/gcc-fedora-flags/hello.cpp b/Sanity/gcc-fedora-flags/hello.cpp new file mode 100644 index 0000000..400612b --- /dev/null +++ b/Sanity/gcc-fedora-flags/hello.cpp @@ -0,0 +1,5 @@ +#include + +void hello() { + std::cout << "Hello World\n"; +} diff --git a/Sanity/gcc-fedora-flags/main.c b/Sanity/gcc-fedora-flags/main.c new file mode 100644 index 0000000..1a3455d --- /dev/null +++ b/Sanity/gcc-fedora-flags/main.c @@ -0,0 +1,6 @@ +void hello(); + +int main(int argc, char **argv) { + hello(); + return 0; +} diff --git a/Sanity/gcc-fedora-flags/main.cpp b/Sanity/gcc-fedora-flags/main.cpp new file mode 100644 index 0000000..1a3455d --- /dev/null +++ b/Sanity/gcc-fedora-flags/main.cpp @@ -0,0 +1,6 @@ +void hello(); + +int main(int argc, char **argv) { + hello(); + return 0; +} diff --git a/Sanity/gcc-fedora-flags/main.fmf b/Sanity/gcc-fedora-flags/main.fmf new file mode 100644 index 0000000..b6c5612 --- /dev/null +++ b/Sanity/gcc-fedora-flags/main.fmf @@ -0,0 +1,22 @@ +summary: gcc-fedora-flags +description: '' +contact: +- Tom Stellard +component: +- annobin +test: ./runtest.sh +framework: beakerlib +recommend: +- gcc +- gcc-c++ +- annobin-plugin-gcc +- annobin +- annobin-annocheck +- redhat-rpm-config +duration: 1h +adjust: + - enabled: false + when: distro != fedora + continue: false +extra-summary: /tools/annobin/Sanity/gcc-fedora-flags +extra-task: /tools/annobin/Sanity/gcc-fedora-flags diff --git a/Sanity/gcc-fedora-flags/runtest.sh b/Sanity/gcc-fedora-flags/runtest.sh new file mode 100755 index 0000000..2031f46 --- /dev/null +++ b/Sanity/gcc-fedora-flags/runtest.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +set -x + +default_cflags=`rpm -E %{build_cflags}` +default_cxxflags=`rpm -E %{build_cxxflags}` +default_ldflags=`rpm -E %{build_ldflags}` + +cflags=`rpm -D '%toolchain gcc' -E %{build_cflags}` +cxxflags=`rpm -D '%toolchain gcc' -E %{build_cxxflags}` +ldflags=`rpm -D '%toolchain gcc' -E %{build_ldflags}` + +set +x + +rlJournalStart +rlPhaseStartTest + rlRun "rpm -qa | grep -F -e redhat-rpm-config -e gcc -e annobin -e binutils | sort" + + rlRun "test \"$default_cflags\" = \"$cflags\"" + rlRun "test \"$default_cxxflags\" = \"$cxxflags\"" + rlRun "test \"$default_ldflags\" = \"$ldflags\"" + + rlRun "gcc $cflags -o hello.o -c hello.c" + rlRun "annocheck hello.o" + rlRun "gcc $cflags -o main.o -c main.c" + rlRun "gcc $ldflags -o hello main.o hello.o" + rlRun "annocheck hello" + rlRun "./hello | grep \"Hello World\"" + + rlRun "g++ $cxxflags -o hello-cpp.o -c hello.cpp" + rlRun "annocheck hello-cpp.o" + rlRun "g++ $cxxflags -o main-cpp.o -c main.cpp" + rlRun "g++ $ldflags -o hello-cpp main-cpp.o hello-cpp.o" + rlRun "annocheck hello-cpp" + rlRun "./hello-cpp | grep \"Hello World\"" +rlPhaseEnd +rlJournalPrintText +rlJournalEnd