aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/test/script/script.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-08-22 14:38:57 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-08-23 18:14:07 +0200
commit5035f4ef68922ac758b1e4734e67d73c9228010b (patch)
tree271fdd5b1d6e995a058d97aacb3ac90a538d9ff1 /libbuild2/test/script/script.hxx
parent8793941652d6aa1c3d02b2f87f691e6d06254b7d (diff)
Introduce notion of build context
All non-const global state is now in class context and we can now have multiple independent builds going on at the same time.
Diffstat (limited to 'libbuild2/test/script/script.hxx')
-rw-r--r--libbuild2/test/script/script.hxx19
1 files changed, 10 insertions, 9 deletions
diff --git a/libbuild2/test/script/script.hxx b/libbuild2/test/script/script.hxx
index e3f8251..8b34be8 100644
--- a/libbuild2/test/script/script.hxx
+++ b/libbuild2/test/script/script.hxx
@@ -343,7 +343,7 @@ namespace build2
{
public:
scope* const parent; // NULL for the root (script) scope.
- script* const root; // Self for the root (script) scope.
+ script& root; // Self for the root (script) scope.
// The chain of if-else scope alternatives. See also if_cond_ below.
//
@@ -424,7 +424,7 @@ namespace build2
~scope () = default;
protected:
- scope (const string& id, scope* parent, script* root);
+ scope (const string& id, scope* parent, script& root);
// Pre-parse data.
//
@@ -452,7 +452,7 @@ namespace build2
group (const string& id, group& p): scope (id, &p, p.root) {}
protected:
- group (const string& id, script* r): scope (id, nullptr, r) {}
+ group (const string& id, script& r): scope (id, nullptr, r) {}
// Pre-parse data.
//
@@ -505,7 +505,13 @@ namespace build2
class script_base // Make sure certain things are initialized early.
{
protected:
- script_base ();
+ script_base (const target& test_target,
+ const testscript& script_target);
+
+ public:
+ const target& test_target; // Target we are testing.
+ const build2::scope& target_scope; // Base scope of test target.
+ const testscript& script_target; // Target of the testscript file.
public:
variable_pool var_pool;
@@ -535,11 +541,6 @@ namespace build2
script& operator= (script&&) = delete;
script& operator= (const script&) = delete;
- public:
- const target& test_target; // Target we are testing.
- const build2::scope& target_scope; // Base scope of test target.
- const testscript& script_target; // Target of the testscript file.
-
// Pre-parse data.
//
private: