Blame tests/run-dwelf_elf_e_machine_string.sh

Packit Service 97d2fb
#! /usr/bin/env bash
Packit Service 97d2fb
# Test to make sure all EM values in elf.h are recognized
Packit Service 97d2fb
# Copyright (C) 2019 Red Hat, Inc.
Packit Service 97d2fb
# This file is part of elfutils.
Packit Service 97d2fb
#
Packit Service 97d2fb
# This file is free software; you can redistribute it and/or modify
Packit Service 97d2fb
# it under the terms of the GNU General Public License as published by
Packit Service 97d2fb
# the Free Software Foundation; either version 3 of the License, or
Packit Service 97d2fb
# (at your option) any later version.
Packit Service 97d2fb
#
Packit Service 97d2fb
# elfutils is distributed in the hope that it will be useful, but
Packit Service 97d2fb
# WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 97d2fb
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service 97d2fb
# GNU General Public License for more details.
Packit Service 97d2fb
#
Packit Service 97d2fb
# You should have received a copy of the GNU General Public License
Packit Service 97d2fb
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
Packit Service 97d2fb
Packit Service 97d2fb
. $srcdir/test-subr.sh
Packit Service 97d2fb
Packit Service 97d2fb
# Get all known EM values from elf.h and pass them through the
Packit Service 97d2fb
# preprocessor to get the numbers. Call dwelf_elf_e_machine_string on
Packit Service 97d2fb
# all of them.
Packit Service 97d2fb
EM_VALUES=$(grep ^\#define\ EM_ ${abs_srcdir}/../libelf/elf.h \
Packit Service 97d2fb
            | cut -f2 -d\  | cut -f1 | grep -v ^EM_NUM$ | xargs echo)
Packit Service 97d2fb
# echo "EM_VALUES: $EM_VALUES"
Packit Service 97d2fb
EM_NUMBERS=$((cat ${abs_srcdir}/../libelf/elf.h; echo "$EM_VALUES") \
Packit Service 97d2fb
             | gcc -E - | tail -1)
Packit Service 97d2fb
# echo "EM_NUMBERS: $EM_NUMBERS"
Packit Service 97d2fb
Packit Service 97d2fb
testrun ${abs_top_builddir}/tests/dwelf_elf_e_machine_string $EM_NUMBERS