~ubuntu-x-swat/xorg-server/xsmoke

« back to all changes in this revision

Viewing changes to lib/xsmoke.lib

  • Committer: Bryce Harrington
  • Date: 2008-12-06 21:41:00 UTC
  • Revision ID: bryce@canonical.com-20081206214100-95y5lrh3i1rhickr
Adding support for printing out summary info as json files

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
    test $(id -u) = 0
12
12
}
13
13
 
14
 
print_test_summary() {
15
 
    echo "Tests: $test_count;  Passed: $pass_count;  Failed: $fail_count"
16
 
}
17
 
 
18
14
warn() {
19
15
    echo "Warning:  $1" 1>&2
20
16
}
41
37
    return 1
42
38
}
43
39
 
 
40
print_test_summary() {
 
41
    echo "Tests: $test_count;  Passed: $pass_count;  Failed: $fail_count"
 
42
}
 
43
 
 
44
json_test_summary() {
 
45
    [ ! -z "$1" ] || return 1
 
46
    echo > $1 <<EOF
 
47
{
 
48
    "tests":      "$test_count",
 
49
    "passed":     "$pass_count",
 
50
    "failed":     "$fail_count"
 
51
}
 
52
EOF
 
53
    return 0
 
54
}
 
55
 
44
56
is_running() {
45
57
    proc=$1
46
58
    $(pidof $proc > /dev/null)