aboutsummaryrefslogtreecommitdiff
path: root/build2/test/script/runner
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-10-21 17:41:09 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-11-04 09:26:34 +0200
commit64cbe53f7361075f841572854f1065a6f7c6507c (patch)
tree6f37bf0fed1303f1cda337296d35b3dfc8a60a35 /build2/test/script/runner
parenta199a557c732af8ec52f52b35d4b81673d607791 (diff)
Add testscript runner scope enter/leave callbacks
Diffstat (limited to 'build2/test/script/runner')
-rw-r--r--build2/test/script/runner19
1 files changed, 17 insertions, 2 deletions
diff --git a/build2/test/script/runner b/build2/test/script/runner
index e2cffcf..c4f87ee 100644
--- a/build2/test/script/runner
+++ b/build2/test/script/runner
@@ -21,6 +21,10 @@ namespace build2
class runner
{
public:
+ // Location is the scope start location (for diagnostics, etc).
+ //
+ virtual void
+ enter (scope&, const location&) = 0;
// Index is the 1-base index of this command in the command list
// (e.g., in a compound test). If it is 0 then it means there is only
@@ -31,14 +35,25 @@ namespace build2
// It can be used in diagnostics.
//
virtual void
- run (const scope&, const command&, size_t index, const location&) = 0;
+ run (scope&, const command&, size_t index, const location&) = 0;
+
+ // Location is the scope end location (for diagnostics, etc).
+ //
+ virtual void
+ leave (scope&, const location&) = 0;
};
class concurrent_runner: public runner
{
public:
virtual void
- run (const scope&, const command&, size_t, const location&) override;
+ enter (scope&, const location&) override {}
+
+ virtual void
+ run (scope&, const command&, size_t, const location&) override;
+
+ virtual void
+ leave (scope&, const location&) override {}
};
}
}