diff options
Diffstat (limited to 'tests/cyclic.at')
-rw-r--r-- | tests/cyclic.at | 39 |
1 files changed, 34 insertions, 5 deletions
diff --git a/tests/cyclic.at b/tests/cyclic.at index 7c24acf..96a7b41 100644 --- a/tests/cyclic.at +++ b/tests/cyclic.at | |||
@@ -1,5 +1,5 @@ | |||
1 | # This file is part of GNU pies testsuite. -*- Autotest -*- | 1 | # This file is part of GNU pies testsuite. -*- autotest -*- |
2 | # Copyright (C) 2019-2020 Sergey Poznyakoff | 2 | # Copyright (C) 2019-2023 Sergey Poznyakoff |
3 | # | 3 | # |
4 | # GNU pies is free software; you can redistribute it and/or modify | 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 | 5 | # it under the terms of the GNU General Public License as published by |
@@ -15,6 +15,7 @@ | |||
15 | # along with GNU pies. If not, see <http://www.gnu.org/licenses/>. | 15 | # along with GNU pies. If not, see <http://www.gnu.org/licenses/>. |
16 | 16 | ||
17 | AT_SETUP([Detecting cyclic dependencies]) | 17 | AT_SETUP([Detecting cyclic dependencies]) |
18 | |||
18 | AT_CHECK([ | 19 | AT_CHECK([ |
19 | PIES_XFAIL_CHECK | 20 | PIES_XFAIL_CHECK |
20 | # The following matrices describe the test.conf configuration file below. | 21 | # The following matrices describe the test.conf configuration file below. |
@@ -91,7 +92,7 @@ component h { | |||
91 | } | 92 | } |
92 | ]) | 93 | ]) |
93 | 94 | ||
94 | pies --config-file test.conf --dump-depmap | trimws | 95 | pies --no-preprocessor --config-file test.conf --dump-depmap | trimws |
95 | ], | 96 | ], |
96 | [0], | 97 | [0], |
97 | [Dependency map: | 98 | [Dependency map: |
@@ -105,10 +106,38 @@ Legend: | |||
105 | 1: g | 106 | 1: g |
106 | 2: h | 107 | 2: h |
107 | ], | 108 | ], |
108 | [pies: component a depends on itself | 109 | [pies: cyclic dependencies detected: |
109 | pies: a -> d -> c -> e -> a | 110 | pies: a -> d -> c -> e -> a |
110 | pies: component b depends on itself | ||
111 | pies: b -> b | 111 | pies: b -> b |
112 | ]) | 112 | ]) |
113 | 113 | ||
114 | AT_CHECK([ | ||
115 | AT_DATA([test.conf],[ | ||
116 | component a { | ||
117 | command "a"; | ||
118 | prerequisites (b,c); | ||
119 | } | ||
120 | component b { | ||
121 | command "b"; | ||
122 | prerequisites (c); | ||
123 | } | ||
124 | component c { | ||
125 | command "c"; | ||
126 | prerequisites (d); | ||
127 | } | ||
128 | component d { | ||
129 | command "d"; | ||
130 | prerequisites (a); | ||
131 | } | ||
132 | ]) | ||
133 | pies --no-preprocessor --config-file test.conf --dump-depmap | trimws | ||
134 | ], | ||
135 | [0], | ||
136 | [No components defined | ||
137 | ], | ||
138 | [pies: cyclic dependencies detected: | ||
139 | pies: a -> c -> d -> a | ||
140 | pies: a -> b -> c -> d -> a | ||
141 | ]) | ||
142 | |||
114 | AT_CLEANUP | 143 | AT_CLEANUP |