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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
#!/bin/bash
# Note that not specifying the input format tests the format
# autodetection. We first produce output in all formats with no other
# transformation, and we end with producing canonical output without
# specifying the output format.
testhelper=../testScripts/testhelper
testName="$1"
shift
formats="m2 cocoa4 4ti2 singular"
if [ "$testName" = "null" ]; then
null="-iformat null"
fi
if [ "$1" = "_full" ];
then
shift;
# Test same-format transform.
for format in $formats; do
$testhelper ptransform $testName.$format $testName.$format $*;
if [ $? != 0 ]; then exit 1; fi
done
# And again with specified formats.
for format in $formats null; do
$testhelper ptransform $testName.$format $testName.$format $* \
-iformat $format -oformat $format
if [ $? != 0 ]; then exit 1; fi
done
# Test same-format transform on canon.
$testhelper ptransform $testName.canon $testName.canon $* $null;
if [ $? != 0 ]; then exit 1; fi
# And again with -canon option.
$testhelper ptransform $testName.canon $testName.canon $* -canon $null;
if [ $? != 0 ]; then exit 1; fi
fi
for format in $formats null count; do
# Test format conversion to $format
$testhelper ptransform $testName.test $testName.$format $* \
-oformat $format $null;
if [ $? != 0 ]; then exit 1; fi
done
# Test canonicalization of input
$testhelper ptransform $testName.test $testName.canon $* -canon $null
|