File: m_mu.at

package info (click to toggle)
lbdb 0.57-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,264 kB
  • sloc: sh: 7,550; ansic: 1,779; perl: 381; lisp: 265; makefile: 226; objc: 44
file content (99 lines) | stat: -rw-r--r-- 3,856 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
dnl Copyright (c) 2024-2025 Roland Rosenfeld <roland@spinnaker.de>
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2 of the License, or
dnl (at your option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License along
dnl with this program; if not, see <https://www.gnu.org/licenses/>.

AT_BANNER([Test m_mu])

AT_SETUP(m_mu)
AT_SKIP_IF([! which mu])
AT_CHECK([perl $abs_srcdir/gen-maildir $abs_srcdir/data])
AT_CHECK([mu init --maildir=$(pwd)/maildir --muhome=$(pwd)/muhome \
                  --my-address=me@example.org >/dev/null])
AT_CHECK([mu index --muhome=$(pwd)/muhome >/dev/null])
AT_CHECK([cat $abs_srcdir/data/m_mu.expected > expout])
AT_CHECK([env LBDB_OVERRIDE_METHODS=m_mu \
              OVERRIDE_MU_HOME=muhome \
              OVERRIDE_MU_PERSONAL='' \
              OVERRIDE_MU_AFTER='' \
              OVERRIDE_MU_IGNORE_MISSINGNAME='' \
          lbdbq example], [], [expout])
AT_CLEANUP


AT_SETUP(m_mu personal)
AT_SKIP_IF([! which mu])
# mu before 1.8 has broken --personal switch, so skip this test
muversion=`mu --version | head -n 1 \
           | sed -n 's/.* \([[0-9]]\+\.[[0-9]]\+\).*/\1/p'`
muversionstate=1
case "$muversion" in
     1.[[0-7]]) muversionstate=0;;
     [2-9].*) muversionstate=0;;
esac
AT_SKIP_IF([exit $muversionstate])

AT_CHECK([perl $abs_srcdir/gen-maildir $abs_srcdir/data])
AT_CHECK([mu init --maildir=$(pwd)/maildir --muhome=$(pwd)/muhome \
                  --my-address=me@example.org >/dev/null])
AT_CHECK([mu index --muhome=$(pwd)/muhome >/dev/null])
AT_CHECK([cat $abs_srcdir/data/m_mu-personal.expected > expout])
AT_CHECK([env LBDB_OVERRIDE_METHODS=m_mu \
              OVERRIDE_MU_HOME=muhome \
              OVERRIDE_MU_PERSONAL=true \
              OVERRIDE_MU_AFTER='' \
              OVERRIDE_MU_IGNORE_MISSINGNAME='' \
          lbdbq example], [], [expout])
AT_CLEANUP


AT_SETUP(m_mu after)
AT_SKIP_IF([! which mu])
# mu before 1.8 seems to have broken --after switch, so skip this test
muversion=`mu --version | head -n 1 \
           | sed -n 's/.* \([[0-9]]\+\.[[0-9]]\+\).*/\1/p'`
muversionstate=1
case "$muversion" in
     1.[[0-7]]) muversionstate=0;;
     [2-9].*) muversionstate=0;;
esac
AT_SKIP_IF([exit $muversionstate])

AT_CHECK([perl $abs_srcdir/gen-maildir $abs_srcdir/data])
AT_CHECK([mu init --maildir=$(pwd)/maildir --muhome=$(pwd)/muhome \
                  --my-address=me@example.org >/dev/null])
AT_CHECK([mu index --muhome=$(pwd)/muhome >/dev/null])
AT_CHECK([cat $abs_srcdir/data/m_mu-after.expected > expout])
AT_CHECK([env LBDB_OVERRIDE_METHODS=m_mu \
              OVERRIDE_MU_HOME=muhome \
              OVERRIDE_MU_PERSONAL='' \
              OVERRIDE_MU_AFTER='1684195200' \
              OVERRIDE_MU_IGNORE_MISSINGNAME='' \
          lbdbq example], [], [expout])
AT_CLEANUP


AT_SETUP(m_mu ignore missingname)
AT_SKIP_IF([! which mu])
AT_CHECK([perl $abs_srcdir/gen-maildir $abs_srcdir/data])
AT_CHECK([mu init --maildir=$(pwd)/maildir --muhome=$(pwd)/muhome \
                  --my-address=me@example.org >/dev/null])
AT_CHECK([mu index --muhome=$(pwd)/muhome >/dev/null])
AT_CHECK([cat $abs_srcdir/data/m_mu-ignoremissingname.expected > expout])
AT_CHECK([env LBDB_OVERRIDE_METHODS=m_mu \
              OVERRIDE_MU_HOME=muhome \
              OVERRIDE_MU_PERSONAL='' \
              OVERRIDE_MU_AFTER='' \
              OVERRIDE_MU_IGNORE_MISSINGNAME='true' \
          lbdbq example], [], [expout])
AT_CLEANUP