From e0c4447666837d92db63f4dfc8e949cbd4520327 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Mon, 24 Feb 2014 00:43:45 +0200 Subject: [PATCH] Test for recursive instantiations of subprojects. --- interpreter.py | 4 ++-- test cases/failing/8 recursive/meson.build | 3 +++ test cases/failing/8 recursive/subprojects/a/meson.build | 3 +++ test cases/failing/8 recursive/subprojects/b/meson.build | 3 +++ 4 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 test cases/failing/8 recursive/meson.build create mode 100644 test cases/failing/8 recursive/subprojects/a/meson.build create mode 100644 test cases/failing/8 recursive/subprojects/b/meson.build diff --git a/interpreter.py b/interpreter.py index 51b1ebc25..88f4b7480 100644 --- a/interpreter.py +++ b/interpreter.py @@ -797,7 +797,7 @@ class Interpreter(): if self.subdir != '': raise InterpreterException('Subprojects must be defined at the root directory.') if dirname in self.subproject_stack: - fullstack = self.subdir_stack + [dirname] + fullstack = self.subproject_stack + [dirname] incpath = ' => '.join(fullstack) raise InterpreterException('Recursive include of subprojects: %s.' % incpath) if dirname == self.subprojects: @@ -809,7 +809,7 @@ class Interpreter(): self.global_flags_frozen = True mlog.log('\nExecuting subproject ', mlog.bold(dirname), '.\n', sep='') subi = Interpreter(self.build, subdir) - subi.subproject_stack = self.subproject_stack + [subdir] + subi.subproject_stack = self.subproject_stack + [dirname] subi.run() mlog.log('\nSubproject', mlog.bold(dirname), 'finished.') self.build.subprojects[dirname] = True diff --git a/test cases/failing/8 recursive/meson.build b/test cases/failing/8 recursive/meson.build new file mode 100644 index 000000000..f3152946d --- /dev/null +++ b/test cases/failing/8 recursive/meson.build @@ -0,0 +1,3 @@ +project('recursive', 'c') + +a = subproject('a') diff --git a/test cases/failing/8 recursive/subprojects/a/meson.build b/test cases/failing/8 recursive/subprojects/a/meson.build new file mode 100644 index 000000000..7c6040bc6 --- /dev/null +++ b/test cases/failing/8 recursive/subprojects/a/meson.build @@ -0,0 +1,3 @@ +project('a', 'c') + +b = subproject('b') diff --git a/test cases/failing/8 recursive/subprojects/b/meson.build b/test cases/failing/8 recursive/subprojects/b/meson.build new file mode 100644 index 000000000..d0beeb7d9 --- /dev/null +++ b/test cases/failing/8 recursive/subprojects/b/meson.build @@ -0,0 +1,3 @@ +project('b', 'c') + +a = subproject('a')