aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-10-25 07:11:09 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-11-04 09:26:35 +0200
commitf2522265c0e778f3c545d8f984b2621369b10c17 (patch)
treee0c8b6d546be87c83993da3dc9abc575afa81781
parentd816d38bc503e3a98ade2e443d4bf399a9da76e7 (diff)
Minor name changes in testscript object model
-rw-r--r--build2/test/script/runner.cxx10
-rw-r--r--build2/test/script/script7
2 files changed, 9 insertions, 8 deletions
diff --git a/build2/test/script/runner.cxx b/build2/test/script/runner.cxx
index 85044ff..995da4f 100644
--- a/build2/test/script/runner.cxx
+++ b/build2/test/script/runner.cxx
@@ -63,7 +63,7 @@ namespace build2
try
{
ofdstream os (orp);
- sp.rm_paths.emplace_back (orp);
+ sp.cleanups.emplace_back (orp);
os << rd.value;
os.close ();
}
@@ -157,13 +157,13 @@ namespace build2
fail << "directory " << sp.wd_path << " is not empty" <<
info << "clean it up and rerun";
- sp.rm_paths.emplace_back (sp.wd_path);
+ sp.cleanups.emplace_back (sp.wd_path);
}
void concurrent_runner::
leave (scope& sp, const location& cl)
{
- for (const auto& p: reverse_iterate (sp.rm_paths))
+ for (const auto& p: reverse_iterate (sp.cleanups))
{
if (p.to_directory ())
{
@@ -173,7 +173,7 @@ namespace build2
if (r != rmdir_status::success)
fail (cl) << "registered for cleanup directory " << d
<< (r == rmdir_status::not_empty
- ? " not empty"
+ ? " is not empty"
: " does not exist");
}
else if (rmfile (p, 2) == rmfile_status::not_exist)
@@ -257,7 +257,7 @@ namespace build2
try
{
os.open (p);
- sp.rm_paths.emplace_back (p);
+ sp.cleanups.emplace_back (p);
}
catch (const io_error& e)
{
diff --git a/build2/test/script/script b/build2/test/script/script
index a5fb0ef..2d74b16 100644
--- a/build2/test/script/script
+++ b/build2/test/script/script
@@ -122,10 +122,11 @@ namespace build2
const path& id_path; // Id path ($@, relative in POSIX form).
const dir_path& wd_path; // Working dir ($~, absolute and normalized).
- // Files and directories that must be automatically removed when the
- // scope is left.
+ // Files and directories that must be automatically cleaned up when
+ // the scope is left. If the path ends with a trailing slash, then it
+ // is assumed to be to a directory, otherwise -- to a file.
//
- paths rm_paths;
+ paths cleanups;
// Variables.
//