From 7e97d8a41f9d7b0fb82742cdd871a18804267c72 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 2 Nov 2016 16:55:57 +0200 Subject: Restructure testscript parser slightly --- build2/test/rule.cxx | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'build2/test/rule.cxx') diff --git a/build2/test/rule.cxx b/build2/test/rule.cxx index 12b052f..487856b 100644 --- a/build2/test/rule.cxx +++ b/build2/test/rule.cxx @@ -423,23 +423,11 @@ namespace build2 if (verb) text << "test " << t << " with " << ts; - const path& sp (ts.path ()); - assert (!sp.empty ()); // Should have been assigned by update. + script::parser p; + script::script s (p.pre_parse (ts, t, wd)); - try - { - script::script s (t, ts, wd); - script::concurrent_runner r; - - ifdstream ifs (sp); - script::parser p; - p.pre_parse (ifs, sp, s); - p.parse (sp, s, r); - } - catch (const io_error& e) - { - fail << "unable to read testscript " << sp << ": " << e.what (); - } + script::concurrent_runner r; + p.parse (s, r); }; for (target* pt: t.prerequisite_targets) -- cgit v1.1