diff options
Diffstat (limited to 'tests/cyclic.at')
-rw-r--r-- | tests/cyclic.at | 114 |
1 files changed, 114 insertions, 0 deletions
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 | ||