aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2016-11-08 13:35:13 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2016-11-08 16:12:59 +0300
commit6e1f59670b7aaabb27830a345aad9532af111016 (patch)
tree8346d96f67244a99f6c945cb427cc13ea9299c73
parentee49a8c2a3dbe88c625599a750c9219e3118b008 (diff)
Get rid of faulty test script move-ctor
-rw-r--r--build2/test/rule.cxx3
-rw-r--r--build2/test/script/parser8
-rw-r--r--build2/test/script/parser.cxx17
-rw-r--r--build2/test/script/script2
-rw-r--r--unit-tests/test/script/parser/driver.cxx4
5 files changed, 16 insertions, 18 deletions
diff --git a/build2/test/rule.cxx b/build2/test/rule.cxx
index 487856b..089f560 100644
--- a/build2/test/rule.cxx
+++ b/build2/test/rule.cxx
@@ -424,7 +424,8 @@ namespace build2
text << "test " << t << " with " << ts;
script::parser p;
- script::script s (p.pre_parse (ts, t, wd));
+ script::script s (t, ts, wd);
+ p.pre_parse (s);
script::concurrent_runner r;
p.parse (s, r);
diff --git a/build2/test/script/parser b/build2/test/script/parser
index 30e39b9..b99c487 100644
--- a/build2/test/script/parser
+++ b/build2/test/script/parser
@@ -28,11 +28,11 @@ namespace build2
public:
// Issue diagnostics and throw failed in case of an error.
//
- script
- pre_parse (testscript&, target&, const dir_path& root_wd);
+ void
+ pre_parse (script&);
- script
- pre_parse (istream&, testscript&, target&, const dir_path& root_wd);
+ void
+ pre_parse (istream&, script&);
void
parse (script& s, runner& r)
diff --git a/build2/test/script/parser.cxx b/build2/test/script/parser.cxx
index de453e5..5902008 100644
--- a/build2/test/script/parser.cxx
+++ b/build2/test/script/parser.cxx
@@ -30,16 +30,16 @@ namespace build2
return !s.empty ();
}
- script parser::
- pre_parse (testscript& ts, target& tg, const dir_path& wd)
+ void parser::
+ pre_parse (script& s)
{
- const path& p (ts.path ());
+ const path& p (s.script_target.path ());
assert (!p.empty ()); // Should have been assigned.
try
{
ifdstream ifs (p);
- return pre_parse (ifs, ts, tg, wd);
+ pre_parse (ifs, s);
}
catch (const io_error& e)
{
@@ -48,11 +48,10 @@ namespace build2
}
}
- script parser::
- pre_parse (istream& is, testscript& ts, target& tg, const dir_path& wd)
+ void parser::
+ pre_parse (istream& is, script& s)
{
- script s (tg, ts, wd);
- path_ = &*s.paths_.insert (ts.path ()).first;
+ path_ = &*s.paths_.insert (s.script_target.path ()).first;
pre_parse_ = true;
@@ -83,8 +82,6 @@ namespace build2
fail (t) << "stray " << t;
group_->end_loc_ = get_location (t);
-
- return s;
}
void parser::
diff --git a/build2/test/script/script b/build2/test/script/script
index 6d121ea..0964af1 100644
--- a/build2/test/script/script
+++ b/build2/test/script/script
@@ -371,7 +371,7 @@ namespace build2
testscript& script_target,
const dir_path& root_wd);
- script (script&&) = default;
+ script (script&&) = delete;
script (const script&) = delete;
script& operator= (script&&) = delete;
script& operator= (const script&) = delete;
diff --git a/unit-tests/test/script/parser/driver.cxx b/unit-tests/test/script/parser/driver.cxx
index deb9994..badb658 100644
--- a/unit-tests/test/script/parser/driver.cxx
+++ b/unit-tests/test/script/parser/driver.cxx
@@ -165,8 +165,8 @@ namespace build2
// Parse and run.
//
parser p;
- script s (
- p.pre_parse (cin, st, tt, dir_path (work) /= "test-driver"));
+ script s (tt, st, dir_path (work) /= "test-driver");
+ p.pre_parse (cin, s);
print_runner r (scope, id);
p.parse (s, r);