File: run_tests.check

package info (click to toggle)
ace 6.0.3%2Bdfsg-0.1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 49,368 kB
  • sloc: cpp: 341,826; perl: 30,850; ansic: 20,952; makefile: 10,144; sh: 4,744; python: 828; exp: 787; yacc: 511; xml: 330; lex: 158; lisp: 116; csh: 48; tcl: 5
file content (41 lines) | stat: -rwxr-xr-x 1,140 bytes parent folder | download
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
#! /bin/sh -f
# $Id: run_tests.check 80826 2008-03-04 14:51:23Z wotte $
#
# Checks one ore more ACE test log file(s) for expected results.

IFS="|"
tmp=/tmp

# These patterns must be contained in log file.
SUCCESS_MSGS="Starting|Ending"

# These patterns should not be contained in log file.
if [ "$1" != "log/Cached_Accept_Conn_Test.log" ]; then
  ERROR_MSGS="assertion failed|not supported|No such file or directory|Invalid argument|timeout|Bad file number"
else
  # "No such file or directory" is allowed in Cached_Accept_Conn_Test.log
  ERROR_MSGS="assertion failed|not supported|Invalid argument|timeout|Bad file number"
fi
status=0

for arg do
  for i in $SUCCESS_MSGS; do
    egrep $i $arg >/dev/null 2>&1
    if [ $? -eq 1 ]; then
      echo Error in $arg:  no line with $i
      status=1
    fi
  done

  for i in $ERROR_MSGS; do
    #### The /dev/null arg to egrep causes the filename to be printed
    #### out.  The sed command strips off the leading 'log/' and
    #### trailing '.log'.
    egrep $i $arg /dev/null | sed -e 's%^log/%%' -e 's%[.]log:%: %'
    if [ $? -ne 0 ]; then status=1; fi
  done
done

exit $status

# EOF