diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2019-08-22 14:38:57 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2019-08-22 16:16:32 +0200 |
commit | 4f5b6cb7ed4e05e98cce7e692462f49e24b7a39a (patch) | |
tree | 4184fa33e116ec74747feec0c15e30219c7d087b /libbuild2/test/script/parser.test.cxx | |
parent | 739f68b9e45c925ccc5a28b9b796030272575e2b (diff) |
Targets, scopes, vars
Diffstat (limited to 'libbuild2/test/script/parser.test.cxx')
-rw-r--r-- | libbuild2/test/script/parser.test.cxx | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/libbuild2/test/script/parser.test.cxx b/libbuild2/test/script/parser.test.cxx index ab1f295..e45674b 100644 --- a/libbuild2/test/script/parser.test.cxx +++ b/libbuild2/test/script/parser.test.cxx @@ -9,7 +9,7 @@ #include <libbuild2/utility.hxx> #include <libbuild2/target.hxx> -#include <libbuild2/context.hxx> // reset() +#include <libbuild2/context.hxx> #include <libbuild2/scheduler.hxx> #include <libbuild2/test/target.hxx> @@ -156,7 +156,7 @@ namespace build2 init_diag (1); init (nullptr, argv[0]); sched.startup (1); // Serial execution. - reset (strings ()); // No command line variables. + context ctx (sched); bool scope (false); bool id (false); @@ -195,32 +195,32 @@ namespace build2 // really care. // file& tt ( - targets.insert<file> (work, - dir_path (), - "driver", - string (), - trace)); + ctx.targets.insert<file> (work, + dir_path (), + "driver", + string (), + trace)); value& v ( tt.assign ( - var_pool.rw ().insert<target_triplet> ( + ctx.var_pool.rw ().insert<target_triplet> ( "test.target", variable_visibility::project))); - v = cast<target_triplet> ((*global_scope)["build.host"]); + v = cast<target_triplet> (ctx.global_scope["build.host"]); testscript& st ( - targets.insert<testscript> (work, - dir_path (), - name.leaf ().base ().string (), - name.leaf ().extension (), - trace)); + ctx.targets.insert<testscript> (work, + dir_path (), + name.leaf ().base ().string (), + name.leaf ().extension (), + trace)); tt.path (path ("driver")); st.path (name); // Parse and run. // - parser p; + parser p (ctx); script s (tt, st, dir_path (work) /= "test-driver"); p.pre_parse (cin, s); |