mirror of
git://c9x.me/qbe.git
synced 2026-04-05 18:09:47 +00:00
tools/test.sh: allow running against installed package
If $bin is set in the environment, use it instead of using `qbe` from the source tree. The same for $binref. This supports the following use cases: - I have a qbe package installed, and I want to test my local changes with the installed packages as a reference: $ binref=/usr/bin/qbe ./tools/test.sh all - I want to test the installed qbe against new tests that I have written, to reproduce a bug: $ bin=/usr/bin/qbe ./tools/test.sh test/newtest.ssa In Debian, we also run tests against the installed package when dependencies change, etc. We will also run on several architectures where the necessary cross compilers might not be available. So make tests that cannot be run because of a missing compiler exit with 77, signaling to Debian's autopkgtest that the test is skipped.
This commit is contained in:
parent
789e38fdb2
commit
f7ab20680b
@ -1,8 +1,12 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
dir=`dirname "$0"`
|
dir=`dirname "$0"`
|
||||||
|
if [ -z "${bin:-}" ]; then
|
||||||
bin=$dir/../qbe
|
bin=$dir/../qbe
|
||||||
binref=$dir/../qbe.ref
|
fi
|
||||||
|
if [ -z "${binref:-}" ]; then
|
||||||
|
binref=${bin}.ref
|
||||||
|
fi
|
||||||
|
|
||||||
tmp=/tmp/qbe.zzzz
|
tmp=/tmp/qbe.zzzz
|
||||||
|
|
||||||
@ -34,7 +38,7 @@ init() {
|
|||||||
if test -z "$cc"
|
if test -z "$cc"
|
||||||
then
|
then
|
||||||
echo "Cannot find arm64 compiler or qemu."
|
echo "Cannot find arm64 compiler or qemu."
|
||||||
exit 1
|
exit 77
|
||||||
fi
|
fi
|
||||||
bin="$bin -t arm64"
|
bin="$bin -t arm64"
|
||||||
;;
|
;;
|
||||||
@ -58,7 +62,7 @@ init() {
|
|||||||
if test -z "$cc"
|
if test -z "$cc"
|
||||||
then
|
then
|
||||||
echo "Cannot find riscv64 compiler or qemu."
|
echo "Cannot find riscv64 compiler or qemu."
|
||||||
exit 1
|
exit 77
|
||||||
fi
|
fi
|
||||||
bin="$bin -t rv64"
|
bin="$bin -t rv64"
|
||||||
;;
|
;;
|
||||||
@ -82,7 +86,7 @@ init() {
|
|||||||
if test -z "$cc"
|
if test -z "$cc"
|
||||||
then
|
then
|
||||||
echo "Cannot find x86_64 compiler or qemu."
|
echo "Cannot find x86_64 compiler or qemu."
|
||||||
exit 1
|
exit 77
|
||||||
fi
|
fi
|
||||||
bin="$bin -t amd64_sysv"
|
bin="$bin -t amd64_sysv"
|
||||||
;;
|
;;
|
||||||
@ -106,7 +110,7 @@ init() {
|
|||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Unknown target '$TARGET'."
|
echo "Unknown target '$TARGET'."
|
||||||
exit 1
|
exit 77
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user