39 lines
1.1 KiB
Bash
39 lines
1.1 KiB
Bash
|
#!/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 "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
|