File: strip.tst

package info (click to toggle)
a2ps 1:4.14-1.1+deb6u1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 12,324 kB
  • ctags: 4,908
  • sloc: ansic: 26,659; sh: 13,155; lex: 2,286; perl: 1,156; yacc: 757; makefile: 605; lisp: 398; ada: 263; objc: 189; f90: 109; ml: 85; sql: 74; pascal: 57; modula3: 33; haskell: 32; sed: 30; java: 29; python: 24
file content (39 lines) | stat: -rwxr-xr-x 898 bytes parent folder | download | duplicates (10)
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
#! /bin/sh
# -*- ksh -*-

# This program checks that a2ps handles correctly --strip

# This is were you installed the tested version of the program
# (and the directories test, test-ps and diff)

: ${SRCDIR=.}
. $SRCDIR/defs || exit 1

# Where is the test file
TEST_FILE=$TST_DIR/prosamp.pre

# Initialize the success
failure=0

for strip_level in 0 1 2 3
do
  # Checked and reference outputs
  REF_FILE=$REF_DIR/strip-${strip_level}.ps
  CHK_FILE=$CHK_DIR/strip-${strip_level}.ps

  # The options to run a2ps with
  OPT="-Epre --strip-level=${strip_level} -P awkout"

  # Generation of the reports
  # It must not crash
  $CHK $OPT $TEST_FILE > $CHK_FILE
  test $? = 0 || exit 1

  # build the ref if not here
  test -f $REF_FILE || $REF $OPT $TEST_FILE > $REF_FILE

  # it must not print the ps header: just receive `OK'
  cmp -s $REF_FILE $CHK_FILE 2> /dev/null || failure=1
done

exit $failure