Imported from the Fedora annobin repo
Copied from: https://src.fedoraproject.org/rpms/annobin/blob/rawhide/f/tests/Sanity/gcc-fedora-flags
This commit is contained in:
parent
680c2cac32
commit
64852cd1e4
6 changed files with 84 additions and 0 deletions
5
Sanity/gcc-fedora-flags/hello.c
Normal file
5
Sanity/gcc-fedora-flags/hello.c
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#include <stdio.h>
|
||||
|
||||
void hello() {
|
||||
printf("Hello World\n");
|
||||
}
|
||||
5
Sanity/gcc-fedora-flags/hello.cpp
Normal file
5
Sanity/gcc-fedora-flags/hello.cpp
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#include <iostream>
|
||||
|
||||
void hello() {
|
||||
std::cout << "Hello World\n";
|
||||
}
|
||||
6
Sanity/gcc-fedora-flags/main.c
Normal file
6
Sanity/gcc-fedora-flags/main.c
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
void hello();
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
hello();
|
||||
return 0;
|
||||
}
|
||||
6
Sanity/gcc-fedora-flags/main.cpp
Normal file
6
Sanity/gcc-fedora-flags/main.cpp
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
void hello();
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
hello();
|
||||
return 0;
|
||||
}
|
||||
22
Sanity/gcc-fedora-flags/main.fmf
Normal file
22
Sanity/gcc-fedora-flags/main.fmf
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
summary: gcc-fedora-flags
|
||||
description: ''
|
||||
contact:
|
||||
- Tom Stellard <tstellar@redhat.com>
|
||||
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
|
||||
40
Sanity/gcc-fedora-flags/runtest.sh
Executable file
40
Sanity/gcc-fedora-flags/runtest.sh
Executable file
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue