~ubuntu-branches/ubuntu/trusty/libprelude/trusty

« back to all changes in this revision

Viewing changes to libmissing/tests/test-perror.sh

  • Committer: Bazaar Package Importer
  • Author(s): Alessio Treglia
  • Date: 2009-04-29 11:31:50 UTC
  • mfrom: (1.1.12 upstream) (2.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090429113150-qw9oxc1e50ldljck
Tags: 0.9.22-2ubuntu1
* Merge from debian unstable, remaining changes:
  - Build-Depend on libltdl7-dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
tmpfiles=""
 
4
trap 'rm -fr $tmpfiles' 1 2 3 15
 
5
 
 
6
# Test NULL prefix. Result should not contain a number.
 
7
tmpfiles="$tmpfiles t-perror.tmp"
 
8
./test-perror${EXEEXT} 2>&1 >/dev/null | LC_ALL=C tr -d '\r' > t-perror.tmp
 
9
if grep '[0-9]' t-perror.tmp > /dev/null; then
 
10
  rm -fr $tmpfiles; exit 1
 
11
fi
 
12
 
 
13
# Test empty prefix. Result should be the same.
 
14
tmpfiles="$tmpfiles t-perror1.tmp"
 
15
./test-perror${EXEEXT} '' 2>&1 >/dev/null | LC_ALL=C tr -d '\r' > t-perror1.tmp
 
16
diff t-perror.tmp t-perror1.tmp
 
17
test $? = 0 || { rm -fr $tmpfiles; exit 1; }
 
18
 
 
19
# Test non-empty prefix.
 
20
tmpfiles="$tmpfiles t-perror2.tmp t-perror3.tmp"
 
21
./test-perror${EXEEXT} 'foo' 2>&1 >/dev/null | LC_ALL=C tr -d '\r' > t-perror3.tmp
 
22
sed -e 's/^/foo: /' < t-perror.tmp > t-perror2.tmp
 
23
diff t-perror2.tmp t-perror3.tmp
 
24
test $? = 0 || { rm -fr $tmpfiles; exit 1; }
 
25
 
 
26
rm -fr $tmpfiles
 
27
exit 0