From 26af9268e98ed4c82c83b8f6e3f94af71b109eba Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 9 Dec 2020 21:23:38 +0300 Subject: Fix set pseudo-builtin to reset special variables when required --- libbuild2/test/script/script.hxx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'libbuild2/test/script/script.hxx') diff --git a/libbuild2/test/script/script.hxx b/libbuild2/test/script/script.hxx index d387a11..53e4329 100644 --- a/libbuild2/test/script/script.hxx +++ b/libbuild2/test/script/script.hxx @@ -303,12 +303,27 @@ namespace build2 variable_pool var_pool; mutable shared_mutex var_pool_mutex; + // Used to compose a test command. + // + // Changing any of their values requires resetting the $* and $N + // special aliases. + // const variable& test_var; // test const variable& options_var; // test.options const variable& arguments_var; // test.arguments const variable& redirects_var; // test.redirects const variable& cleanups_var; // test.cleanups + bool + test_command_var (const string& name) const + { + return name == test_var.name || + name == options_var.name || + name == arguments_var.name || + name == redirects_var.name || + name == cleanups_var.name; + } + const variable& wd_var; // $~ const variable& id_var; // $@ const variable& cmd_var; // $* -- cgit v1.1