diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 1 | ||||
-rw-r--r-- | tests/atlocal.in | 6 | ||||
-rw-r--r-- | tests/cyclic.at | 114 | ||||
-rw-r--r-- | tests/testsuite.at | 2 |
4 files changed, 122 insertions, 1 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index 5ef3796..6c387cb 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am | |||
@@ -43,2 +43,3 @@ TESTSUITE_AT = \ | |||
43 | control.at\ | 43 | control.at\ |
44 | cyclic.at\ | ||
44 | respawn.at\ | 45 | respawn.at\ |
diff --git a/tests/atlocal.in b/tests/atlocal.in index 2ba1462..9069bbd 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in | |||
@@ -2,3 +2,3 @@ | |||
2 | # Configurable variable values for GNU Pies test suite. | 2 | # Configurable variable values for GNU Pies test suite. |
3 | # Copyright (C) 2016-2017 Sergey Poznyakoff | 3 | # Copyright (C) 2016-2019 Sergey Poznyakoff |
4 | 4 | ||
@@ -6 +6,5 @@ PATH=@abs_builddir@:@abs_top_builddir@/src:$srcdir:$PATH | |||
6 | XFAILFILE=$abs_builddir/.badversion | 6 | XFAILFILE=$abs_builddir/.badversion |
7 | |||
8 | trimws() { | ||
9 | sed 's/[ ][ ]*$//' | ||
10 | } | ||
diff --git a/tests/cyclic.at b/tests/cyclic.at new file mode 100644 index 0000000..27da22e --- /dev/null +++ b/tests/cyclic.at | |||
@@ -0,0 +1,114 @@ | |||
1 | # This file is part of GNU pies testsuite. -*- Autotest -*- | ||
2 | # Copyright (C) 2019 Sergey Poznyakoff | ||
3 | # | ||
4 | # GNU pies is free software; you can redistribute it and/or modify | ||
5 | # it under the terms of the GNU General Public License as published by | ||
6 | # the Free Software Foundation; either version 3, or (at your option) | ||
7 | # any later version. | ||
8 | # | ||
9 | # GNU pies is distributed in the hope that it will be useful, | ||
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | # GNU General Public License for more details. | ||
13 | # | ||
14 | # You should have received a copy of the GNU General Public License | ||
15 | # along with GNU pies. If not, see <http://www.gnu.org/licenses/>. | ||
16 | |||
17 | AT_SETUP([Detecting cyclic dependencies]) | ||
18 | AT_CHECK([ | ||
19 | PIES_XFAIL_CHECK | ||
20 | # The following matrices describe the test.conf configuration file below. | ||
21 | # | ||
22 | # Dependency matrix: | ||
23 | # 0 1 2 3 4 5 6 7 | ||
24 | # 0 X X | ||
25 | # 1 X | ||
26 | # 2 X | ||
27 | # 3 X | ||
28 | # 4 X | ||
29 | # 5 | ||
30 | # 6 X | ||
31 | # 7 | ||
32 | # | ||
33 | # Transitive closure: | ||
34 | # 0 1 2 3 4 5 6 7 | ||
35 | # 0 X X X X X | ||
36 | # 1 X | ||
37 | # 2 X X X X X | ||
38 | # 3 X X X X X | ||
39 | # 4 X X X X X | ||
40 | # 5 | ||
41 | # 6 X | ||
42 | # 7 | ||
43 | # | ||
44 | # Legend: | ||
45 | # 0: a | ||
46 | # 1: b | ||
47 | # 2: c | ||
48 | # 3: d | ||
49 | # 4: e | ||
50 | # 5: f | ||
51 | # 6: g | ||
52 | # 7: h | ||
53 | |||
54 | AT_DATA([test.conf], | ||
55 | [component a { | ||
56 | command "a"; | ||
57 | prerequisites (b,d); | ||
58 | } | ||
59 | |||
60 | component b { | ||
61 | command "b"; | ||
62 | prerequisites (b); | ||
63 | } | ||
64 | |||
65 | component c { | ||
66 | command "c"; | ||
67 | prerequisites (e); | ||
68 | } | ||
69 | |||
70 | component d { | ||
71 | command "d"; | ||
72 | prerequisites (c); | ||
73 | } | ||
74 | |||
75 | component e { | ||
76 | command "e"; | ||
77 | prerequisites (a); | ||
78 | } | ||
79 | |||
80 | component f { | ||
81 | command "f"; | ||
82 | } | ||
83 | |||
84 | component g { | ||
85 | command "g"; | ||
86 | prerequisites (h); | ||
87 | } | ||
88 | |||
89 | component h { | ||
90 | command "h"; | ||
91 | } | ||
92 | ]) | ||
93 | |||
94 | pies --config-file test.conf --dump-depmap | trimws | ||
95 | ], | ||
96 | [0], | ||
97 | [Dependency map: | ||
98 | 0 1 2 | ||
99 | 0 | ||
100 | 1 X | ||
101 | 2 | ||
102 | |||
103 | Legend: | ||
104 | 0: f | ||
105 | 1: g | ||
106 | 2: h | ||
107 | ], | ||
108 | [pies: component a depends on itself | ||
109 | pies: a -> d -> c -> e -> a | ||
110 | pies: component b depends on itself | ||
111 | pies: b -> b | ||
112 | ]) | ||
113 | |||
114 | AT_CLEANUP | ||
diff --git a/tests/testsuite.at b/tests/testsuite.at index 152b77f..7f4e7b8 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at | |||
@@ -60,2 +60,4 @@ m4_include([version.at]) | |||
60 | m4_include([control.at]) | 60 | m4_include([control.at]) |
61 | AT_BANNER([Dependencies]) | ||
62 | m4_include([cyclic.at]) | ||
61 | AT_BANNER([Components]) | 63 | AT_BANNER([Components]) |