about summary refs log tree commit diff
path: root/test/pamexec.test
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2020-06-08 14:31:55 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2020-06-08 14:31:55 +0000
commitab2c3e2053f1caea636b781542bb032f72074821 (patch)
treecfedb9c69207a6a7901aa88ca027c31f3414fcf6 /test/pamexec.test
parent92957c23f07558fa9d73e183a9739eed240bf7b4 (diff)
downloadnetpbm-mirror-ab2c3e2053f1caea636b781542bb032f72074821.tar.gz
netpbm-mirror-ab2c3e2053f1caea636b781542bb032f72074821.tar.xz
netpbm-mirror-ab2c3e2053f1caea636b781542bb032f72074821.zip
Add tests
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@3854 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test/pamexec.test')
-rwxr-xr-xtest/pamexec.test38
1 files changed, 38 insertions, 0 deletions
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