binutils/tests/test_gold_linker
2023-03-20 12:03:19 +00:00

42 lines
1.2 KiB
Bash

#!/bin/sh
# Checks that as works
. /usr/share/beakerlib/beakerlib.sh
# Set the full test name
TEST="/AppStream/binutils/Sanity/ld.gold"
# Package being tested
PACKAGE="binutils"
rlJournalStart
# Setup phase: Prepare test directory
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlRun 'TmpDir=$(mktemp -d)' 0 'Creating tmp directory' # no-reboot
rlRun "pushd $TmpDir"
rlPhaseEnd
# Test phase: Test the GOLD linker
# FIXME: This is way too simplistic. The linker testsuite does a much
# more thorough job, but that has already been run as part of the binutils
# build process, and besides we do not have access to an unpacked source
# tree here.
rlPhaseStartTest
rlRun "echo nop >nop.s" 0 "Create a test assembler source file"
rlRun "as nop.s -o nop.o" 0 "Assemble the test file"
rlRun "ld.gold -e 0 nop.o -o nop.exe" 0 "Link the test file"
rlAssertExists "nop.exe"
rlPhaseEnd
# Cleanup phase: Remove test directory
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalEnd
# Print the test report
rlJournalPrintText