-rw-r--r-- | tests/cyclic.at | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/tests/cyclic.at b/tests/cyclic.at index 7c24acf..2d580a0 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-2021 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. @@ -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 --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 |