mirror of
https://github.com/mgree/ffs.git
synced 2024-09-17 14:07:15 +03:00
35f6bf8188
Update to fuser=0.9 (i.e., 0.9.1). Update websites, version numbers, etc. for new release. Finally use `destroy` properly, got rid of the `Drop` impl for `FS`. Drop `AutoUnmount` which wasn't doing anything anyway. Fixes and improvements to CI, docs, and logging.
64 lines
1.3 KiB
Bash
Executable File
64 lines
1.3 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
if ! which ffs >/dev/null 2>&1
|
|
then
|
|
DEBUG="$(pwd)/target/debug"
|
|
[ -x "$DEBUG/ffs" ] || {
|
|
echo Couldn\'t find ffs on "$PATH" or in "$DEBUG". >&2
|
|
echo Are you in the root directory of the repo? >&2
|
|
exit 1
|
|
}
|
|
PATH="$DEBUG:$PATH"
|
|
fi
|
|
|
|
TOTAL=0
|
|
FAILED=0
|
|
ERRORS=""
|
|
cd tests
|
|
|
|
LOG=$(mktemp -d)
|
|
|
|
# spawn 'em all in parallel
|
|
for test in *.sh
|
|
do
|
|
tname="$(basename ${test%*.sh})"
|
|
printf "========== STARTING TEST: $tname\n"
|
|
(RUST_LOG="ffs=debug,fuser=debug"; export RUST_LOG; ./${test} >$LOG/$tname.out 2>$LOG/$tname.err; echo $?>$LOG/$tname.ec) &
|
|
: $((TOTAL += 1))
|
|
|
|
# don't slam 'em
|
|
if [ $((TOTAL % 4)) -eq 0 ]
|
|
then
|
|
wait %-
|
|
fi
|
|
done
|
|
|
|
wait
|
|
|
|
for test in *.sh
|
|
do
|
|
tname="$(basename ${test%*.sh})"
|
|
if [ "$(cat $LOG/$tname.ec)" -eq 0 ]
|
|
then
|
|
printf "========== PASSED: $tname\n"
|
|
else
|
|
printf "========== FAILED: $tname (ec=$(cat $LOG/$tname.ec))\n"
|
|
: $((FAILED += 1))
|
|
fi
|
|
|
|
# just always capture output in the CI logs
|
|
if [ "$(cat $LOG/$tname.ec)" -ne 0 ] || [ "$CI" ]
|
|
then
|
|
printf "<<<<<<<<<< STDOUT\n"
|
|
cat $LOG/$tname.out
|
|
printf "<<<<<<<<<< STDERR\n"
|
|
cat $LOG/$tname.err
|
|
printf "\n"
|
|
fi
|
|
done
|
|
|
|
printf "$((TOTAL - FAILED))/$((TOTAL)) tests passed\n"
|
|
|
|
rm -r $LOG
|
|
[ $FAILED -eq 0 ] || exit 1
|