|
Packit Service |
97d2fb |
#! /usr/bin/env bash
|
|
Packit Service |
97d2fb |
# Copyright (C) 2017 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 |
tempfiles objects.list test.ar
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
echo Make a sorted list of the just build src .o files.
|
|
Packit Service |
97d2fb |
(cd ${abs_top_builddir}/src; ls *.o | sort) > objects.list
|
|
Packit Service |
97d2fb |
cat objects.list
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
echo Create a new ar file with the .o files.
|
|
Packit Service |
97d2fb |
testrun ${abs_top_builddir}/src/ar -r test.ar \
|
|
Packit Service |
97d2fb |
$(echo ${abs_top_builddir}/src/*.o | sort)
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
echo List the ar file contents.
|
|
Packit Service |
97d2fb |
testrun_compare ${abs_top_builddir}/src/ar -t test.ar < objects.list
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
echo Delete all objects again.
|
|
Packit Service |
97d2fb |
testrun ${abs_top_builddir}/src/ar -d test.ar $(cat objects.list)
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
echo Check new ar file is now empty
|
|
Packit Service |
97d2fb |
testrun_compare ${abs_top_builddir}/src/ar -t test.ar << EOF
|
|
Packit Service |
97d2fb |
EOF
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
exit 0
|