1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
#!/bin/sh
# tests the -V switch in fim
# TODO : should be integrated in the vim-like test suite.
f=${FIM_EXE-src/fim} # for e.g. Debian's post-installation tests
fail()
{
echo "[!] $@";
exit -1;
}
succeed()
{
echo "[*] $@";
exit 0;
}
which grep || fail "we don't go anywhere without grep in our pocket"
g="`which grep` -i"
# -V should return 0
$f -V 2>&1 > /dev/null || fail "$f -V returns an incorrect code"
e='s/^.*://g'
for s in 'supported output devices' 'supported file formats'
do
$f -V 2>&1 | $g "$s" || fail "need the $s info message!"
[ -z "`$f -V 2>&1 | $g \"$s\" | sed \"$e\"`" ] && fail "no $s ?"
done
succeed "Version string check based test PASSED"
exit 0
|