File: testn.sh

package info (click to toggle)
glusterfs 11.2-2
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 28,244 kB
  • sloc: ansic: 471,238; sh: 45,610; python: 16,893; perl: 3,328; makefile: 2,014; yacc: 487; ruby: 171; lisp: 124; xml: 75; lex: 61
file content (16 lines) | stat: -rwxr-xr-x 435 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash
#
# Use this script to identify the command and line-number of test-cases.
#

if [ -z "${1}" -a -z "${2}" ]
then
        echo "Usage: ${0} path/to/test/case.t testnumber"
        exit 1
elif [ -z "${2}" ]
then
        echo "ERROR: The second parameter to ${0} should be a number."
        exit 2
fi

awk '{print FNR " " $0}' ${1} | egrep '^[[:digit:]]+[[:space:]]*(EXPECT|TEST|EXPECT_WITHIN|EXPECT_KEYWORD)' | sed -n ${2}p