File: 000_func

package info (click to toggle)
apt-listbugs 0.1.16
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,088 kB
  • ctags: 108
  • sloc: ruby: 2,280; sh: 210; makefile: 49
file content (43 lines) | stat: -rw-r--r-- 490 bytes parent folder | download | duplicates (4)
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
42
43
#!/bin/bash

success()
{
    if "$@" ; then
        :
    else
        exit 1;
    fi
}

fail()
{
    if "$@"; then
        exit 1;
    else
        :
    fi
}

grep-result()
{
    local v="$1"
    shift
    "$@" 2>&1 | tee tests/log/tmp
    if grep "$v" tests/log/tmp; then
        return
    else
        exit 1
    fi
}

grep-result-not()
{
    local v="$1"
    shift
    "$@" 2>&1 | tee tests/log/tmp
    if grep "$v" tests/log/tmp; then
        exit 1
    else
        return
    fi
}