summaryrefslogtreecommitdiff
blob: 959388dfd9bf9a773ebb362f2c3b286252cb38a1 (plain)
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
44
45
46
47
48
49
50
51
#!/bin/bash
metagen() {
    PYTHONPATH=. ./metagen/main.py "$@"
}

handle_error() {
    ret=$?
    echo FAILED. >&2
    exit ${ret}
}
trap handle_error ERR

unset ECHANGELOG_USER
PS4='# '
set -x
########################################
# BEGIN tests
########################################


#Should fail as -t ... is missing
! metagen -m -Q
! metagen -e mail@example.org -Q

#Should fail if ECHANGELOG_USER not set:
ECHANGELOG_USER='First Last <mail@example.org>' metagen -m -Q -t person
! metagen -m -Q -t person

metagen -e "someguy@gentoo.org" -d "Maint desc" -Q -t person

metagen -e "someguy@gentoo.org" -n "Jon Doe" -d "Maint desc" -Q -t person

#Should fail if ECHANGELOG_USER not set:
ECHANGELOG_USER='First Last <mail@example.org>' metagen -m -e "foo@bar.com" -d "Foo bar.","Chow fun" -Q -t person
! metagen -m -e "foo@bar.com" -d "Foo bar.","Chow fun" -Q -t person

#Should fail:
! metagen -Q -t person

#Should fail:
! metagen -l "Long desc" -Q -t person

#Should fail:
! metagen -d "Maintainer desc" -Q -t person


########################################
# END tests
########################################
echo
echo PASSED.