summaryrefslogtreecommitdiffstats
path: root/test/nbb-config.at
blob: cc44e441adfaf81a1ca7ae33590818b2180beb0a (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
dnl ===================================================================

AT_COPYRIGHT([Copyright (C) 2008 Hans Ulrich Niedermann])
AT_TESTED([nbb])

dnl ===================================================================

AT_SETUP([nbb config: git defaults])
AT_KEYWORDS([nbb git config])
AT_CHECK([mkdir test.git && cd test.git])
AT_CHECK([cd test.git && git init | AT_GIT_INIT_OUTPUT_CANONICAL], [0],
[Initialized empty Git repository in .git/
])
AT_DATA([test.git/configure.ac], [dnl
AC[_]INIT(nbb-test-git, 1.2.3, invalid@invalid.invalid)
AC[_]OUTPUT
])
AT_CHECK([echo "$PWD/test.git" > expout
cd test.git && AT_NBB config srcdir], [0], [expout])
AT_CHECK([echo "$PWD/test.git/_build/master" > expout
cd test.git && AT_NBB config builddir], [0], [expout])
AT_CHECK([echo "$PWD/test.git/_install/master" > expout
cd test.git && AT_NBB config installdir], [0], [expout])
AT_CHECK([rm -rf test.git])
AT_CLEANUP()

dnl ===================================================================

AT_SETUP([nbb config: git set/get])
AT_KEYWORDS([nbb git config])
AT_CHECK([mkdir test.git && cd test.git])
AT_CHECK([cd test.git && git init | AT_GIT_INIT_OUTPUT_CANONICAL], [0],
[Initialized empty Git repository in .git/
])
AT_DATA([test.git/configure.ac], [dnl
AC[_]INIT(nbb-test-git, 1.2.3, invalid@invalid.invalid)
AC[_]OUTPUT
])
AT_CHECK([echo "$PWD/test.git" > expout
cd test.git && AT_NBB config srcdir], [0], [expout])
AT_CHECK([echo "$PWD/test.git/_build/master" > expout
cd test.git && AT_NBB config builddir], [0], [expout])
AT_CHECK([cd test.git && nbb config builddir _foo])
AT_CHECK([echo "$PWD/test.git/_foo/master" > expout
cd test.git && AT_NBB config builddir], [0], [expout])
AT_CHECK([cd test.git && nbb config builddir _bar])
AT_CHECK([echo "$PWD/test.git/_bar/master" > expout
cd test.git && AT_NBB config builddir], [0], [expout])
dnl TBD: --unset or something similar to reset to defaults
AT_CHECK([rm -rf test.git])
AT_CLEANUP()

dnl ===================================================================

AT_SETUP([nbb config: bzr defaults])
AT_KEYWORDS([nbb bzr config])
AT_CHECK([mkdir test.bzr && cd test.bzr])
AT_CHECK([cd test.bzr && bzr init && bzr nick testnick])
echo "$PWD/test.bzr" > expout
AT_DATA([test.bzr/configure.ac], [dnl
AC[_]INIT(nbb-test-bzr, 1.2.3, invalid@invalid.invalid)
AC[_]OUTPUT
])
AT_CHECK([cd test.bzr && AT_NBB config srcdir], [0], [expout])
echo "$PWD/test.bzr/_build/testnick" > expout
AT_CHECK([cd test.bzr && AT_NBB config builddir], [0], [expout])
echo "$PWD/test.bzr/_install/testnick" > expout
AT_CHECK([cd test.bzr && AT_NBB config installdir], [0], [expout])
AT_CHECK([rm -rf test.bzr])
AT_CLEANUP()

dnl ===================================================================