From 1845141809aa91b03718066a6f46863885a6a887 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 7 Mar 2019 09:06:37 +0200 Subject: Add support for alternative build file/directory naming scheme Now the build/*.build, buildfile, and .buildignore filesystem entries in a project can alternatively (but consistently) be called build2/*.build2, build2file, and .build2ignore. See a note at the beginning of the Project Structure section in the manual for details (motivation, restrictions, etc). --- build2/test/rule.cxx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'build2/test/rule.cxx') diff --git a/build2/test/rule.cxx b/build2/test/rule.cxx index 2ff7ebf..941609d 100644 --- a/build2/test/rule.cxx +++ b/build2/test/rule.cxx @@ -437,9 +437,11 @@ namespace build2 // backlink_*() in algorithm.cxx for details.) // const scope& bs (t.base_scope ()); + const scope& rs (*bs.root_scope ()); + const path& buildignore_file (rs.root_extra->buildignore_file); dir_path bl; - if (cast_false (bs.root_scope ()->vars[var_forwarded])) + if (cast_false (rs.vars[var_forwarded])) { bl = bs.src_path () / wd.leaf (bs.out_path ()); clean_backlink (bl, verb_never); @@ -471,10 +473,11 @@ namespace build2 bool fail (before == output_before::fail); (fail ? error : warn) << "working directory " << wd << " exists " - << (empty_buildignore (wd) + << (empty_buildignore (wd, buildignore_file) ? "" : "and is not empty ") << "at the beginning of the test"; + if (fail) throw failed (); } @@ -513,7 +516,7 @@ namespace build2 { if (mk) { - mkdir_buildignore (wd, 2); + mkdir_buildignore (wd, buildignore_file, 2); mk = false; } @@ -568,11 +571,11 @@ namespace build2 // if (!bad && !one && !mk && after == output_after::clean) { - if (!empty_buildignore (wd)) + if (!empty_buildignore (wd, buildignore_file)) fail << "working directory " << wd << " is not empty at the " << "end of the test"; - rmdir_buildignore (wd, 2); + rmdir_buildignore (wd, buildignore_file, 2); } // Backlink if the working directory exists. -- cgit v1.1