From ab2c3e2053f1caea636b781542bb032f72074821 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Mon, 8 Jun 2020 14:31:55 +0000 Subject: Add tests git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@3854 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- test/pamexec.test | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 test/pamexec.test (limited to 'test/pamexec.test') diff --git a/test/pamexec.test b/test/pamexec.test new file mode 100755 index 00000000..acf162c3 --- /dev/null +++ b/test/pamexec.test @@ -0,0 +1,38 @@ +#! /bin/bash +# This script tests: pamexec +# Also requires: pbmtext pamfile pbmminkowski pbmtog3 g3topbm + +tmpdir=${tmpdir:-/tmp} +test_pbm=${tmpdir}/test.pbm +combined_pbm=${tmpdir}/combined.pbm + +for i in `seq 0 9`; do echo $i | pbmtext -builtin=fixed > ${test_pbm}$i; done +cat ${test_pbm}[0123456789] > ${combined_pbm} + +echo "Test 1 : Should print 10 stdin: PBM RAW 21 24 1 1 BLACKANDWHITE twice" + +cat ${combined_pbm} | pamfile -all -mach | uniq -c +pamexec "pamfile -mach" ${combined_pbm} | uniq -c + +echo "Test 2: Should print 1791121103 989 twice" + +for i in `seq 0 9`; do pbmminkowski ${test_pbm}$i ; done | cksum +pamexec "pbmminkowski" ${combined_pbm} | cksum + +rm ${test_pbm}[0123456789] + +echo "Test 3: Should print 2983705297 810 twice" + +pamexec "pbmtog3 -no | g3topbm" ${combined_pbm} | cksum +cat ${combined_pbm} | cksum + +echo "Invalid command" 1>&2 +echo "Errors message should appear below the line." 1>&2 +echo "-----------------------------------------------------------" 1>&2 + +echo "Test Invalid: Should not print anything" + +pamexec "false" ${combined_pbm} +pamexec "pamfile | false" ${combined_pbm} + +rm ${combined_pbm} \ No newline at end of file -- cgit 1.4.1