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 @@ -# This file is part of GNU pies testsuite. -*- Autotest -*- -# Copyright (C) 2019-2020 Sergey Poznyakoff +# This file is part of GNU pies testsuite. -*- autotest -*- +# Copyright (C) 2019-2023 Sergey Poznyakoff # # GNU pies is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,6 +15,7 @@ # along with GNU pies. If not, see <http://www.gnu.org/licenses/>. AT_SETUP([Detecting cyclic dependencies]) + AT_CHECK([ PIES_XFAIL_CHECK # The following matrices describe the test.conf configuration file below. @@ -91,7 +92,7 @@ component h { } ]) -pies --config-file test.conf --dump-depmap | trimws +pies --no-preprocessor --config-file test.conf --dump-depmap | trimws ], [0], [Dependency map: @@ -105,10 +106,38 @@ Legend: 1: g 2: h ], -[pies: component a depends on itself +[pies: cyclic dependencies detected: pies: a -> d -> c -> e -> a -pies: component b depends on itself pies: b -> b ]) +AT_CHECK([ +AT_DATA([test.conf],[ +component a { + command "a"; + prerequisites (b,c); +} +component b { + command "b"; + prerequisites (c); +} +component c { + command "c"; + prerequisites (d); +} +component d { + command "d"; + prerequisites (a); +} +]) +pies --no-preprocessor --config-file test.conf --dump-depmap | trimws +], +[0], +[No components defined +], +[pies: cyclic dependencies detected: +pies: a -> c -> d -> a +pies: a -> b -> c -> d -> a +]) + AT_CLEANUP |