diff options
author | Mattias Andrée <maandree@kth.se> | 2016-03-23 21:13:24 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2016-03-23 21:13:24 +0100 |
commit | 1592905cae44234d04ed843705a8ed9fdb27b312 (patch) | |
tree | 7ec7de98228db7c83b8d473f4875d0a14076c218 /test-all | |
parent | add another checksum test: check_multi (diff) | |
download | base-util-tests-1592905cae44234d04ed843705a8ed9fdb27b312.tar.gz base-util-tests-1592905cae44234d04ed843705a8ed9fdb27b312.tar.bz2 base-util-tests-1592905cae44234d04ed843705a8ed9fdb27b312.tar.xz |
add test script that runs all tests
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'test-all')
-rwxr-xr-x | test-all | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/test-all b/test-all new file mode 100755 index 0000000..2b3a2e8 --- /dev/null +++ b/test-all @@ -0,0 +1,54 @@ +#!/bin/bash + +cd -- "$(dirname "$0")" + +if test -n "${IN_PATH}"; then + export PATCH="$(which patch)" + export MD5SUM="$(which md5sum)" + export RAWSHAKE256SUM="$(which rawshake256sum)" + export RAWSHAKE512SUM="$(which rawshake512sum)" + export SHA1SUM="$(which sha1sum)" + export SHA224SUM="$(which sha224sum)" + export SHA256SUM="$(which sha256sum)" + export SHA3_224SUM="$(which sha3-224sum)" + export SHA3_256SUM="$(which sha3-256sum)" + export SHA3_384SUM="$(which sha3-384sum)" + export SHA3_512SUM="$(which sha3-512sum)" + export SHA384SUM="$(which sha384sum)" + export SHA512_224SUM="$(which sha512-224sum)" + export SHA512_256SUM="$(which sha512-256sum)" + export SHA512SUM="$(which sha512sum)" + export SHAKE256SUM="$(which shake256sum)" + export SHAKE512SUM="$(which shake512sum)" +fi + +if test $# = 0; then + set patch md5sum rawshake256sum rawshake512sum sha1sum sha224sum sha256sum sha3-224sum \ + sha3-256sum sha3-384sum sha3-512sum sha384sum sha512-224sum sha512-256sum sha512sum \ + shake256sum shake512sum +fi + +true > result + +for t in $@; do + printf '\033[1mTesting %s ...\033[m\n' "$t" + if ! ./${t}-test/test; then + echo $t >> result + fi + echo +done + +test $(wc -l < result) = 0 +ret=$? +if ! test $ret = 0; then + echo + printf '\033[1mThe following utilities did not pass all tests, or possibility as not found:\033[m\n' + echo + cat result +else + echo + printf '\033[1mYour system is awesome!\033[m\n' + echo +fi +rm result +exit $ret |