Files
libunwind/tests/test-runner.in
Stephen Webb 7e16c2d244 Make tests installable
Tests will now always be built (unless configured with --disable-tests)
and installed by default in ${prefix}/libexec/libunwind. A new script,
test-runner, is supplied to run all of the tests and produce TAP output.

configure.ac: make tests/check-namespace.sh executable,
    add license boilerplate
tests/Makefile.am: remove run-coredump-unwind, add test-runner,
    add license boilerplate, remove XFAIL for riscv64
tests/README.md: new file
tests/check-namespace.sh.in: make LIBUNWIND and LIBUNWIND_GENERIC
    externally settable, add license boilerplate
tests/run-check-namespace: remove file
test/run-ptrace-mapper: look for test-ptrace relative to script,
    add license boilerplate
test/run-ptrace-misc: look for test-ptrace relative to script,
    add license boilerplate
test/test-runner.in: new file
.github/workflows/CI-unix.yml: change run-check-namespace to
    check-namespace.sh, use libtool to run in-tree binaries instead of
    forcing static linking
2024-02-14 08:55:01 -05:00

46 lines
1.7 KiB
Bash

#!/bin/sh
#
# This file is part of libunwind.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
test_dir="$(dirname $0)"
: ${LIBUNWIND:=@LIBDIR@/libunwind.so}
: ${LIBUNWIND_GENERIC:=@LIBDIR@/libunwind-@ARCH@.so}
count=0
printf "TAP version 14\n"
for t in @TESTS@; do
"$test_dir/$t" >$t.out 2>$t.err
status=$?
if [ $status = 77 ]; then
printf "%d ok - %s # SKIP\n" $count "$t"
elif [ $status = 0 ]; then
printf "%d ok - %s\n" $count "$t"
elif (echo @XFAIL_TESTS@ | grep -Fqw "$t"); then
printf "%d not ok - %s # TODO\n" $count "$t"
else
printf "%d not ok - %s returned %d\n" $count "$t" $status
fi
count=$(expr $count + 1)
done
printf "1..%d\n" $count